Skip to content

Commit a5ccdb0

Browse files
committed
Add auto version number and test
1 parent 2c70d14 commit a5ccdb0

4 files changed

Lines changed: 14 additions & 3 deletions

File tree

hyperop/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
from ._version import __version__
12
from .hyperop import hyperop, bounded_hyperop
23

3-
__all__ = ['hyperop', 'bounded_hyperop']
4+
__all__ = ['hyperop', 'bounded_hyperop', '__version__']

hyperop/_version.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
__version__ = "1.1"

setup.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1-
import os
21
from setuptools import setup
32

3+
# Load the version string
4+
exec(open('hyperop/_version.py').read())
5+
46
setup(
57
name="hyperop",
68
packages=['hyperop'],
7-
version="1.0",
9+
version=__version__,
810
download_url = 'https://github.com/thoppe/python-hyperoperators/tarball/1.0',
911
author="Travis Hoppe",
1012
author_email="travis.hoppe+hyperop@gmail.com",

tests/hyperop_test.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import itertools
33
import math
44
import operator
5+
import hyperop as hyperop_lib
56
from hyperop import hyperop, bounded_hyperop
67

78
testing_values = range(1, 15)
@@ -159,5 +160,11 @@ def test_special_case_a0(self):
159160
for n in range(4, 15):
160161
assert H[n](0, b) == (b % 2 == 0)
161162

163+
164+
class CheckMeta(unittest.TestCase):
165+
166+
def test_VersionNumberExists(self):
167+
hyperop_lib.__version__
168+
162169
if __name__ == '__main__':
163170
unittest.main()

0 commit comments

Comments
 (0)