sketch icon indicating copy to clipboard operation
sketch copied to clipboard

bad versioning code in setup.py

Open joelb123 opened this issue 2 years ago • 0 comments

setup.py contains the following line:

__version__ = subprocess.check_output( ["git", "describe", "--abbrev=4"]).decode().strip().split('-')[0]

which fails if the package is installed from tarball and not from git.

Fixing this is one of the messes of python packaging. One popular way is to use the package setuptools-scm, but that has some pitfalls too. With my own code, I find the simplest is the best. Put a version string into its own .py file, where it can be imported into setup. I haven't seen where your version info is stored, but have your Makefile stuff it into the version.py file as part of release.

joelb123 avatar Jul 11 '23 21:07 joelb123