This projet uses Hach to manage the development environment.
➢ To install the development environment, run:
hatch env create
See hatch env create documentation
This command will create a virtual environment and install the development dependencies.
NOTE:
hatch
creates a virtual environment in the~/.local/share/hatch/env/virtual/antares-study-version
directory.
➢ To activate the virtual environment, run:
hatch shell
See hatch shell documentation
This command will spawn a new shell with the virtual environment activated. Use Ctrl+D to exit the shell.
NOTE: this command will display the full path to the virtual environment. You can use it to configure PyCharm or Visual Studio Code to use this virtual environment.
➢ To format and lint the source code with ruff, run:
hatch fmt
See hatch fmt documentation
➢ To run the tests on the current Python version, run:
hatch run test
See hatch run documentation
➢ To run the tests on Python 3.12, for example, run:
hatch run all.py3.12:test
➢ To generate the test coverage report, run:
hatch run cov
This command will run the unit tests and generate a coverage report in the htmlcov
directory.
➢ To check the typing with mypy, run:
hatch run types:check
➢ To check the typing on unit tests, run:
hatch run types:check-tests
➢ To prepare the documentation environment, run:
hatch env create docs
➢ To generate the documentation with mkdocs, run:
hatch run docs:build
This command will generate the documentation in the site
directory.
➢ To serve the documentation locally, run:
hatch run docs:serve
This command will start a local web server to serve the documentation at http://127.0.0.1:8000/.
➢ To build the package, run:
hatch build
This command will create a dist
directory with the built package.
➢ To build the package and upload it to PyPI, run:
hatch publish
➢ To clean the project, run:
hatch clean
This command will remove the dist
directory.