Skip to content

Performing a Release

Nils Homer edited this page Aug 2, 2024 · 7 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 pybedlite

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.2-dev to 0.0.3:
$ poetry version 0.0.3
  1. build the package with $ poetry build
  2. test run $ poetry publish --dry-run
  3. publish with $ poetry publish -u "__token__" -p <token>
  4. tag the release, and update release notes on github
  5. bump the minor version in the pyproject.toml file, for example to bump from 0.0.2 to 0.0.3-dev:
$ poetry version 0.0.3-dev
Clone this wiki locally