From 5fc56f6e70bfd6e6f8a321dadb5b11d5b0fa34d0 Mon Sep 17 00:00:00 2001 From: Charalampos Stratakis Date: Mon, 20 Nov 2017 16:00:20 +0100 Subject: [PATCH] Add virtual provides for all the libraries that pip bundles. Remove ordereddict bundle as it is only required for python <=2.6. Remove ipaddress library from the python3 build as it only required on python2. Changed some dependency names from python-* to the python2-* namespace. Resolves: rhbz#1096912 --- python-pip.spec | 82 ++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 71 insertions(+), 11 deletions(-) diff --git a/python-pip.spec b/python-pip.spec index 56edce1..965b908 100644 --- a/python-pip.spec +++ b/python-pip.spec @@ -23,8 +23,9 @@ %endif Name: python-%{srcname} +# When updating, update the bundled libraries versions bellow! Version: 9.0.1 -Release: 12%{?dist} +Release: 13%{?dist} Summary: A tool for installing and managing Python packages Group: Development/Libraries @@ -67,21 +68,46 @@ Packages" or "Pip Installs Python". Summary: A tool for installing and managing Python 2 packages Group: Development/Libraries BuildRequires: python2-devel -BuildRequires: python-setuptools +BuildRequires: python2-setuptools %if %{with tests} -BuildRequires: python-mock -BuildRequires: pytest -BuildRequires: python-pretend -BuildRequires: python-freezegun -BuildRequires: python-pytest-capturelog -BuildRequires: python-scripttest -BuildRequires: python-virtualenv +BuildRequires: python2-mock +BuildRequires: python2-pytest +BuildRequires: python2-pretend +BuildRequires: python2-freezegun +BuildRequires: python2-pytest-capturelog +BuildRequires: python2-scripttest +BuildRequires: python2-virtualenv %endif %if %{without bootstrap} BuildRequires: python2-pip -BuildRequires: python-wheel +BuildRequires: python2-wheel %endif -Requires: python-setuptools +Requires: python2-setuptools + +# Virtual provides for the packages bundled by pip. +# You can find the versions in pip/_vendor/vendor.txt file. +# Don't forget to update this bellow for python3 as well. +Provides: bundled(python2dist(appdirs)) = 1.4.0 +Provides: bundled(python2dist(cachecontrol)) = 0.11.7 +Provides: bundled(python2dist(colorama)) = 0.3.7 +Provides: bundled(python2dist(distlib)) = 0.2.4 +Provides: bundled(python2dist(distro)) = 1.0.1 +Provides: bundled(python2dist(html5lib)) = 1.0b10 +Provides: bundled(python2dist(ipaddress) = 1.0.17 +Provides: bundled(python2dist(lockfile)) = 0.12.2 +Provides: bundled(python2dist(packaging)) = 16.8 +Provides: bundled(python2dist(setuptools)) = 28.8.0 +Provides: bundled(python2dist(progress)) = 1.2 +Provides: bundled(python2dist(pyparsing)) = 2.1.10 +Provides: bundled(python2dist(requests)) = 2.11.1 +Provides: bundled(python2dist(retrying)) = 1.3.3 +Provides: bundled(python2dist(six)) = 1.10.0 +Provides: bundled(python2dist(webencodings)) = 0.5 + +# Bundled within the requests bundle +Provides: bundled(python2dist(chardet)) = 2.3.0 +Provides: bundled(python2dist(urllib3)) = 1.16 + %{?python_provide:%python_provide python2-%{srcname}} %description -n python2-%{srcname} @@ -115,6 +141,29 @@ BuildRequires: python%{python3_pkgversion}-pip BuildRequires: python%{python3_pkgversion}-wheel %endif Requires: python%{python3_pkgversion}-setuptools + +# Virtual provides for the packages bundled by pip. +# See the python2 list above for instructions. +Provides: bundled(python3dist(appdirs)) = 1.4.0 +Provides: bundled(python3dist(cachecontrol)) = 0.11.7 +Provides: bundled(python3dist(colorama)) = 0.3.7 +Provides: bundled(python3dist(distlib)) = 0.2.4 +Provides: bundled(python3dist(distro)) = 1.0.1 +Provides: bundled(python3dist(html5lib)) = 1.0b10 +Provides: bundled(python3dist(lockfile)) = 0.12.2 +Provides: bundled(python3dist(packaging)) = 16.8 +Provides: bundled(python3dist(setuptools)) = 28.8.0 +Provides: bundled(python3dist(progress)) = 1.2 +Provides: bundled(python3dist(pyparsing)) = 2.1.10 +Provides: bundled(python3dist(requests)) = 2.11.1 +Provides: bundled(python3dist(retrying)) = 1.3.3 +Provides: bundled(python3dist(six)) = 1.10.0 +Provides: bundled(python3dist(webencodings)) = 0.5 + +# Bundled within the requests bundle +Provides: bundled(python3dist(chardet)) = 2.3.0 +Provides: bundled(python3dist(urllib3)) = 1.16 + %{?python_provide:%python_provide python%{python3_pkgversion}-%{srcname}} %description -n python%{python3_pkgversion}-%{srcname} @@ -137,6 +186,9 @@ tar -xf %{SOURCE1} sed -i '1d' pip/__init__.py +# Remove ordereddict as it is only required for python <= 2.6 +rm pip/_vendor/ordereddict.py + %build %if %{with python2} @@ -169,6 +221,11 @@ sed -i '1d' pip/__init__.py rm %{buildroot}%{_bindir}/pip %endif # with python3 +# Remove the bundled ipaddress library from the python3 build +# as it is only required by the python2 one. +rm %{buildroot}%{python3_sitelib}/pip/_vendor/ipaddress.py +rm %{buildroot}%{python3_sitelib}/pip/_vendor/__pycache__/ipaddress.cpython-*.pyc + %if %{with python2} %if %{without bootstrap} %py2_install_wheel %{python2_wheelname} @@ -278,6 +335,9 @@ py.test-%{python3_version} -m 'not network' %endif # with python3 %changelog +* Mon Nov 20 2017 Charalampos Stratakis - 9.0.1-13 +- Add virtual provides for the bundled libraries. (rhbz#1096912) + * Tue Aug 29 2017 Tomas Orsava - 9.0.1-12 - Switch macros to bcond's and make Python 2 optional to facilitate building the Python 2 and Python 3 modules