Contributing to parsy

Contributions to parsy, whether code or docs, are very welcome. Please contribute by making a fork, and submitting a PR on GitHub.

We have a high standard in terms of quality. All contributions will need to be fully covered by unit tests and documentation.

To run the test suite:

pip install pytest

To run the test suite on all supported Python versions, and code quality checks, first install the various Python versions, then:

pip install tox

To build the docs, do:

pip install sphinx
cd docs
make html

We now have several linters and code formatters that we require use of, including flake8, isort and black. These are most easily add by using pre-commit:

  • Install pre-commit globally e.g. pipx install pre-commit if you already have pipx.

  • Do pre-commit install in the repo.

Now all the linters will run when you commit changes.

When writing documentation, please keep in mind Daniele Procida’s great article on documentation. To summarise, there are 4 types of docs:

  • Tutorials (focus: learning, analogy: teaching a child to cook)

  • How-to guides (focus: goals, analogy: a recipe in a cook book)

  • Discussions (focus: understanding, analogy: an article on culinary history)

  • Reference (focus: information, analogy: encyclopedia article)

We do not (yet) have documentation that fits into the “Discussions” category, but we do have the others, and when adding new features, documentation of the right sort(s) should be added. With parsy, where code is often very succinct, writing good docs often takes several times longer than writing the code.