fredstro/hilbertmodgroup

Releases

Closed this issue · 7 comments

It is standard to provide releases for any library or software. As far as this Python package is concerned, the most straightforward would be to

  • tag the sources with a version number (probably 0.0.0)
  • make a source distribution (python setup.py sdist)
  • check source distribution installability (with pip install) and validity (using twine check)
  • upload the source distribution on PyPI

Part of the review for openjournals/joss-reviews#3996

@videlec what do you think is the best way of keeping track of version, using a version number in code/separate file or using git tags and setuptools-scm? I looked at the various options at https://packaging.python.org/en/latest/guides/single-sourcing-package-version/ but I am not sure what is the best (or modern) way.

It is convenient for users to have the version available inside the package. For example

>>> import numpy
>>> numpy.__version__
'1.17.4'

And it is convenient for you to minimize the number of places where you hardcode this number.

What I would do is to hardcode it in both setup.py (or setup.cfg) and a file hilbertmodgroup/version.py

version = '0.0.0'

Then in the __init__.py file it would be convenient to have

from .version import version as __version__

(for now your __init__ file is empty but that might change in the future)

Any commit where you modify the version number would better contain only this change. That would be the commit you tag with the corresponding version number in the git history.

Note that there are automated tools that can handle the whole "make a new version" process such as rever.

I did not know setuptools-scm but it definitely looks like a reasonable solution.

I decided to use setuptools-scm and at the moment the following works

from hilbert_modgroup.version import version as __version__

I have also made a source distribution etc. and uploaded the distribution to pypi: https://pypi.org/project/hilbert-modular-group/
It can be installed with sage -pip install hilbert-modular-group

Great.