Skip to content

Commit

Permalink
Auto set python package version from git tag
Browse files Browse the repository at this point in the history
  • Loading branch information
daquexian committed May 23, 2019
1 parent bf69edf commit 51b19b2
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion tools/onnx2daq/python/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,13 @@
tests_require = []
extras_require = {}

build_source_branch = os.getenv("BUILD_SOURCEBRANCH", "")
if build_source_branch.startswith('refs/tags/v'):
dnnlibrary_version = build_source_branch[len('refs/tags/v'):]
else:
dnnlibrary_version = '0.0.0'
print("DNNLibrary version: {}".format(dnnlibrary_version))

################################################################################
# Global variables for controlling the build variant
################################################################################
Expand Down Expand Up @@ -184,7 +191,7 @@ def build_extension(self, ext):

setuptools.setup(
name="onnx2daq",
# version=VersionInfo.version,
version=dnnlibrary_version,
description="Convert ONNX to daq for DNNLibrary",
ext_modules=ext_modules,
cmdclass=cmdclass,
Expand Down

0 comments on commit 51b19b2

Please sign in to comment.