-
Notifications
You must be signed in to change notification settings - Fork 0
/
justfile
80 lines (63 loc) · 2.24 KB
/
justfile
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
72
73
74
75
76
77
78
79
80
default:
@just --list
setup-venv:
python3 -m venv --prompt . .venv
.venv/bin/pip install -U pip setuptools wheel
.venv/bin/python -m pip install -r requirements/requirements.txt
reset-venv:
rm -rf .venv
just setup-venv
bootstrap: setup-venv
source ~/.nvm/nvm.sh
npm install
.venv/bin/python manage.py migrate
.venv/bin/python manage.py createsuperuser
pre-commit install
update-venv:
.venv/bin/pip-compile requirements/requirements.in
.venv/bin/python -m pip install -r requirements/requirements.txt
shell:
.venv/bin/python manage.py shell
# Run all the tests (other than front-end Playwright) as fast as possible
pytest:
pytest -n auto config/tests
playwright:
npx playwright test
# Update all Python packages
update-packages:
.venv/bin/python -m pip install --upgrade pip
.venv/bin/pip-compile --upgrade requirements/requirements.in
.venv/bin/python -m pip install -r requirements/requirements.txt
# Update a single package
update-a-package package:
.venv/bin/pip-compile -P {{ package }} requirements/requirements.in
.venv/bin/python -m pip install -r requirements/requirements.txt
# Update Python and Node stuff
update: update-packages
npm update
npm outdated
build-static-files:
.venv/bin/python manage.py collectstatic --noinput
generate-django-key:
#!./.venv/bin/python
from django.core.management.utils import get_random_secret_key
print(get_random_secret_key())
# Run the coverage report
coverage:
.venv/bin/pytest -n auto --cov=core --cov-report=html
# Open the coverage report in Firefox
coverage-html:
open -a firefox -g `pwd`/htmlcov/index.html
copy-npm-scripts:
cp `pwd`/node_modules/htmx.org/dist/htmx.min.js `pwd`/static/js/vendor/htmx.min.js
cp `pwd`/node_modules/htmx-ext-alpine-morph/alpine-morph.js `pwd`/static/js/vendor/htmx-alpine-morph.min.js
cp `pwd`/node_modules/@alpinejs/sort/dist/cdn.min.js `pwd`/static/js/vendor/alpinejs-sort.min.js
cp `pwd`/node_modules/@alpinejs/morph/dist/cdn.min.js `pwd`/static/js/vendor/alpinejs-morph.min.js
cp `pwd`/node_modules/alpinejs/dist/cdn.min.js `pwd`/static/js/vendor/alpinejs.min.js
dev: copy-npm-scripts
source .venv/bin/activate
npm run dev
# Run Huey for long running tasks
huey:
rm -f huey.*
.venv/bin/python manage.py run_huey