Skip to content

How to cut a new release

Eric Ma edited this page Aug 22, 2020 · 26 revisions

Notes for myself.

Pre-Setup: Make a .pypirc file.

Shamelessly copied over from https://truveris.github.io/articles/configuring-pypirc/

Make a .pypirc file:

touch ~/.pypirc

Now edit the file:

nano ~/.pypirc

Paste in the following block

[distutils]
index-servers=
    pypi
    testpypi

[pypi]
username: brodan
password: xxxxxxxxxxxxxxxx

[testpypi]
repository: https://test.pypi.org/legacy/
username: brodan
password: yyyyyyyyyyyyyyyy

Make sure that all tests are passing on dev

If there's anything not passing, it must be fixed before a release can be cut.

Modify the CHANGELOG appropriately

Move everything "on deck" under a new header for the release.

Dry run bumpversion with the appropriate version bump

bumpversion --dry-run <PUT ONE OF: major, minor, patch> --allow-dirty --verbose

Inspect the output to make sure the changes that will happen are all correct.

Commit any final changes

git add .
git commit -m "PUT YOUR COMMIT MESSAGE HERE"

Actually run bumpversion with the appropriate version bump

bumpversion <PUT ONE OF: major, minor, patch> --verbose

bumpversion is configured to automatically commit changes. If the pre-commit hooks error out, fix whatever needs fixing and re-commit the changes.

Depending on whether tagging happened or not, you might need to tag the current commit after committing.

git tag -a v<NEW VERSION HERE>

Push changes with tags

git push --tags

Cut release to PyPI

This should, in most cases, suffice:

make release

If it doesn't, open up the Makefile and execute each command in order.

Now merge the release into master

master branch is where we keep an "archival" of all releases. Intent is sort of like a backup to the tags.

git checkout master
git merge dev
git push --tags
Clone this wiki locally