Skip to content

Performing a Release

Nils Homer edited this page Jul 13, 2024 · 12 revisions

Pre-requisites

  1. Ensure you have an account on both PyPi and test PyPi
  2. Ensure you have created a token for both PyPi and test PyPi
  3. Ensure you are using your Rosetta or intel-enabled terminal if using an M-class Mac
  4. Use __token__ for the username in the below commands and your token for the password

Publishing to test.pypi

  1. Configure the repository $ poetry config repositories.testpypi https://test.pypi.org/legacy/
  2. Build the package with $ poetry build
  3. Test run $ poetry publish -r testpypi -u "__token__" -p <token> --dry-run
  4. publish with $ poetry publish -r testpypi -u "__token__" -p <token>
  5. test install with $ pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple fgpyo

Publishing to PyPi

  1. make sure you're on the main branch
  2. remove the -dev suffix in the version in the pyproject.toml file, for example to bump from 0.0.4-dev to 0.0.4:
$ poetry version 0.0.4
  1. commit and tag the release, push to github
  2. build the package with $ poetry build
  3. test run $ poetry publish --dry-run
  4. publish with $ poetry publish -u "__token__" -p <token>
  5. update release notes on github
  6. bump the minor version in the pyproject.toml file, for example to bump from 0.0.4 to 0.0.5-dev:
$ poetry version 0.0.5-dev
  1. commit and push to github
Clone this wiki locally