Developing¶
Prerequisites¶
Python 3.8+
Usage¶
Install the lpcraft
project in editable mode inside a virtualenv environment named venv
.
$ tox --devenv venv $ venv/bin/lpcraft --help # Alternatively, you can activate the virtualenv environment.
List the tox
environments available for this project.
$ tox -lv default environments: lint -> run linters mypy -> run static type checker py38 -> run test suite py39 -> run test suite py310 -> run test suite py311 -> run test suite coverage -> generate coverage report
Run the project’s tests.
$ tox -e py38 # You can replace ``py38`` with another Python version.
Since tox
uses pytest under the hood to run
the tests, arguments can be passed to pytest
.
$ tox -e py38 -- lpcraft/commands/tests/test_run.py $ tox -e py38 -- -k test_missing_config_file $ tox -e py39 -- --lf
Run the tests with coverage.
$ tox -e coverage
Run the linters.
$ tox -e lint
We also support running linters via pre-commit.
If you want pre-commit
to run automatically on git commit
,
you need to run pre-commit install
once.
Run the mypy
static type checker.
$ tox -e mypy
Update the requirements and regenerate requirements.txt
.
$ <modify requirements.in> $ tox -e pip-compile
Build the documentation locally.
$ tox -e docs
Note
In order to update the project’s documentation online, after having pushed your changes to the repository, you need to trigger a manual build on the project’s dashboard on https://readthedocs.org.