1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73
|
==============
Contributing
==============
.. This file based on https://github.com/PyGithub/PyGithub/blob/master/CONTRIBUTING.md
``dict2css`` uses `tox <https://tox.readthedocs.io>`_ to automate testing and packaging,
and `pre-commit <https://pre-commit.com>`_ to maintain code quality.
Install ``pre-commit`` with ``pip`` and install the git hook:
.. code-block:: bash
$ python -m pip install pre-commit
$ pre-commit install
Coding style
--------------
`formate <https://formate.readthedocs.io>`_ is used for code formatting.
It can be run manually via ``pre-commit``:
.. code-block:: bash
$ pre-commit run formate -a
Or, to run the complete autoformatting suite:
.. code-block:: bash
$ pre-commit run -a
Automated tests
-------------------
Tests are run with ``tox`` and ``pytest``.
To run tests for a specific Python version, such as Python 3.6:
.. code-block:: bash
$ tox -e py36
To run tests for all Python versions, simply run:
.. code-block:: bash
$ tox
Type Annotations
-------------------
Type annotations are checked using ``mypy``. Run ``mypy`` using ``tox``:
.. code-block:: bash
$ tox -e mypy
Build documentation locally
------------------------------
The documentation is powered by Sphinx. A local copy of the documentation can be built with ``tox``:
.. code-block:: bash
$ tox -e docs
|