-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjustfile
More file actions
78 lines (63 loc) · 1.54 KB
/
Copy pathjustfile
File metadata and controls
78 lines (63 loc) · 1.54 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
72
73
74
75
76
77
78
set dotenv-load
PORT := env("PORT", "7860")
ARGS_TEST := env("_UV_RUN_ARGS_TEST", "")
ARGS_SERVE := env("_UV_RUN_ARGS_SERVE", "")
# Variables
IMAGE_NAME := "credit-scoring-api"
# Default target: show all commands
@_:
just --list
# try app locally
[group('docker-tools')]
demo:
docker build --network=host -t {{IMAGE_NAME}} .
docker run -it --rm -p {{PORT}}:{{PORT}} {{IMAGE_NAME}}
# Developp app locally
[group('run')]
start-api:
uv run uvicorn app.main:app --host 0.0.0.0 --port 7860
# Run tests
[group('qa')]
test *args:
uv run {{ ARGS_TEST }} -m pytest {{ args }}
_cov *args:
uv run -m coverage {{ args }}
# Run tests and measure coverage
[group('qa')]
@cov:
just _cov erase
just _cov run -m pytest tests
# Ensure ASGI entrypoint is importable.
# You can also use coverage to run your CLI entrypoints.
just _cov run -m app.asgi
just _cov combine
just _cov report
just _cov html
# Run linters
[group('qa')]
lint:
uvx ruff check
uvx ruff format
# Check types
[group('qa')]
typing:
uvx basedpyright app
# Perform all checks
[group('qa')]
check-all: lint cov typing
# Update dependencies
[group('lifecycle')]
update:
uv sync --upgrade
# Ensure project virtualenv is up to date
[group('lifecycle')]
install:
uv sync
# Remove temporary files
[group('lifecycle')]
clean:
rm -rf .venv .pytest_cache .mypy_cache .ruff_cache .coverage htmlcov
find . -type d -name "__pycache__" -exec rm -r {} +
# Recreate project virtualenv from nothing
[group('lifecycle')]
fresh: clean install