try using setuptools_scm for automatic versioning based on py-* tags (#187)

* try using setuptools_scm for automatic versioning based on py-* tags

* circument problem with pip-wheel isolation and setuptoosl_scm

* always provide version, address @flub comment
This commit is contained in:
holger krekel
2019-07-14 09:58:51 +02:00
committed by GitHub
parent 46c64b2511
commit 3e3403d3d7
5 changed files with 37 additions and 18 deletions

View File

@@ -0,0 +1,15 @@
import os
import sys
import subprocess
if __name__ == "__main__":
assert len(sys.argv) == 2
wheelhousedir = sys.argv[1]
# pip wheel will build in an isolated tmp dir that does not have git
# history so setuptools_scm can not automatically determine a
# version there. So pass in the version through an env var.
version = subprocess.check_output(["python", "setup.py", "--version"]).strip().split(b"\n")[-1]
os.environ["SETUPTOOLS_SCM_PRETEND_VERSION"] = version.decode("ascii")
subprocess.check_call(("pip wheel . -w %s" % wheelhousedir).split())