Skip to content

Commit 9eb12ac

Browse files
authored
Fix the build for python 2.6 and python 3.3. (#254)
The latest version of pytest (3.3.0) dropped support for these python versions, so we need to install an older version when we're being run on one of them.
1 parent 1a31f0d commit 9eb12ac

File tree

2 files changed

+19
-13
lines changed

2 files changed

+19
-13
lines changed

requirements-dev.txt

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1 @@
1-
-r requirements.txt
2-
bottle
3-
jsonpatch
4-
mock>=2.0.0
5-
pep8
6-
pylint
7-
pytest>=2.8.3
8-
pytest-cov
9-
pytest-xdist
10-
sphinx>=1.5,<1.6
11-
sqlalchemy
12-
tox
1+
-e .[test,all]

setup.py

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,23 @@ def main():
8383
python_conditional = 'python_version=="{0}"'.format(python_version)
8484
key = ':{0}'.format(python_conditional)
8585
extra_requires[key].append(requirement)
86+
test_requires = [
87+
'bottle',
88+
'jsonpatch',
89+
'mock>=2.0.0',
90+
'pep8', 'pylint',
91+
'sqlalchemy',
92+
'tox',
93+
'pytest-cov',
94+
'pytest-xdist',
95+
'pytz',
96+
]
97+
# pytest>=3.3.0 has dropped support for python 2.6 and 3.3; we pin lower than 3.3.0 for those python versions
98+
if sys.version_info[:2] <= (2, 6) or (sys.version_info[0] == 3 and sys.version_info[1] <= 3):
99+
test_requires.append('pytest>=2.8.3,<3.3.0')
100+
else:
101+
test_requires.append('pytest>=2.8.3')
102+
extra_requires['test'] = test_requires
86103
with open('boxsdk/version.py', 'r', encoding='utf-8') as config_py:
87104
version = re.search(r'^\s+__version__\s*=\s*[\'"]([^\'"]*)[\'"]', config_py.read(), re.MULTILINE).group(1)
88105
setup(
@@ -96,7 +113,7 @@ def main():
96113
packages=find_packages(exclude=['demo', 'docs', 'test', 'test*', '*test', '*test*']),
97114
install_requires=install_requires,
98115
extras_require=extra_requires,
99-
tests_require=['pytest', 'pytest-xdist', 'mock', 'sqlalchemy', 'bottle', 'jsonpatch'],
116+
tests_require=test_requires,
100117
cmdclass={'test': PyTest},
101118
classifiers=CLASSIFIERS,
102119
keywords='box oauth2 sdk',

0 commit comments

Comments
 (0)