Skip to main content

Parsons PyPi Release Instructions

Published onJul 13, 2022
Parsons PyPi Release Instructions

Note: these instructions assume you are making a minor release (that is, one with no breaking changes). If you are making a major release you’ll need to first follow these steps (if not, skip them):

  • merge all past changes from major-release into main, using rebase

  • submit a PR to add all changes from the (now up-to-date) major-release branch into main

  • once that PR is merged, move on to the next steps immediately (do not merge any new PRs before finishing the process)

First Phase - anybody can do these!

  1. Update with the current release number on a new branch/fork

  2. Open a pull request from that branch into main

Second Phase - Write Access needed

  1. Review and merge the aforementioned pull request

  2. Create a new release in GitHub. You can find the Draft a New Release button here, along with previous releases you can use as a template. Make sure to credit all contributors and give a special welcome to those who made their first PR in this release. Also make sure no PRs labeled ‘breaking change’ are included if you’re doing a minor release.

  3. Make a new virtualenv by running python -m venv parsons-release, and then activate that environment by running source parsons-release/bin/activate

  4. Checkout release in git within that new environment. For example, if you just made release v1.1, you’d use the command git checkout v1.1. This may give you an error since the tag was made on Github and you might not have it locally. To get tags from Github, try: git fetch origin --tags . Then re-run the command to checkout the latest tagged release.

  5. In the top-level folder of the checked-out repository, run python check

  6. Run python -m pip install --upgrade setuptools wheel twine in the virtualenv to get the necessary tools to build the Python package from the repository’s source files

  7. Build distribution files with pip wheel --no-deps -w dist .

  8. Test installation of the built files with pip install dist/parsons[...].whl, where the exact filename for the new version’s wheel is listed near the top of the output for the previous command

  9. Run tests with pytest -rf test/*

  10. From outside the parsons repo, run python -c 'from parsons import Table'

  11. Let a repo maintainer (Shauna, Sharine, Kasia, Ian, etc) know that the release is ready to publish on PyPI and they’ll take it from there!

Third Phase - TMC Staff Access needed

  1. First, upload the latest version of Parsons to the test PyPI site, using Twine: twine upload -r testpypi dist/*

    It will prompt you for your credentials, which only maintainers have. NOTE: you may need to manually delete past distributions so you’re only uploaded the most recent release.

  2. Check that everything looks right, then upload to the real PyPI site, again using Twine: twine upload dist/*

Check that everything looks right, and you’re done! Don’t forget to post about the new release in #general on Slack, and tag all the contributors. :)

No comments here
Why not start the discussion?