Simplify the version mechanism.
No "setuptools-scm" anymore. The version is read by a subprocess command or using package metadata or the VERSION file. I still don't know if this is my last attempt to make the version number reliable...
This commit is contained in:
parent
44b424e3c6
commit
6c7038cdde
|
@ -33,16 +33,18 @@ import subprocess
|
||||||
|
|
||||||
PKGNAME = 'msspec'
|
PKGNAME = 'msspec'
|
||||||
|
|
||||||
|
thisfile_path = os.path.abspath(__file__)
|
||||||
|
thisfile_dir = os.path.dirname(thisfile_path)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
cmd = ["git describe|sed 's/-\([0-9]\+\)-.*/.dev\\1/g'"]
|
cmd = ["git describe|sed 's/-\([0-9]\+\)-.*/.dev\\1/g'"]
|
||||||
result = subprocess.run(cmd, stdout=subprocess.PIPE, stderr=subprocess.DEVNULL, shell=True)
|
result = subprocess.run(cmd, stdout=subprocess.PIPE, stderr=subprocess.DEVNULL,
|
||||||
|
shell=True, cwd=thisfile_dir)
|
||||||
__version__ = result.stdout.decode('utf-8').strip()
|
__version__ = result.stdout.decode('utf-8').strip()
|
||||||
if __version__ == "":
|
if __version__ == "":
|
||||||
raise
|
raise
|
||||||
except Exception as err:
|
except Exception as err:
|
||||||
try:
|
try:
|
||||||
thisfile_path = os.path.abspath(__file__)
|
|
||||||
thisfile_dir = os.path.dirname(thisfile_path)
|
|
||||||
versionfile = os.path.join(thisfile_dir, "./VERSION")
|
versionfile = os.path.join(thisfile_dir, "./VERSION")
|
||||||
with open(versionfile, "r") as fd:
|
with open(versionfile, "r") as fd:
|
||||||
__version__ = fd.readline().strip()
|
__version__ = fd.readline().strip()
|
||||||
|
|
Loading…
Reference in New Issue