-
Notifications
You must be signed in to change notification settings - Fork 0
/
justfile
74 lines (59 loc) · 2.37 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
# list all available commands
default:
just --list
# clean up all temporary files
clean:
find {{ justfile_directory() }} -type d -name '.venv' -exec rm -rf {} +
find {{ justfile_directory() }} -type d -name '.pytest_cache' -exec rm -rf {} +
find {{ justfile_directory() }} -type d -name '__pycache__' -exec rm -rf {} +
find {{ justfile_directory() }} -type f -name '*.bin' -exec rm -rf {} +
find {{ justfile_directory() }} -type f -name '*.html' -exec rm -rf {} +
find {{ justfile_directory() }} -type f -name '*.csv' -exec rm -rf {} +
find {{ justfile_directory() }} -type d -name '.mypy_cache' -exec rm -rf {} +
find {{ justfile_directory() }} -type d -name '.ruff_cache' -exec rm -rf {} +
find {{ justfile_directory() }} -type d -name '.ipynb_checkpoints' -exec rm -rf {} +
find {{ justfile_directory() }} -type d -name 'htmlcov' -exec rm -rf {} +
# install all required dependencies
configure:
poetry install --sync
# run this if you want to upgrade the dependencies to their latest compatible version from PyPI
upgrade-dependencies:
poetry upgrade --latest
# run this if you want to update the dependencies respecting the constraints from the `pyproject.toml`
update-dependencies:
poetry lock
# run this if you want to re-lock the dependencies
lock-dependencies:
poetry lock --no-update
apis_repository := "git@github.com:volur-ai/apis.git"
apis_repository_dir := `mktemp -d`
# generate code from APIs declarations
generate:
git clone {{ apis_repository }} {{ apis_repository_dir }}
cd {{ apis_repository_dir }} && buf generate --include-imports --include-wkt
rm -rf gen
cp -r {{ apis_repository_dir }}/gen/python gen
# fix auto-fixable issues
fix: configure
poetry run ruff format src tests scripts && \
poetry run ruff check --fix --unsafe-fixes src tests scripts
# validate code and configuration
validate: configure
poetry check --lock && \
poetry run ruff format --check src tests scripts *.ipynb && \
poetry run ruff check src tests scripts *.ipynb && \
poetry run mypy src tests scripts
test_args := ""
# run tests
test:
poetry run pytest tests {{ test_args }}
configure-docs:
poetry install --only docs --sync
# build documentation
build-docs:
poetry run mkdocs build --strict
# serve documentation
serve-docs:
poetry run mkdocs serve
# run CI locally
ci: validate test build-docs