From 23f5c76f13c11163f2c7f838e38a781a23325f53 Mon Sep 17 00:00:00 2001 From: Mallory Hancock Date: Thu, 28 Feb 2019 16:35:22 -0800 Subject: [PATCH] iterate version --- pinhook/__version__.py | 1 + setup.py | 12 +++++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 pinhook/__version__.py diff --git a/pinhook/__version__.py b/pinhook/__version__.py new file mode 100644 index 0000000..0e1a38d --- /dev/null +++ b/pinhook/__version__.py @@ -0,0 +1 @@ +__version__ = '1.7.0' diff --git a/setup.py b/setup.py index 721a8c7..326c3ba 100755 --- a/setup.py +++ b/setup.py @@ -17,6 +17,7 @@ DESCRIPTION = 'a pluggable irc bot framework in python' URL = 'https://github.com/archangelic/pinhook' EMAIL = 'mhancock@archangelic.space' AUTHOR = 'M. Hancock' +VERSION = None # What packages are required for this module to be executed? REQUIRED = [ @@ -36,6 +37,15 @@ here = os.path.abspath(os.path.dirname(__file__)) with io.open(os.path.join(here, 'README.md'), encoding='utf-8') as f: long_description = '\n' + f.read() +# Load the package's __version__.py module as a dictionary. +about = {} +if not VERSION: + project_slug = NAME.lower().replace("-", "_").replace(" ", "_") + with open(os.path.join(here, project_slug, '__version__.py')) as f: + exec(f.read(), about) +else: + about['__version__'] = VERSION + class UploadCommand(Command): """Support setup.py upload.""" @@ -73,7 +83,7 @@ class UploadCommand(Command): # Where the magic happens: setup( name=NAME, - version='1.6.2', + version=about['__version__'], description=DESCRIPTION, long_description=long_description, long_description_content_type='text/markdown',