@@ -7,33 +7,63 @@ set quiet
77default :
88 just --list --unsorted
99
10+ # --------------------------------------------------
11+ # Developer Setup
12+
1013# Synchronize the environment by installing all the dependencies
1114dev-sync :
1215 uv sync --cache-dir .uv_cache --all-extras
1316
17+ # Synchronize the environment by installing the specified extra dependency
18+ # Currently used within the CI to install extra dependencies and test them.
1419dev-sync-extra extra :
1520 uv sync --cache-dir .uv_cache --extra {{ extra}}
1621
1722# Synchronize the environment by installing all the dependencies except the dev ones
1823prod-sync :
19- uv sync --cache-dir .uv_cache --all-extras --no-dev
24+ uv sync --cache-dir .uv_cache --all-extras --no-default-groups
25+
26+ # Synchronize the environment by installing the extra dependency
27+ # specified. Doesn't install the dev dependencies.
28+ prod-sync-extra extra :
29+ uv sync --cache-dir .uv_cache --extra {{ extra}} --no-default-groups
2030
2131# Install the pre-commit hooks
2232install-hooks :
2333 uv run pre-commit install
2434
35+ # --------------------------------------------------
36+ # Validation
37+
2538# Run ruff formatting
2639format :
2740 uv run ruff format
2841
2942# Run ruff linting and mypy type checking
3043lint :
3144 uv run ruff check --fix
32- uv run mypy --ignore-missing-imports --install-types --non-interactive --package ml3_drift
45+ uv run mypy --ignore-missing-imports --install-types --non-interactive --package ml3_drift --python-version 3.10
46+
47+
48+ # Default value for testWorkers is auto (meaning all workers available)
49+ # If you want to pass a custom value (such as 4): `just testWorkers=4 test`
50+ # We also run ruff on tests files (it's so fast that it's worth it)
51+
52+ # Little caveat: when running tests with only an extra installed, you'd like
53+ # to avoid having docs dependencies installed (since, for instance, a mkdocs plugin
54+ # requires Pandas, which is one of our extra dependencies). This happens by default
55+ # since docs dependencies are not installed as default dependencies by uv (see pyproject.toml).
56+ # They are only installed when building / serving the documentation. However, if you first
57+ # build the documentation, then run the tests, you will have the docs dependencies installed.
58+ # Should not be a practical problem (especially since in CI environments we don't install docs dependencies),
59+ # but it's worth noting.
3360
3461# Run the tests with pytest
62+ testWorkers := " auto"
3563test :
36- uv run pytest --verbose --color=yes -n auto --exitfirst tests
64+ uv run ruff format tests
65+ uv run ruff check tests --fix
66+ uv run pytest --verbose --color=yes -n {{ testWorkers}} --exitfirst tests
3767
3868# Run linters, formatters and tests
3969validate : format lint test
@@ -43,11 +73,12 @@ validate: format lint test
4373
4474# Generate the documentation
4575build-docs :
46- uv run mkdocs build
76+ # Make sure mkdocs is installed
77+ uv run --group docs mkdocs build
4778
4879# Serve the documentation locally
4980serve-docs :
50- uv run mkdocs serve
81+ uv run --group docs mkdocs serve
5182
5283# --------------------------------------------------
5384# Publishing
0 commit comments