Skip to content

Instantly share code, notes, and snippets.

@dkirkby
Last active January 24, 2022 20:05
Show Gist options
  • Save dkirkby/01b8e3f6786824301d0f94663117e75d to your computer and use it in GitHub Desktop.
Save dkirkby/01b8e3f6786824301d0f94663117e75d to your computer and use it in GitHub Desktop.
  • Update version in setup.cfg, usually by remove .dev
  • Check that CHANGES.rst describes all changes since the last version
  • Replace unreleased with today's YYYY-MM-DD in CHANGES.rst
  • Commit and tag
git add .
git commit -m 'prepare for release'
git tag v0.15
  • Bump version in setup.cfg and append .dev
  • Add new section in CHANGES.rst e.g.
0.16 (unreleased)
-----------------

- No changes yet
  • Commit dev version: and checkout tag as detached head:
git add .
git commit -m 'back to work'
  • Checkout tag as detached head and upload to pypi:
git checkout v0.15
python setup.py sdist
twine upload dist/*
  • Finally, push the changes and go back to the main branch:
git checkout master
git push --tags
git push

If you are doing this for the first time, you might need to conda install twine and save credentials in .pypirc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment