Skip to content

Commit d51e9c8

Browse files
underyxhjacobs
authored andcommitted
setup.py: Use env markers for Python version-specific dependencies (#495)
* setup.py: Use env markers for Python version-specific dependencies Changing package properties dynamically in setup.py means that universal wheels will actually be built only for the builder's environment, and might not work properly on different platforms/PYthon versions. Closes #493 * travis: Upgrade setuptools before running tests * reqs: Stop installing pathlib from mercurial in dev mode The mercurial repo is at 0.8 while the latest release on PyPI is 1.0.1
1 parent 78e962f commit d51e9c8

File tree

3 files changed

+5
-12
lines changed

3 files changed

+5
-12
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ python:
66
- "3.5"
77
- "3.6"
88
install:
9-
- pip install tox tox-travis coveralls
9+
- pip install "setuptools>=17.1" tox tox-travis coveralls
1010
script:
1111
- tox
1212
after_success:

requirements-devel.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
-e git+https://github.com/kennethreitz/requests#egg=requests
44
-e git+https://github.com/Yelp/swagger_spec_validator.git#egg=swagger-spec-validator
55
-e git+https://github.com/zalando/python-clickclick.git#egg=clickclick
6-
-e hg+https://bitbucket.org/pitrou/pathlib#egg=pathlib
6+
# This repo doesn't have the latest version released on PyPI
7+
# -e hg+https://bitbucket.org/pitrou/pathlib#egg=pathlib
78
# PyYAML is not that easy to build manually, it may fail.
89
#-e svn+http://svn.pyyaml.org/pyyaml/trunk#egg=PyYAML
910
# six is causing errors during the tests

setup.py

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33

44
import inspect
55
import os
6-
import platform
76
import sys
87

98
from setuptools import find_packages, setup
@@ -21,9 +20,6 @@ def read_version(package):
2120

2221
version = read_version('connexion')
2322

24-
py_major_minor_version = tuple(int(v.rstrip('+')) for v in platform.python_version_tuple()[:2])
25-
26-
2723
install_requires = [
2824
'clickclick>=1.2',
2925
'jsonschema>=2.5.1',
@@ -32,16 +28,12 @@ def read_version(package):
3228
'six>=1.9',
3329
'swagger-spec-validator>=2.0.2',
3430
'inflection>=0.3.1',
31+
'pathlib>=1.0.1; python_version < "3.4"',
32+
'typing>=3.6.1; python_version < "3.6"',
3533
]
3634

3735
flask_require = 'flask>=0.10.1'
3836

39-
if py_major_minor_version < (3, 4):
40-
install_requires.append('pathlib>=1.0.1')
41-
42-
if py_major_minor_version < (3, 6):
43-
install_requires.append('typing>=3.6.1')
44-
4537
tests_require = [
4638
'decorator',
4739
'mock',

0 commit comments

Comments
 (0)