Skip to content

use setuptools to give version to netket

Vicentini Filippo requested to merge version into master

Created by: PhilipVinc

Some last utilities before the release...

  • Use setuptools to generate the version automatically from the git tag
    • So when we want to make a release the steps will be
    1. git tag v3.0a1
    2. pip install -e . # to be sure all dependencies are installed
    3. python setup.py sdist
    4. twine upload dist/*

This automatically generates the version number. If someone downloads from master, when he does pip install -e . he will get the commit number mangled with the version which might improve debugging if it ever happens.

The main reason for the above is to combine it with the other part of this PR:

  • Automatic publishing to pypi.
  • Now, when we tag a release on GitHub, an action doing the above automatically and uploading to PyPi, without hassle on our part.
  • This will work only after @gcarleo creates the two secrets PYPI_USERNAME and PYPI_PASSWORD according to the guide https://docs.github.com/en/actions/reference/encrypted-secrets .

I think this will be handy in order to be a bit more responsive in the development in the future. Like, if we have a bugfix, tagging a patch release will be effortless.

Merge request reports