Making a release¶
A core developer should use the following steps to create a release X.Y.Z of slicer-package-manager on PyPI.
Prerequisites¶
All CI tests are passing on CircleCI.
You have a GPG signing key.
Documentation conventions¶
The commands reported below should be evaluated in the same terminal session.
Commands to evaluate starts with a dollar sign. For example:
$ echo "Hello"
Hello
means that echo "Hello"
should be copied and evaluated in the terminal.
Setting up environment¶
First, register for an account on PyPI.
If not already the case, ask to be added as a
Package Index Maintainer
.Create a
~/.pypirc
file with your login credentials:[distutils] index-servers = pypi pypitest [pypi] username=__token__ password=<your-token> [pypitest] repository=https://test.pypi.org/legacy/ username=__token__ password=<your-token>
where
<your-token>
correspond to the API token associated with your PyPI account.
PyPI: Step-by-step¶
Make sure that all CI tests are passing on CircleCI.
Download the latest sources
$ cd /tmp && \ git clone git@github.com:girder/slicer_package_manager && \ cd slicer_package_manager
List all tags sorted by version
$ git fetch --tags && \ git tag -l | sort -V
Choose the next release version number
$ release=X.Y.ZWarning
To ensure the packages are uploaded on PyPI, tags must match this regular expression:
^[0-9]+(\.[0-9]+)*(\.post[0-9]+)?$
.
In CHANGES.rst replace
Next Release
section header withX.Y.Z
and commit the changes.
$ git add CHANGES.rst && \ git commit -m "slicer-package-manager ${release}"
Tag the release
$ git tag --sign -m "slicer-package-manager ${release}" ${release} masterWarning
We recommend using a GPG signing key to sign the tag.
Create the source distribution and wheel
$ python setup.py sdist bdist_wheel
Publish the both release tag and the master branch
$ git push origin ${release} && \ git push origin master
Upload the distributions on PyPI
twine upload dist/*
Create a clean testing environment to test the installation
$ pushd $(mktemp -d) && \ mkvirtualenv slicer-package-manager-${release}-install-test && \ pip install slicer-package-manager==${release}Note
If the
mkvirtualenv
command is not available, this means you do not have virtualenvwrapper installed, in that case, you could either install it or directly use virtualenv or venv.To install from TestPyPI, do the following:
$ pip install -i https://test.pypi.org/simple slicer-package-manager==${release}
Cleanup
$ popd && \ deactivate && \ rm -rf dist/* && \ rmvirtualenv slicer-package-manager-${release}-install-test
Add a
Next Release
section back in CHANGES.rst, commit and push local changes.
$ git add CHANGES.rst && \ git commit -m "CHANGES.rst: Add \"Next Release\" section [ci skip]" && \ git push origin master