Skip to content

Commit

Permalink
Make setup.py find the version in azure pipelines
Browse files Browse the repository at this point in the history
  • Loading branch information
adam-douglass committed Mar 30, 2020
1 parent 2e7e4d5 commit c291a07
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@
# For development and local builds use this version number, but for real builds replace it
# with the tag found in the environment
package_version = "4.0.0.dev0"
for variable_name in ['BITBUCKET_TAG']:
package_version = os.environ.get(variable_name, package_version)
package_version = package_version.lstrip('v')
if 'BITBUCKET_TAG' in os.environ:
package_version = os.environ['BITBUCKET_TAG'].lstrip('v')
elif 'BUILD_SOURCEBRANCH' in os.environ:
full_tag_prefix = 'refs/tags/v'
package_version = os.environ['BUILD_SOURCEBRANCH'][len(full_tag_prefix):]


setup(
Expand Down

0 comments on commit c291a07

Please sign in to comment.