From a5ccdb0856aa0264b64d70e17a1df367101221c4 Mon Sep 17 00:00:00 2001 From: thoppe Date: Wed, 10 Feb 2016 17:47:12 -0500 Subject: [PATCH 1/2] Add auto version number and test --- hyperop/__init__.py | 3 ++- hyperop/_version.py | 1 + setup.py | 6 ++++-- tests/hyperop_test.py | 7 +++++++ 4 files changed, 14 insertions(+), 3 deletions(-) create mode 100644 hyperop/_version.py diff --git a/hyperop/__init__.py b/hyperop/__init__.py index 6513d28..92def4c 100644 --- a/hyperop/__init__.py +++ b/hyperop/__init__.py @@ -1,3 +1,4 @@ +from ._version import __version__ from .hyperop import hyperop, bounded_hyperop -__all__ = ['hyperop', 'bounded_hyperop'] +__all__ = ['hyperop', 'bounded_hyperop', '__version__'] diff --git a/hyperop/_version.py b/hyperop/_version.py new file mode 100644 index 0000000..f901408 --- /dev/null +++ b/hyperop/_version.py @@ -0,0 +1 @@ +__version__ = "1.1" diff --git a/setup.py b/setup.py index 283b1dc..b9e8c16 100644 --- a/setup.py +++ b/setup.py @@ -1,10 +1,12 @@ -import os from setuptools import setup +# Load the version string +exec(open('hyperop/_version.py').read()) + setup( name="hyperop", packages=['hyperop'], - version="1.0", + version=__version__, download_url = 'https://github.com/thoppe/python-hyperoperators/tarball/1.0', author="Travis Hoppe", author_email="travis.hoppe+hyperop@gmail.com", diff --git a/tests/hyperop_test.py b/tests/hyperop_test.py index 9b16be5..f68a808 100644 --- a/tests/hyperop_test.py +++ b/tests/hyperop_test.py @@ -2,6 +2,7 @@ import itertools import math import operator +import hyperop as hyperop_lib from hyperop import hyperop, bounded_hyperop testing_values = range(1, 15) @@ -159,5 +160,11 @@ def test_special_case_a0(self): for n in range(4, 15): assert H[n](0, b) == (b % 2 == 0) + +class CheckMeta(unittest.TestCase): + + def test_VersionNumberExists(self): + hyperop_lib.__version__ + if __name__ == '__main__': unittest.main() From e299b7ee68bbbd3d72b2042dac1b9acf59eee671 Mon Sep 17 00:00:00 2001 From: thoppe Date: Thu, 11 Feb 2016 16:19:57 -0500 Subject: [PATCH 2/2] autopep8 status --- setup.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index b9e8c16..b9550d0 100644 --- a/setup.py +++ b/setup.py @@ -7,13 +7,13 @@ name="hyperop", packages=['hyperop'], version=__version__, - download_url = 'https://github.com/thoppe/python-hyperoperators/tarball/1.0', + download_url='https://github.com/thoppe/python-hyperoperators/tarball/1.0', author="Travis Hoppe", author_email="travis.hoppe+hyperop@gmail.com", description=( "Hyperoperators (succession, addition, multiplication, exponentiation, tetration and higher) in python."), license = "Creative Commons Attribution-ShareAlike 4.0 International License", - keywords = ["math","hyperoperators","uparrow","large-numbers",], + keywords = ["math", "hyperoperators", "uparrow", "large-numbers", ], url="https://github.com/thoppe/python-hyperoperators", test_suite="tests", )