Skip to content

Commit 14968ea

Browse files
Merge pull request #34 from hartror/rh_version_fix
Changed setup.py to read version from __version__.py
2 parents f549ddf + aca520f commit 14968ea

File tree

4 files changed

+18
-10
lines changed

4 files changed

+18
-10
lines changed

pact/__init__.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
from .matchers import EachLike, SomethingLike, Term
44
from .pact import Pact
55
from .provider import Provider
6-
6+
from .__version__ import __version__ # noqa: F401
77

88
__all__ = ('Consumer', 'EachLike', 'Pact', 'Provider', 'SomethingLike', 'Term')
9-
__version__ = '0.6.0'

pact/__version__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
"""Pact version info."""
2+
3+
__version__ = '0.6.0'

setup.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,18 @@
1111
from setuptools.command.develop import develop
1212
from setuptools.command.install import install
1313

14-
import pact
15-
1614

1715
IS_64 = sys.maxsize > 2 ** 32
1816
PACT_STANDALONE_VERSION = '1.0.0'
1917

2018

19+
here = os.path.abspath(os.path.dirname(__file__))
20+
21+
about = {}
22+
with open(os.path.join(here, "pact", "__version__.py")) as f:
23+
exec(f.read(), about)
24+
25+
2126
class PactPythonDevelopCommand(develop):
2227
"""
2328
Custom develop mode installer for pact-python.
@@ -107,7 +112,7 @@ def read(filename):
107112
cmdclass={'develop': PactPythonDevelopCommand,
108113
'install': PactPythonInstallCommand},
109114
name='pact-python',
110-
version=pact.__version__,
115+
version=about['__version__'],
111116
description=('Tools for creating and verifying consumer driven contracts'
112117
' using the Pact framework.'),
113118
long_description=read('README.md'),

tox.ini

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
[tox]
2-
envlist=py27,py33,py34,py35,py36
3-
skipsdist=True
2+
envlist=py{27,33,34,35,36}-{test,install}
43
[testenv]
54
deps=
6-
-rrequirements_dev.txt
7-
py27: subprocess32
8-
commands=nosetests
5+
test: -rrequirements_dev.txt
6+
py27-test: subprocess32
7+
commands=
8+
test: nosetests
9+
install: python -c "import pact"

0 commit comments

Comments
 (0)