Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add __version__, deprecated __VERSION__ #43

Merged
merged 2 commits into from
Nov 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion octodns_gcore/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
from octodns.provider.base import BaseProvider
from octodns.record import GeoCodes, Record

__VERSION__ = '0.0.4'
# TODO: remove __VERSION__ with the next major version release
__version__ = __VERSION__ = '0.0.4'


class GCoreClientException(ProviderException):
Expand Down
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_gcore/__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