Contributing
Koordinates welcomes bug reports and contributions by the community to this module. This process is intended to be as easy as possible for both contributors and the Koordinates development team.
Testing
The client includes a suite of unit and functional tests. These should be used to verify that your changes don’t break existing functionality, and that compatibility is maintained across supported Python versions. Tests run automatically on Buildkite for branch commits and pull requests.
To run the tests you need to:
$ pip install -r requirements-test.txt
$ tox
Patches
All patches should be sent as a pull request on GitHub, including tests and documentation where needed. If you’re fixing a bug or making a large change the patch must include test coverage before it will be merged.
If you’re uncertain about how to write tests, take a look at some existing tests that are similar to the code you’re changing.
Release Process
This guide describes the process to release a new version of the library. In this example, v0.0.0
. The library follows the Semantic Versioning guidelines, so select major, minor, and patch version numbers appropriately.
Preparations
Close or update all tickets for the next milestone on Github..
Update the minimum required versions of dependencies in
pyproject.toml
. Update the exact version of all entries inrequirements.txt
.Run tox from the project root. All tests for all supported Python versions must pass:
$ tox [...] ________ summary ________ py37: commands succeeded ... congratulations :)
Note
Tox will use the
requirements-test.txt
to setup the virtualenvs, so make sure you’ve updated it.Build the Sphinx docs. Make sure there are no errors and undefined references.
$ make clean docs
Note
You will need to install dev dependencies in
requirements-dev.txt
to build documentation.Check the Buildkite build is passing.
Update the version number in
koordinates/__init__.py
and commit:$ git commit -m 'Version 0.0.0 release' koordinates/__init__.py
Warning
Don’t tag and push the changes yet so that you can safely rollback if you need change something!
Create a draft release in Github with a list of changes, acknowledgements, etc.
Build and release
Test the release process. Build a source distribution and test it:
$ python3 -m build $ ls dist/ koordinates-0.7.0-py3-none-any.whl koordinates-0.7.0.tar.gz
Try installing them:
$ rm -rf /tmp/koordinates-sdist # ensure clean state $ virtualenv /tmp/koordinates-sdist $ source /tmp/koordinates-sdist/bin/activate $ /tmp/koordinates-sdist/bin/pip install dist/koordinates-0.7.0.tar.gz $ /tmp/koordinates-sdist/bin/python >>> import koordinates
Create or check your accounts for the test server <https://testpypi.python.org/pypi> and PyPI. Update your
~/.pypirc
with your credentials:[distutils] index-servers = pypi test [test] repository = https://test.pypi.org/legacy/ username = __apitoken__ password = <apikey> [pypi] username = __apitoken__ password = <apikey>
Upload the distributions for the new version to the test server and test the installation again:
$ twine upload -r test dist/* $ rm -rf /tmp/koordinates-sdist # ensure clean state $ virtualenv /tmp/koordinates-sdist $ source /tmp/koordinates-sdist/bin/activate $ /tmp/koordinates-sdist/bin/pip install -i https://testpypi.python.org/pypi --extra-index-url https://pypi.python.org/pypi koordinates
Check if the package is displayed correctly: https://testpypi.python.org/pypi/koordinates
Upload the package to PyPI and test its installation one last time:
$ twine upload -r pypi dist/* $ rm -rf /tmp/koordinates-sdist # ensure clean state $ virtualenv /tmp/koordinates-sdist $ source /tmp/koordinates-sdist/bin/activate $ pip install -U koordinates
Check the package is displayed correctly: https://pypi.python.org/pypi/koordinates
Post release
Push your changes:
$ git tag -a v0.0.0 -m "Version 0.0.0" $ git push origin v0.0.0
Activate the documentation build for the new version.
Make the Github release public.
Update related Help pages if necessary.