| 1 |
.. highlight:: console |
| 2 |
|
| 3 |
Development |
| 4 |
=========== |
| 5 |
|
| 6 |
``rstcheck-core`` uses `Semantic Versioning`_. |
| 7 |
|
| 8 |
``rstcheck-core`` uses ``main`` as its single development branch. Therefore releases are |
| 9 |
made from this branch. Only the current release is supported and bugfixes are released |
| 10 |
with a patch release for the current minor release. |
| 11 |
|
| 12 |
|
| 13 |
Tooling |
| 14 |
------- |
| 15 |
|
| 16 |
For development the following tools are used: |
| 17 |
|
| 18 |
- ``setuptools`` for package metadata and building. |
| 19 |
- ``twine`` for publishing. |
| 20 |
- ``tox`` for automated and isolated testing. |
| 21 |
- ``pre-commit`` for automated QA checks via different linters and formatters. |
| 22 |
|
| 23 |
|
| 24 |
Set up Local Development Environment |
| 25 |
------------------------------------ |
| 26 |
|
| 27 |
Simply create a virtualenv and run ``pip install -e .[dev]``. This will install |
| 28 |
``rstcheck-core`` along its main and development dependencies. |
| 29 |
|
| 30 |
|
| 31 |
Working with the Local Development Environment |
| 32 |
---------------------------------------------- |
| 33 |
|
| 34 |
Dependency management |
| 35 |
~~~~~~~~~~~~~~~~~~~~~ |
| 36 |
|
| 37 |
Dependencies are listed in ``pyproject.toml`` and are manually managed. |
| 38 |
|
| 39 |
|
| 40 |
Testing with tox |
| 41 |
~~~~~~~~~~~~~~~~ |
| 42 |
|
| 43 |
To run all available tests and check simply run:: |
| 44 |
|
| 45 |
$ tox |
| 46 |
|
| 47 |
This will run: |
| 48 |
|
| 49 |
- formatters and linters via ``pre-commit``. |
| 50 |
- the full test suite with ``pytest``. |
| 51 |
- a test coverage report. |
| 52 |
- tests for the documentation. |
| 53 |
|
| 54 |
Different environment lists are available and can be selected with ``tox -m <ENVLIST>``: |
| 55 |
|
| 56 |
- test: run full test suite with ``pytest`` and report coverage. |
| 57 |
- py`X`.`Y` run full test suite with specific python version and report coverage. |
| 58 |
- docs: run all documentation tests. |
| 59 |
|
| 60 |
|
| 61 |
Linting and formatting pre-commit |
| 62 |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 63 |
|
| 64 |
can be used directly from within the development environment or you can use |
| 65 |
``tox`` to run it pre-configured. |
| 66 |
|
| 67 |
There are 3 available ``tox`` envs with all use the same virtualenv: |
| 68 |
|
| 69 |
- ``pre-commit``: |
| 70 |
For running any ``pre-commit`` command like ``tox -e pre-commit -- autoupdate --freeze``. |
| 71 |
- ``pre-commit-run``: |
| 72 |
For running all hooks against the code base. |
| 73 |
A single hook's id can be passed as argument to run this hook only like |
| 74 |
``tox -e pre-commit-run -- black``. |
| 75 |
|
| 76 |
|
| 77 |
.. highlight:: default |
| 78 |
|
| 79 |
|
| 80 |
.. _Semantic Versioning: https://semver.org/ |