1
1
@_ default :
2
2
just --list --unsorted
3
3
4
- run-all : install-deps format-python check-python run-tests
4
+ run-all : install-deps format-python check-python run-tests check-commits build-website
5
+
6
+ # Install Python package dependencies
7
+ install-deps :
8
+ poetry install
5
9
6
10
# Generate SVG images from all PlantUML files
7
11
generate-puml-all :
@@ -11,59 +15,33 @@ generate-puml-all:
11
15
generate-puml name :
12
16
docker run --rm -v $(pwd):/ puml -w / puml ghcr.io/ plantuml/ plantuml:latest -tsvg " **/{{ name}} .puml"
13
17
14
- # Start up the docker container
15
- start-docker :
16
- docker compose up -d
17
-
18
- # Close the docker container
19
- stop-docker :
20
- docker compose down
21
-
22
- # Update the Django migration files
23
- update-migrations : install-deps
24
- yes | poetry run python manage.py makemigrations
25
- poetry run python manage.py migrate
26
-
27
- # Run Django tests
28
- run-tests : install-deps update-migrations
18
+ # Run Python tests
19
+ run-tests :
29
20
poetry run pytest
30
21
31
22
# Check Python code with the linter for any errors that need manual attention
32
- check-python : install-deps
23
+ check-python :
33
24
poetry run ruff check .
34
25
35
26
# Reformat Python code to match coding style and general structure
36
- format-python : install-deps
27
+ format-python :
37
28
poetry run ruff check --fix .
38
29
poetry run ruff format .
39
30
40
- # Builds and starts a development web server for the Django app (at http://localhost:8000)
41
- start-app : install-deps update-migrations
42
- poetry run python ./ manage.py runserver
43
-
44
- # Install Python package dependencies
45
- install-deps :
46
- poetry install
47
-
48
- # Add test data when running locally based on json files found in `fixtures/`
49
- add-test-data : install-deps update-migrations
50
- poetry run python manage.py loaddata */ */ fixtures/ *.json
51
-
52
- # Reset local Sprout (remove __pycache__ folders, db, migrations, and persistent storage raw files)
31
+ # Reset local Sprout (remove __pycache__ folders, generated build files, etc)
53
32
reset-local :
54
33
find . -type d -name " __pycache__" -exec rm -rf {} +
55
- find */ **/ migrations -type f ! -name ' __init__.py' -exec rm {} \;
56
- rm db.sqlite3
57
- rm persistent_storage/ raw/ *.csv
34
+ rm -rf .storage
58
35
59
36
# Build the documentation website using Quarto
60
- build-website : install-deps
37
+ build-website :
61
38
# To let Quarto know where python is.
62
39
export QUARTO_PYTHON=.venv/ bin/ python3
63
40
poetry run quartodoc build
64
41
poetry run quarto render --execute
65
42
66
- check-commit :
43
+ # Run checks on commits with non-main branches
44
+ check-commits :
67
45
#!/ bin/ zsh
68
46
if [[ $(git rev-parse --abbrev-ref HEAD) != " main" ]]
69
47
then
0 commit comments