diff --git a/python-docker.spec b/python-docker.spec index 866845c..3c0605b 100644 --- a/python-docker.spec +++ b/python-docker.spec @@ -25,8 +25,11 @@ Source0: https://files.pythonhosted.org/packages/source/d/%{srcname}/%{sr # we have those in Fedora in different versions Patch1: unpin-test-requirements.patch -# Python packages mentioned in `extras_require` are not available in CentOS -Patch2: setup-Neuter-extras_require-that-doesn-t-work-on-Cen.patch +# Upstream uses environment markers to conditionally apply some dependencies. +# Environment markers were first added in setuptools 20.6.8, so that doesn't +# work in RHEL. This patch converts those environment markers into simple if +# statements. +Patch2: remove-environment-markers.patch # Upstream uses pip to check if the older docker-py module is installed. We # handle that with an obsolete. @@ -155,6 +158,7 @@ PYTHONPATH="${PWD}" py.test-%{python3_version} tests/unit/ || : %changelog * Tue Sep 05 2017 Carl George - 2.5.1-2 - Add patch3 to remove pip dependency +- Rewrite patch2 to conditionally apply extra dependencies * Wed Aug 23 2017 Tomas Tomecek - 2.5.1-1 - new upstream release: 2.5.1 diff --git a/remove-environment-markers.patch b/remove-environment-markers.patch new file mode 100644 index 0000000..90db013 --- /dev/null +++ b/remove-environment-markers.patch @@ -0,0 +1,46 @@ +Generate requirements list dynamically instead of using environment markers. +This allows using versions of setuptools older than 20.6.8. + +diff -Nurp docker-2.5.1.orig/setup.py docker-2.5.1/setup.py +--- docker-2.5.1.orig/setup.py 2017-08-22 18:44:35.000000000 -0500 ++++ docker-2.5.1/setup.py 2017-09-05 12:06:03.280017598 -0500 +@@ -29,23 +29,14 @@ requirements = [ + if sys.platform == 'win32': + requirements.append('pypiwin32 >= 219') + +-extras_require = { +- ':python_version < "3.5"': 'backports.ssl_match_hostname >= 3.5', +- # While not imported explicitly, the ipaddress module is required for +- # ssl_match_hostname to verify hosts match with certificates via +- # ServerAltname: https://pypi.python.org/pypi/backports.ssl_match_hostname +- ':python_version < "3.3"': 'ipaddress >= 1.0.16', +- +- # If using docker-py over TLS, highly recommend this option is +- # pip-installed or pinned. +- +- # TODO: if pip installing both "requests" and "requests[security]", the +- # extra package from the "security" option are not installed (see +- # https://github.com/pypa/pip/issues/4391). Once that's fixed, instead of +- # installing the extra dependencies, install the following instead: +- # 'requests[security] >= 2.5.2, != 2.11.0, != 2.12.2' +- 'tls': ['pyOpenSSL>=0.14', 'cryptography>=1.3.4', 'idna>=2.0.0'], +-} ++if sys.version_info[:2] < (3, 5): ++ requirements.append('backports.ssl_match_hostname >= 3.5') ++ ++# While not imported explicitly, the ipaddress module is required for ++# ssl_match_hostname to verify hosts match with certificates via ++# ServerAltname: https://pypi.python.org/pypi/backports.ssl_match_hostname ++if sys.version_info[:2] < (3, 3): ++ requirements.append('ipaddress >= 1.0.16') + + version = None + exec(open('docker/version.py').read()) +@@ -72,7 +63,6 @@ setup( + packages=find_packages(exclude=["tests.*", "tests"]), + install_requires=requirements, + tests_require=test_requirements, +- extras_require=extras_require, + zip_safe=False, + test_suite='tests', + classifiers=[ diff --git a/setup-Neuter-extras_require-that-doesn-t-work-on-Cen.patch b/setup-Neuter-extras_require-that-doesn-t-work-on-Cen.patch deleted file mode 100644 index 76d7c3a..0000000 --- a/setup-Neuter-extras_require-that-doesn-t-work-on-Cen.patch +++ /dev/null @@ -1,26 +0,0 @@ -From 3eeef7b62131a1dbcbb2758eb9eb382578ddd0fb Mon Sep 17 00:00:00 2001 -From: Colin Walters -Date: Tue, 3 May 2016 16:35:24 +0200 -Subject: [PATCH] setup: Neuter extras_require that doesn't work on CentOS 7 - -I think the version of python-setuputils is too old or something. ---- - setup.py | 16 ++++++++-------- - 1 file changed, 8 insertions(+), 8 deletions(-) - -diff --git a/setup.py b/setup.py -index 9fc4ad6..6167419 100644 ---- a/setup.py -+++ b/setup.py -@@ -62,7 +62,7 @@ setup( - packages=find_packages(exclude=["tests.*", "tests"]), - install_requires=requirements, - tests_require=test_requirements, -- extras_require=extras_require, -+ # extras_require=extras_require, - zip_safe=False, - test_suite='tests', - classifiers=[ --- -2.11.0 -