Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MTP-1939: Upgrade core tech #591

Merged
merged 5 commits into from
Feb 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.py]
[*.{cfg,md,py}]
indent_size = 4
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
16
18
4 changes: 2 additions & 2 deletions .tx/config
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[main]
host = https://www.transifex.com

[mtp.cashbook]
[o:ministry-of-justice:p:mtp:r:cashbook]
file_filter = mtp_cashbook/translations/<lang>/LC_MESSAGES/django.po
source_file = mtp_cashbook/translations/django.pot
source_lang = en_GB
type = PO
type = PO
24 changes: 13 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,34 +1,34 @@
# Digital Cashbook
# Digital Cashbook – Prisoner Money

Business hub staff facing site for [Prisoner Money suite of apps](https://github.com/ministryofjustice/money-to-prisoners).

## Requirements

- Unix-like platform with Python 3.8+ and NodeJS 16 (e.g. via [nvm](https://github.com/nvm-sh/nvm#nvmrc))
- Unix-like platform with Python 3.10 and NodeJS 18 (e.g. via [nvm](https://github.com/nvm-sh/nvm#installing-and-updating) or [fnm](https://github.com/Schniz/fnm#installation))

## Running locally

It's recommended that you use a python virtual environment to isolate each application.
Its recommended that you use a python virtual environment to isolate each application.

The simplest way to do this is using:

```shell script
```shell
python3 -m venv venv # creates a virtual environment for dependencies; only needed the first time
. venv/bin/activate # activates the virtual environment; needed every time you use this app
```

Some build tasks expect the active virtual environment to be at `/venv/`, but should generally work regardless of
its location.

You can copy `mtp_cashbook/settings/local.py.sample` to `local.py` to overlay local settings that won't be committed,
You can copy `mtp_cashbook/settings/local.py.sample` to `local.py` to overlay local settings that wont be committed,
but it’s not required for a standard setup.

In order to run the application locally, it is necessary to have the API running.
Please refer to the [money-to-prisoners-api](https://github.com/ministryofjustice/money-to-prisoners-api/) repository.

Once the API has started locally, run

```shell script
```shell
./run.py serve
# or
./run.py start
Expand All @@ -43,10 +43,10 @@ All build/development actions can be listed with `./run.py --verbosity 2 help`.

### Alternative: Docker

In order to run a server that's exactly similar to the production machines,
In order to run a server thats exactly similar to the production machines,
you need to have [Docker](https://www.docker.com/products/developer-tools) installed. Run

```shell script
```shell
./run.py local_docker
```

Expand All @@ -60,7 +60,7 @@ With the `./run.py` command, you can run a browser-sync server, and get the asse
to automatically recompile when changes are made, run `./run.py serve` instead of
`./run.py start`. The server is then available at the URL indicated.

```shell script
```shell
./run.py test
```

Expand All @@ -69,16 +69,18 @@ Runs all the application tests.
You can connect a local version of [money-to-prisoners-common](https://github.com/ministryofjustice/money-to-prisoners-common/)
for development by pre-pending the following task to the run script.

```shell script
```shell
python_dependencies --common-path [path]
```

### Translating

Update translation files with `./run.py make_messages` – you need to do this every time any translatable text is updated.

Requires [transifex cli tool](https://github.com/transifex/cli#installation) for synchronisation:

Pull updates from Transifex with `./run.py translations --pull`.
You'll need to update translation files afterwards and manually check that the merges occurred correctly.
Youll need to update translation files afterwards and manually check that the merges occurred correctly.

Push latest English to Transifex with `./run.py translations --push`.
NB: you should pull updates before pushing to merge correctly.
Expand Down
2 changes: 1 addition & 1 deletion requirements/base.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Dependencies needed for all environments

money-to-prisoners-common~=13.13.0
money-to-prisoners-common~=14.0.0
2 changes: 1 addition & 1 deletion requirements/dev.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Place development and testing dependencies here

money-to-prisoners-common[testing]~=13.13.0
money-to-prisoners-common[testing]~=14.0.0

-r base.txt
4 changes: 2 additions & 2 deletions run.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
import os
import sys

if sys.version_info[0:2] < (3, 8):
raise SystemExit('Python 3.8+ is required')
if sys.version_info[0:2] < (3, 10):
raise SystemExit('Python 3.10+ is required')

root_path = os.path.abspath(os.path.dirname(__file__))

Expand Down