diff --git a/allow-older-requests.patch b/allow-older-requests.patch new file mode 100644 index 0000000..c284ebd --- /dev/null +++ b/allow-older-requests.patch @@ -0,0 +1,12 @@ +diff -Nurp docker-compose-1.16.1.orig/setup.py docker-compose-1.16.1/setup.py +--- docker-compose-1.16.1.orig/setup.py 2017-09-10 18:11:17.853724032 -0500 ++++ docker-compose-1.16.1/setup.py 2017-09-10 18:17:23.425757123 -0500 +@@ -33,7 +33,7 @@ install_requires = [ + 'cached-property >= 1.2.0', + 'docopt >= 0.6.1', + 'PyYAML >= 3.10', +- 'requests >= 2.6.1, != 2.11.0', ++ 'requests >= 2.6.0, != 2.11.0', + 'texttable >= 0.9.0', + 'websocket-client >= 0.32.0', + 'docker >= 2.5.1', diff --git a/allow-older-setuptools.patch b/allow-older-setuptools.patch new file mode 100644 index 0000000..68ad114 --- /dev/null +++ b/allow-older-setuptools.patch @@ -0,0 +1,52 @@ +Upstream uses environment markers to conditionally apply some dependencies. +Environment markers were first added in setuptools 20.6.8. + +diff -Nurp docker-compose-1.16.1.orig/setup.py docker-compose-1.16.1/setup.py +--- docker-compose-1.16.1.orig/setup.py 2017-09-10 18:33:56.293844235 -0500 ++++ docker-compose-1.16.1/setup.py 2017-09-10 18:47:08.124932179 -0500 +@@ -42,6 +42,17 @@ install_requires = [ + 'jsonschema >= 2.5.1', + ] + ++if sys.version_info[:2] < (3, 4): ++ install_requires.append('enum34 >= 1.0.4') ++ ++if sys.version_info[:2] < (3, 5): ++ install_requires.append('backports.ssl_match_hostname >= 3.5') ++ ++if sys.version_info[:2] < (3, 3): ++ install_requires.append('ipaddress >= 1.0.16') ++ ++if sys.platform == 'win32': ++ install_requires.append('colorama >= 0.3.7') + + tests_require = [ + 'pytest', +@@ -52,27 +63,10 @@ if sys.version_info[:2] < (3, 4): + tests_require.append('mock >= 1.0.1') + + extras_require = { +- ':python_version < "3.4"': ['enum34 >= 1.0.4, < 2'], +- ':python_version < "3.5"': ['backports.ssl_match_hostname >= 3.5'], +- ':python_version < "3.3"': ['ipaddress >= 1.0.16'], +- ':sys_platform == "win32"': ['colorama >= 0.3.7, < 0.4'], + 'socks': ['PySocks >= 1.5.6, != 1.5.7, < 2'], + } + + +-try: +- if 'bdist_wheel' not in sys.argv: +- for key, value in extras_require.items(): +- if key.startswith(':') and pkg_resources.evaluate_marker(key[1:]): +- install_requires.extend(value) +-except Exception as e: +- print("Failed to compute platform dependencies: {}. ".format(e) + +- "All dependencies will be installed as a result.", file=sys.stderr) +- for key, value in extras_require.items(): +- if key.startswith(':'): +- install_requires.extend(value) +- +- + setup( + name='docker-compose', + version=find_version("compose", "__init__.py"), diff --git a/docker-compose.spec b/docker-compose.spec index a76eb75..246023f 100644 --- a/docker-compose.spec +++ b/docker-compose.spec @@ -1,5 +1,12 @@ %global debug_package %{nil} +%if 0%{?rhel} +# Currently python3_pkgversion is set to 34 when EPEL is enabled. However, not +# all our dependencies have python34-* subpackages yet. Once they do, this +# definition override should be removed. +%global python3_pkgversion %{nil} +%endif + Name: docker-compose Version: 1.16.1 Release: 2%{?dist} @@ -12,27 +19,43 @@ Source0: https://files.pythonhosted.org/packages/source/d/%{name}/%{name} # Remove dependency version constraints not relevant in Fedora/EPEL Patch0: remove-requires-upper-bound.patch +# https://github.com/docker/compose/issues/4884 +Patch1: allow-older-requests.patch + +# Upstream uses environment markers to conditionally apply some dependencies. +# Environment markers were first added in setuptools 20.6.8. +Patch2: allow-older-setuptools.patch + # docker-compose is compatible with fig and is a simple rename. # Currently it only prints deprecation warnings for changed functionality. Provides: fig = %{version}-%{release} # Last fig EVR was 1.0.1-2 Obsoletes: fig <= 1.0.1-3 -BuildRequires: python3-devel -BuildRequires: python3-setuptools - -Requires: python3-setuptools -Requires: python3-cached_property >= 1.2.0 -Requires: python3-docopt >= 0.6.1 -Requires: python3-yaml >= 3.10 -Requires: python3-requests >= 2.6.1 -Requires: python3-texttable >= 0.9.0 -Requires: python3-websocket-client >= 0.32.0 -Requires: python3-docker >= 2.5.1 -Requires: python3-dockerpty >= 0.4.1 -Requires: python3-six >= 1.3.0 -Requires: python3-jsonschema >= 2.5.1 -Requires: python3-pysocks >= 1.5.6 +BuildRequires: python%{?python3_pkgversion}-devel +BuildRequires: python%{?python3_pkgversion}-setuptools + +Requires: python%{?python3_pkgversion}-setuptools +Requires: python%{?python3_pkgversion}-cached_property >= 1.2.0 +Requires: python%{?python3_pkgversion}-docopt >= 0.6.1 +Requires: python%{?python3_pkgversion}-yaml >= 3.10 +Requires: python%{?python3_pkgversion}-requests >= 2.6.0 +Requires: python%{?python3_pkgversion}-texttable >= 0.9.0 +Requires: python%{?python3_pkgversion}-websocket-client >= 0.32.0 +Requires: python%{?python3_pkgversion}-docker >= 2.5.1 +Requires: python%{?python3_pkgversion}-dockerpty >= 0.4.1 +Requires: python%{?python3_pkgversion}-six >= 1.3.0 +Requires: python%{?python3_pkgversion}-jsonschema >= 2.5.1 +Requires: python%{?python3_pkgversion}-pysocks >= 1.5.6 +%if 0%{?python3_version_nodots} < 34 +Requires: python%{?python3_pkgversion}-enum34 >= 1.0.4 +%endif +%if 0%{?python3_version_nodots} < 35 +Requires: python%{?python3_pkgversion}-backports-ssl_match_hostname >= 3.5 +%endif +%if 0%{?python3_version_nodots} < 33 +Requires: python%{?python3_pkgversion}-ipaddress >= 1.0.16 +%endif BuildArch: noarch @@ -55,30 +78,39 @@ Using Compose is basically a three-step process. entire app. %prep -%setup -q - -%patch0 -p1 +%autosetup -p 1 # Upstream uses an underscore here rm -r docker_compose.egg-info %build +%if 0%{?python3_pkgversion} %py3_build +%else +%py2_build +%endif %install +%if 0%{?python3_pkgversion} %py3_install +%else +%py2_install +%endif %files %doc CHANGES.md CONTRIBUTING.md README.rst SWARM.md %license LICENSE %{_bindir}/%{name} -# Upstream uses an underscore here -%{python3_sitelib}/docker_compose* -%{python3_sitelib}/compose* +%if 0%{?python3_pkgversion} +%{python3_sitelib}/* +%else +%{python2_sitelib}/* +%endif %changelog * Sun Sep 10 2017 Carl George - 1.16.1-2 - Align dependencies with upstream +- RHEL compatibility * Sat Sep 2 2017 Michael Hampton - 1.16.1-1 - Update to 1.16.1 (#1483776)