-
Notifications
You must be signed in to change notification settings - Fork 0
/
justfile
30 lines (23 loc) · 934 Bytes
/
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
default:
just --list
setup:
poetry install
poetry run pre-commit install
poetry run pre-commit run --all-files
tidy path=".":
poetry run isort {{ path }}
poetry run ruff format {{ path }}
just --fmt --unstable
check:
poetry run ruff check
test path="./src/tests" n_workers="8":
#!/bin/bash
trap 'echo; docker stop randorm-api-tests-mongo' EXIT # remove container on exit
docker run -d -p 27017:27017 --rm --name randorm-api-tests-mongo mongodb/mongodb-community-server:latest
poetry run pytest {{ path }} -n {{ n_workers }} --cov=./ --cov-report=html --cov-report=term-missing
run-server n_workers="1":
poetry run gunicorn main:app --bind localhost:8080 --workers {{ n_workers }} --worker-class aiohttp.GunicornWebWorker
docker-build:
docker buildx build . -t randorm-api:latest
docker-run:
docker run -p 8080:8080 --name randorm-api --rm --detach randorm-api:latest