Skip to content

Release PyPi Instruction

Andrei Novikov edited this page Aug 17, 2020 · 21 revisions

Instruction to release pyclustering library to PyPi repository:

  1. Create release branch using the following pattern <version>.<year>.<year version>.<optional minor version>.rel, for example, 0.9.1.rel or 0.9.3.1.rel.

  2. Check version in setup.py and update it if it is required.

  3. Check description PKG-INFO.rst and update it if it is required.

  4. Generate doxygen documentation and deploy it to github pages.

$ sudo apt-get install graphviz
$ sudo apt-get install texlive
$ doxygen docs/doxygen_conf_pyclustering

$ cd ../
$ mkdir pyclustering-website
$ cd pyclustering-website
$ git clone https://github.com/pyclustering/pyclustering.github.io.git .
$ cp -r ../pyclustering/doxygen_python_docs docs/<library_version>
$ git add docs/<library_version>/
$ git commit . -m "[docs] Upload documentation for library version <library_version>."
$ git push
  1. Update the link to the documentation in README.rst and PKG-INFO.rst.

  2. Create GitHub pyclustering release from the release branch sources (see step 1).

  3. Update DOI description of the release on Zenodo.

  4. Update DOI link (README.rst, PKG-INFO.rst) and update it if it needed (not relevant step anymore).

  5. Add core binaries to the library from cloud. For that step token is required that can be obtained by following HTTP GET request:

https://oauth.yandex.ru/authorize?response_type=token&client_id=ID_YANDEX_APPLICATION
$ python3 ci/cloud $CLOUD_TOKEN get_bin <release branch> windows 64-bit
$ python3 ci/cloud $CLOUD_TOKEN get_bin <release branch> windows 32-bit
$ python3 ci/cloud $CLOUD_TOKEN get_bin <release branch> macos 64-bit
$ python3 ci/cloud $CLOUD_TOKEN get_bin <release branch> linux 32-bit
$ python3 ci/cloud $CLOUD_TOKEN get_bin <release branch> linux 64-bit
  1. Create pypi file description:
$ touch ~/.pypirc
$ nano ~/.pypirc
  1. Add following description:
[distutils]
index-servers=
    testpypi
    pypi

[testpypi]
repository = https://test.pypi.org/legacy/
username = <username>
password = <password>

[pypi]
repository = https://upload.pypi.org/legacy/
username = <username>
password = <password>
  1. Check setup file:
$ python3 setup.py check -r -s
  1. Create distributive:
$ python3 setup.py sdist
  1. Upload to test repository:
$ twine upload dist/* -r testpypi
  1. If everything is ok on test page then upload it to legacy:
$ twine upload dist/* -r pypi
  1. Upload *.tar.gz archive with binaries from pypi repository to github release.
Clone this wiki locally