Skip to content

Commit

Permalink
Simplify versioning, just use __version__ in setup.py
Browse files Browse the repository at this point in the history
  • Loading branch information
ross committed Nov 11, 2023
1 parent 304c3c8 commit d40b987
Showing 1 changed file with 4 additions and 17 deletions.
21 changes: 4 additions & 17 deletions setup.py
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
from os import environ
from subprocess import CalledProcessError, check_output
#!/usr/bin/env python

from setuptools import find_packages, setup

Expand All @@ -12,23 +11,11 @@ def descriptions():


def version():
version = 'unknown'
with open('octodns_dnsmadeeasy/__init__.py') as fh:
for line in fh:
if line.startswith('__VERSION__'):
version = line.split("'")[1]
break

# pep440 style public & local version numbers
if environ.get('OCTODNS_RELEASE', False):
# public
return version
try:
sha = check_output(['git', 'rev-parse', 'HEAD']).decode('utf-8')[:8]
except (CalledProcessError, FileNotFoundError):
sha = 'unknown'
# local
return f'{version}+{sha}'
if line.startswith('__version__'):
return line.split("'")[1]
return 'unknown'


description, long_description = descriptions()
Expand Down

0 comments on commit d40b987

Please sign in to comment.