- Install
uvand follow steps from doc (Doc) - Install a specific version of Python with
uv python install 3.11 - Install
toxwithuv tool install tox --with tox-uv - Clone repository
git clone https://github.com/AntaresSimulatorTeam/antares_data_collection.git - Put in the root directory and install dependencies (prod+dev)
uv sync --locked --all-extras --dev
uv run pip install -e .
If you have issue with pip :
which pip- add pip in your .venv in your project
python -m ensurepip --upgrade- then upgrade :
python -m pip install --upgrade pip setuptools build
- then upgrade :
Install all dependencies (prod + dev):
uv sync
Install strictly from the lockfile:
uv sync --locked
Install without dev dependencies:
uv sync --no-dev
Install everything (all extras + dev):
uv sync --all-extras --dev
Add a production dependency:
uv add <package>
Add a development dependency:
uv add --dev <package>
Add a specific version:
uv add <package>==<version>
uv remove <package>
Regenerate the lockfile:
uv lock
The configuration is specified in file tox.ini. But you can also call specific part of tests and
also for a specific Python version.
To simply launch all your tests :
- use
toxin bach
Use ruff to check and format your code :
tox -e lint- these tests execute an internal script to check/put an header on scripts/tests
Use mypy to check Typechecking :
tox -e type
use coverage to check code coverage :
tox -e coverage
By default pytest is run here wit tox.
You just have to provide a version of tox environment like :
tox -e py3.11
You can mix command to run specific tests with specific env like :
tox -e lint,type,py3.11
or like :
tox -e lint,type,coverage,py3.11,py3.12
To reformat your code, use this command line: uv ruff check src/ tests/ --fix && ruff format src/ tests/
To typecheck your code, use this command line: uv run mypy src/