Skip to content

Commit

Permalink
setup.py - retrieve version info from packerlicious version.py
Browse files Browse the repository at this point in the history
  • Loading branch information
mayn committed Oct 14, 2017
1 parent d8782f8 commit 72f6dc9
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 2 deletions.
9 changes: 9 additions & 0 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<!-- Link to the issue being addressed -->


## List of Changes Proposed
<!-- what is being changed and why? -->


## Testing Evidence
<!-- surely this change was tested, show the evidence -->
12 changes: 11 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,19 @@
from distutils.core import setup
from setuptools import find_packages


def get_version():
with open('src/packerlicious/version.py') as f:
for line in f.readlines():
if line.startswith("__version__"):
version = line.split()[-1].strip('"')
return version
raise AttributeError("{0} __version__ not found".format(f.name))


setup(
name='packerlicious',
version='0.5.0',
version=get_version(),
author='Matthew Aynalem',
author_email='maynalem@gmail.com',
packages=find_packages('src'),
Expand Down
3 changes: 2 additions & 1 deletion src/packerlicious/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@
from thirdparty.troposphere import BaseAWSObject as BasePackerObject

from .template import Template
from .version import __version__ as version

__version__ = "0.5.0"
__version__ = version


class Ref(AWSHelperFn):
Expand Down
1 change: 1 addition & 0 deletions src/packerlicious/version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__version__ = "0.5.0"

0 comments on commit 72f6dc9

Please sign in to comment.