This document is aimed toward established contributors the project.
Going further, we assume you have write-access to both the repository and the PyPI project page.
Note
It is useful to publish a beta version of the package before the actual one.
To release a new minor version of dirty_cat
(e.g. 0.1.0 -> 0.2.0), here are
the main steps and appropriate resources:
- Update
dirty_cat/CHANGES.rst
. It should be updated at each PR, but double-checking before the release is good practice. - Create a branch by running
git checkout -b 0.<version>.X
(e.g.0.2.X
). - Update
dirty_cat/dirty_cat/VERSION.txt
with the new version number (e.g.0.2.0
). - Update
dirty_cat/setup.py
(e.g. Python version supported and dependencies). - Commit the changes with a new tag: the version you're going to push,
with the commands
git commit -m "Bump to version 0.2.0"
. Push the branch to thedirty_cat
repository. The CI will automatically create an associated folder in the documentation repo. - In the documentation repository (e.g.
https://github.com/dirty-cat/dirty-cat.github.io
), update thestable
symlink to the latest stable version: first, unlinkstable
(i.e.unlink stable
); then, create a new symlink (i.e.ln -s 0.2 stable
); finally, commit and push the changes into the repository. - Create a new release and tag via GitHub:
https://github.com/dirty-cat/dirty_cat/releases/new
. Provide the tag using the current version, e.g.0.2.0
and make sure to select the target branch created earlier (e.g.0.2.X
). - Next, you will need to install the
twine
andsetuptools
packages withpip install --upgrade twine setuptools
. - Build the source with
python setup.py bdist_wheel sdist
- Check if today is a good day for releasing
- It is advised to first push the version on the test package index
test.pypi.org
before the official package indexpypi.org
. You can do this with the commandtwine upload dist/* --repository-url https://test.pypi.org/legacy/
This is useful to test if the build done by twine and the push to the package indexer is working. - Install the new release from the test package index on a dedicated
environment with the command
pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://test.pypi.org/simple/ dirty_cat
. If there are other package install errors, it probably means those packages are not on test.pypi.org. Download them from pypi.org directly with justpip install
. - Finally, if that works fine, you can push to the official package
index with
twine upload dist/*
- It is also good practice at this point to create a new environment
and try installing and using the library (for example by launching examples).
Be sure to install it with the command
pip install dirty_cat==<version>
(e.g.pip install dirty_cat==0.2.0
), otherwise some package/env managers such as conda might use a cached version. - To finish the procedure, create a new release on the GitHub repository.
For the bug fix release (e.g. 0.2.0 -> 0.2.1), the process is similar. You don't need
to create the branch 0.2.X
because it exists already. You need to cherry-pick the
commits from master
into this branch and then follow the same steps as above:
bumping the version, update the setup, commit and push the changes and finally create
and update the wheel.