Releasing a new version

Publishing new version involves:

  1. Updating the version numbers and creating a new tag in git (which also updates the “stable” version of the documentation)
  2. Creating the distribution (.tar.gz and wheel files), and uploading them to pypi
Some important things to have in mind:
  • Read the “Packaging and Distributing Projects” guide:
  • The version numbers (in and are used as metadata for pypi and for the readthedocs documentation - pay attention to them or some things can break. In general, you should be working on a version such as “”. You then rename it to “0.2” and create a tag “v0.2”. After you finish everything, you update the version to “” to indicate that new developments are being made for the next version.

Step-by-step process

pip install twine
  • Update version on (e.g. “0.1”)
  • Update version on deslib/
  • Create tag: git tag <version> (example: “git tag ‘v0.1’”)
  • Push the tag git push origin <version>
  • Create the source and wheels distributions
python sdist # source distribution
python bdist_wheel # wheel distribution for current python version
  • Upload to test pypi and check

    • uploading the package:
    twine upload --repository-url dist/*
    • Note: if you do this multiple times (e.g. to fix an issue), you will need to rename the files under the “dist” folder: a filename can only be submitted once to pypi. You may also need to manually delete the “source” version of the distribution, since there can only be one source file per version of the software
    • Test an installation from the testing pypi environment.
    conda create -y -n testdes python=3
    source activate testdes
    pip install --index-url --extra-index-url deslib
    conda remove -y --name testdes --all  #remove temporary environment
  • Upload to production pypi

    twine upload dist/*
  • Mark the new stable version to be built on readthedocs:

  • Update version on and __init.py__ to mention the new version in development (e.g. “”)

Note #1: Read the docs is automatically updated:

  • When a new commit is done in master (this updates the “master” version)
  • When a new tag is pushed to github (this updates the “stable” version) -> This seems to not aways work - it is better to check

Note #2: The documentation automatically links to source files for the methods/classes. This only works if the tag is pushed to github, and matches the __version__ variable in __init.py__. Example: __version__ = “0.1” and the tag being: git tag “v0.1”