Developer Documentation
Installing Development Dependencies
Poetry installs dev dependencies by default from the poetry.lock
or pyproject.toml
files. Just run
poetry install
Testing
Testing is run with pytest
and the order is randomized by pytest-randomly
.
To run all tests, run
pytest tests
To run all tests in docker containers (tests against many versions of python), run
docker-compose up --build && docker-compose down
Release Process
Reference: https://www.atlassian.com/git/tutorials/comparing-workflows/gitflow-workflow
Create a release candidate branch named according to the version to be released. This branch is used to polish the release while work continues on dev (towards the next release). The naming convention is
release/X.Y.Z
Bump the version of the package to the version you are about to release, either manually by editing
pyproject.toml
or by runningpoetry version X.Y.Z
or bumping according to a valid bump rule likepoetry version minor
(see poetry docs: https://python-poetry.org/docs/cli/#version).Update the version identifier in
CITATION.cff
.Update
changelog.md
to reflect that the version is now “released” and revisitREADME.md
to keep it up to date.Open a PR to merge the release branch into master. This informs the rest of the team how the release process is progressing as you polish the release branch.
When you are satisfied that the release branch is ready, merge the PR into
master
.Check out the
master
branch, pull the merged changes, and tag the newly created merge commit with the desired versionX.Y.Z
and push the tag upstream.git tag -a X.Y.Z -m "version release X.Y.Z" git push origin X.Y.Z
Ensure that you have
master
checked out and build the package (see below). Check that the version of the built artifacts is as you expect (should match the version git tag and the output frompoetry version --short
).Optionally distribute the artifacts to PyPI/Nexus if desired (see below).
Open a PR to merge
master
back intodev
so that any changes made during the release process are also captured indev
.
Building and Distribution
Ensure that
poetry
is installed by runningpoetry --version
.To build the distribution archives, run
poetry build
.To upload the wheel to Nexus, run
poetry publish
. You will need credentials to sign into PyPI.