Skip to content

Commit

Permalink
Add pbr for release veriosn
Browse files Browse the repository at this point in the history
  • Loading branch information
codingjoe committed Apr 6, 2019
1 parent 69afbe6 commit e5c673b
Showing 1 changed file with 4 additions and 22 deletions.
26 changes: 4 additions & 22 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,25 +1,7 @@
#!/usr/bin/env python
import subprocess

from setuptools import setup


def get_version():
try:
output = subprocess.check_output( # nosec
['git', 'describe', '--tags']
).decode().strip()
except subprocess.CalledProcessError:
pass
else:
try:
tag, commit_num, sha = output.split('-', 3)
except ValueError:
pep440_version = output
else:
pep440_version = '%s.dev%s' % (tag, commit_num)

return pep440_version


setup(version=get_version())
setup(
setup_requires=['pbr'],
pbr=True,
)

0 comments on commit e5c673b

Please sign in to comment.