Contributing to pytd

Code Formatting and Testing

We use black and isort as a formatter, and flake8 as a linter. Our CI checks format with them.

Note that black requires Python 3.6+ while pytd supports 3.5+, so you must need to have Python 3.6+ for development.

We highly recommend you to introduce pre-commit to ensure your commit follows required format.

You can install pre-commit as follows:

pip install pre-commit
pre-commit install

Now, black, isort, and flake8 will check each time you commit changes. You can skip these check with git commit --no-verify.

If you want to check code format manually, you can install them as follows:

pip install black isort flake8

Then, you can run those tool manually;

black pytd
flake8 pytd

You can run formatter, linter, and test by using nox as the following:

pip install nox # You should install at the first time


pip install .[doc]

Edit contents in doc/:

cd doc

Build HTML files to render Sphinx documentation:

make html

The doc/ folder is monitored and automatically published by Read the Docs.


Update version in setup.cfg. Set it to 1.0.0, for example:

name = pytd
version = 1.0.0

Commit and push the latest code, and tag the version:

git tag 1.0.0
git push --tags

GitHub Actions Workflow then automatically releases the tagged version on PyPI. A tag and version number must be identical and following the semantic versioning convention.