diff --git a/octodns/cmds/args.py b/octodns/cmds/args.py index 52b42da..1aefbea 100644 --- a/octodns/cmds/args.py +++ b/octodns/cmds/args.py @@ -10,7 +10,7 @@ from sys import stderr, stdout from yaml import safe_load -from octodns import __VERSION__ +from octodns import __version__ class ArgumentParser(_Base): @@ -24,7 +24,7 @@ class ArgumentParser(_Base): super().__init__(*args, **kwargs) def parse_args(self, default_log_level=INFO): - version = f'octoDNS {__VERSION__}' + version = f'octoDNS {__version__}' self.add_argument( '--version', action='version', diff --git a/octodns/manager.py b/octodns/manager.py index 1753269..3ec163c 100644 --- a/octodns/manager.py +++ b/octodns/manager.py @@ -11,7 +11,7 @@ from logging import getLogger from os import environ from sys import stdout -from . import __VERSION__ +from . import __version__ from .idna import IdnaDict, idna_decode, idna_encode from .processor.arpa import AutoArpa from .processor.meta import MetaProcessor @@ -89,7 +89,7 @@ class Manager(object): def __init__( self, config_file, max_workers=None, include_meta=False, auto_arpa=False ): - version = self._try_version('octodns', version=__VERSION__) + version = self._try_version('octodns', version=__version__) self.log.info( '__init__: config_file=%s, (octoDNS %s)', config_file, version ) @@ -308,7 +308,10 @@ class Manager(object): # finally try and import the module and see if it has a __VERSION__ if module is None: module = import_module(module_name) - return getattr(module, '__VERSION__', None) + # TODO: remove the __VERSION__ fallback eventually? + return getattr( + module, '__version__', getattr(module, '__VERSION__', None) + ) def _import_module(self, module_name): current = module_name diff --git a/octodns/processor/meta.py b/octodns/processor/meta.py index c9e4a05..ee56ef8 100644 --- a/octodns/processor/meta.py +++ b/octodns/processor/meta.py @@ -6,7 +6,7 @@ from datetime import datetime from logging import getLogger from uuid import uuid4 -from .. import __VERSION__ +from .. import __version__ from ..record import Record from .base import BaseProcessor @@ -91,7 +91,7 @@ class MetaProcessor(BaseProcessor): uuid = self.uuid() if include_uuid else None values.append(f'uuid={uuid}') if include_version: - values.append(f'octodns-version={__VERSION__}') + values.append(f'octodns-version={__version__}') self.include_provider = include_provider values.sort() self.values = values diff --git a/script/changelog b/script/changelog index 4257b67..c270fb9 100755 --- a/script/changelog +++ b/script/changelog @@ -2,6 +2,6 @@ set -e -VERSION=v$(grep __VERSION__ octodns/__init__.py | sed -e "s/^[^']*'//" -e "s/'$//") +VERSION=v$(grep __version__ octodns/__init__.py | sed -e "s/^[^']*'//" -e "s/'$//") echo $VERSION git log --pretty="%h - %cr - %s (%an)" "${VERSION}..HEAD" diff --git a/script/sdist b/script/sdist deleted file mode 100755 index 1ab0949..0000000 --- a/script/sdist +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash - -set -e - -if ! git diff-index --quiet HEAD --; then - echo "Changes in local directory, commit or clear" >&2 - exit 1 -fi - -SHA=$(git rev-parse HEAD) -python setup.py sdist -TARBALL="dist/octodns-$SHA.tar.gz" -mv dist/octodns-0.*.tar.gz "$TARBALL" - -echo "Created $TARBALL"