Repository navigation
Expand file tree
/
Copy pathmise.toml
More file actions
71 lines (59 loc) · 2.16 KB
/
Copy pathmise.toml
File metadata and controls
71 lines (59 loc) · 2.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
[tools]
python = "3.12"
node = "24"
actionlint = "1.7.12"
[env]
_.python.venv = { path = ".venv", create = true }
# matches docker-compose.dev.yml
DB_HOST = "localhost"
DB_USER = "spongeauth"
DB_PASSWORD = "spongeauth"
[tasks.install]
description = "Install Python and Node dependencies"
run = [
"pip install --upgrade pip",
"pip install -r requirements/test.txt",
"npm ci",
]
[tasks.assets]
description = "Build static assets into spongeauth/static-build"
run = "npx gulp build"
[tasks."assets:watch"]
description = "Rebuild static assets on change"
run = "npx gulp watch"
[tasks.db]
description = "Start the local Postgres container"
run = "docker compose -f docker-compose.dev.yml up -d"
[tasks.migrate]
description = "Apply migrations against the local database"
env = { DJANGO_SETTINGS_MODULE = "spongeauth.settings.dev" }
run = "python spongeauth/manage.py migrate"
[tasks.dev]
description = "Run the Django dev server on :8000"
depends = ["migrate"]
env = { DJANGO_SETTINGS_MODULE = "spongeauth.settings.dev" }
run = "python spongeauth/manage.py runserver"
[tasks.test]
description = "Run the test suite (needs `mise run db`)"
dir = "spongeauth"
env = { PYTHONPATH = ".", DJANGO_SETTINGS_SKIP_LOCAL = "True", LANG = "C" }
run = "pytest --cov-config=../.coveragerc --cov=. {{arg(name='pytest_args', var=true, default='')}}"
[tasks."test:docker"]
description = "Run the test suite in Linux like CI, e.g. when macOS image output differs (needs `mise run db`)"
run = """
docker run --rm -t \
-v "$PWD:/src" -v spongeauth-pip-cache:/root/.cache/pip -w /src/spongeauth \
-e DB_HOST=host.docker.internal -e DB_USER -e DB_PASSWORD \
-e PYTHONPATH=. -e PYTHONDONTWRITEBYTECODE=1 -e DJANGO_SETTINGS_SKIP_LOCAL=True -e LANG=C \
python:3.12 sh -c \
'pip install -q --root-user-action=ignore --disable-pip-version-check --src /tmp/src -r ../requirements/test.txt && pytest -p no:cacheprovider "$@"' --
"""
[tasks.lint]
description = "Run prospector"
run = ["prospector --die-on-tool-error", "actionlint"]
[tasks.fmt]
description = "Format with black"
run = "black spongeauth"
[tasks."docker:build"]
description = "Build the production image locally"
run = "docker build -t spongeauth:local ."