Update to 18.0

This commit is contained in:
Marcel Plch 2018-07-23 17:22:50 +02:00
commit 2e7f501aa1
8 changed files with 213 additions and 197 deletions

View file

@ -19,6 +19,9 @@
%global python3_wheelname %python_wheelname
%endif
%endif
%if %{with doc}
%global pypa_theme_commit_hash d2e63fbfc62af3b7050f619b2f5bb8658985b931
%endif
# Note that with disabled python3, bashcomp2 will be disabled as well because
# bashcompdir will point to a different path than with python3 enabled.
@ -29,12 +32,38 @@
Name: python-%{srcname}
# When updating, update the bundled libraries versions bellow!
Version: 9.0.3
Release: 6%{?dist}
Version: 18.0
Release: 1%{?dist}
Summary: A tool for installing and managing Python packages
Group: Development/Libraries
License: MIT
# We bundle a lot of libraries with pip, which itself is under MIT license.
# Here is the list of the libraries with corresponding licenses:
# appdirs: MIT
# distlib: Python
# distro: ASL 2.0
# html5lib: MIT
# six: MIT
# colorama: BSD
# CacheControl: ASL 2.0
# msgpack-python: ASL 2.0
# lockfile: MIT
# progress: ISC
# ipaddress: Python
# packaging: BSD or ASL 2.0
# pyparsing: MIT
# pytoml: MIT
# retrying: ASL 2.0
# requests: ASL 2.0
# chardet: LGPLv2
# idna: BSD
# urllib3: MIT
# certifi: MPLv2.0
# setuptools: MIT
# webencodings: BSD
License: MIT and Python and ASL 2.0 and BSD and ISC and LGPLv2 and MPLv2.0 and Unicode and (ASL 2.0 or BSD)
URL: http://www.pip-installer.org
Source0: https://files.pythonhosted.org/packages/source/p/%{srcname}/%{srcname}-%{version}.tar.gz
@ -47,9 +76,15 @@ BuildRequires: bzr
# to get tests:
# git clone https://github.com/pypa/pip && cd pip
# git checkout 9.0.1 && tar -czvf ../pip-9.0.1-tests.tar.gz tests/
# git checkout 18.0 && tar -czvf ../pip-18.0-tests.tar.gz tests/
%if %{with tests}
Source1: pip-9.0.1-tests.tar.gz
Source1: pip-18.0-tests.tar.gz
%endif
# Themes required to build the docs.
%if %{with doc}
Source2: https://github.com/pypa/pypa-docs-theme/archive/%{pypa_theme_commit_hash}.tar.gz
Source3: https://github.com/python/python-docs-theme/archive/2018.2.tar.gz
%endif
# Patch until the following issue gets implemented upstream:
@ -61,20 +96,18 @@ Patch0: allow-stripping-given-prefix-from-wheel-RECORD-files.patch
# Issue upstream: https://github.com/pypa/pip/issues/4288
Patch1: emit-a-warning-when-running-with-root-privileges.patch
# WIP upstream patch https://github.com/pypa/pip/issues/5346
# https://bugzilla.redhat.com/show_bug.cgi?id=1573755
Patch2: pip-nowarn-upgrade.patch
# Add path to the doc themes to conf.py
Patch2: html_theme_path.patch
# Downstream only patch
# Users are upgrading pip9 to pip10 by various manners,
# one of them is `pip install --user --upgrade pip`.
# Users might have local installations of pip from using
# `pip install --user --upgrade pip` on older versions.
# If they do that and they run `pip` or `pip3`, the one from /usr/bin is used.
# However that's the one from this RPM package (pip9) and the import in there
# fails (it tries to import from ~/.local, but pip10 is there with a bit
# However that's the one from this RPM package (pip10+) and the import in there
# fails (it tries to import from ~/.local, but older pip is there with a bit
# different API).
# We add this patch as a dirty workaround to make /usr/bin/pip* work with
# both pip9 (from this RPM) and pip10 (from whatever).
# both pip10+ (from this RPM) and older pip (from whatever).
# A proper fix is to put ~/.local/bin in front of /usr/bin in the PATH,
# however others are against that and we cannot change it for existing
# installs/user homes anyway.
@ -82,7 +115,7 @@ Patch2: pip-nowarn-upgrade.patch
# https://bugzilla.redhat.com/show_bug.cgi?id=1571650
# WARNING: /usr/bin/pip* are entrypoints, this cannot be applied in %%prep!
# %%patch10 doesn't work outside of %%prep, so we add it as a source
Source10: pip9-allow-pip10-import.patch
Source10: pip-allow-older-versions.patch
%description
pip is a package management system used to install and manage software packages
@ -102,9 +135,9 @@ BuildRequires: python2-mock
BuildRequires: python2-pytest
BuildRequires: python2-pretend
BuildRequires: python2-freezegun
BuildRequires: python2-pytest-capturelog
BuildRequires: python2-scripttest
BuildRequires: python2-virtualenv
BuildRequires: python2-pyyaml
%endif
%if %{without bootstrap}
BuildRequires: python2-pip
@ -115,26 +148,28 @@ 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(appdirs)) = 1.4.3
Provides: bundled(python2dist(distlib)) = 0.2.7
Provides: bundled(python2dist(distro)) = 1.3.0
Provides: bundled(python2dist(html5lib)) = 1.0.1
Provides: bundled(python2dist(six)) = 1.11.0
Provides: bundled(python2dist(colorama)) = 0.3.9
Provides: bundled(python2dist(CacheControl)) = 0.12.5
Provides: bundled(python2dist(msgpack-python)) = 0.5.6
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(progress)) = 1.4
Provides: bundled(python2dist(ipaddress)) = 1.0.22
Provides: bundled(python2dist(packaging)) = 17.1
Provides: bundled(python2dist(pyparsing)) = 2.2.0
Provides: bundled(python2dist(pytoml)) = 0.1.16
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
Provides: bundled(python2dist(requests)) = 2.19.1
Provides: bundled(python2dist(idna)) = 2.7
Provides: bundled(python2dist(certifi)) = 2018.4.16
Provides: bundled(python2dist(setuptools)) = 39.2.0
Provides: bundled(python2dist(webencodings)) = 0.5.1
Provides: bundled(python2dist(chardet)) = 3.0.4
Provides: bundled(python2dist(urllib3)) = 1.23
%{?python_provide:%python_provide python2-%{srcname}}
@ -160,9 +195,9 @@ BuildRequires: python%{python3_pkgversion}-mock
BuildRequires: python%{python3_pkgversion}-pytest
BuildRequires: python%{python3_pkgversion}-pretend
BuildRequires: python%{python3_pkgversion}-freezegun
BuildRequires: python%{python3_pkgversion}-pytest-capturelog
BuildRequires: python%{python3_pkgversion}-scripttest
BuildRequires: python%{python3_pkgversion}-virtualenv
BuildRequires: python%{python3_pkgversion}-pyyaml
%endif
%if %{without bootstrap}
BuildRequires: python%{python3_pkgversion}-pip
@ -172,26 +207,28 @@ 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(ipaddress) = 1.0.17
Provides: bundled(python3dist(appdirs)) = 1.4.3
Provides: bundled(python3dist(distlib)) = 0.2.7
Provides: bundled(python3dist(distro)) = 1.3.0
Provides: bundled(python3dist(html5lib)) = 1.0.1
Provides: bundled(python3dist(six)) = 1.11.0
Provides: bundled(python3dist(colorama)) = 0.3.9
Provides: bundled(python3dist(CacheControl)) = 0.12.5
Provides: bundled(python3dist(msgpack-python)) = 0.5.6
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(progress)) = 1.4
Provides: bundled(python3dist(ipaddress)) = 1.0.22
Provides: bundled(python3dist(packaging)) = 17.1
Provides: bundled(python3dist(pyparsing)) = 2.2.0
Provides: bundled(python3dist(pytoml)) = 0.1.16
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
Provides: bundled(python3dist(requests)) = 2.19.1
Provides: bundled(python3dist(idna)) = 2.7
Provides: bundled(python3dist(certifi)) = 2018.4.16
Provides: bundled(python3dist(setuptools)) = 39.2.0
Provides: bundled(python3dist(webencodings)) = 0.5.1
Provides: bundled(python3dist(urllib3)) = 1.23
Provides: bundled(python3dist(chardet)) = 3.0.4
%{?python_provide:%python_provide python%{python3_pkgversion}-%{srcname}}
@ -225,16 +262,19 @@ exit 1
%if %{with tests}
tar -xf %{SOURCE1}
%endif
%if %{with doc}
pushd docs
tar -xf %{SOURCE2}
mv pypa-docs-theme-%{pypa_theme_commit_hash} pypa
tar -xf %{SOURCE3}
mv python-docs-theme-2018.2 python-docs-theme
popd
%endif
%patch0 -p1
%patch1 -p1
%patch2 -p1
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}
@ -255,9 +295,10 @@ rm pip/_vendor/ordereddict.py
%if %{with doc}
pushd docs
export PYTHONPATH=../src/
make html
make man
rm _build/html/.buildinfo
rm build/html/.buildinfo
popd
%endif
@ -276,14 +317,18 @@ rm %{buildroot}%{_bindir}/pip
%endif # with python3
%if %{with doc}
pushd docs/build/man
install -d %{buildroot}%{_mandir}/man1
for MAN in *1; do
%if %{with python2}
install -pm0644 docs/_build/man/*.1 %{buildroot}%{_mandir}/man1/pip.1
install -pm0644 docs/_build/man/*.1 %{buildroot}%{_mandir}/man1/pip2.1
install -pm0644 $MAN %{buildroot}%{_mandir}/man1/$MAN
install -pm0644 $MAN %{buildroot}%{_mandir}/man1/${MAN/pip/pip2}
%endif
%if %{with python3}
install -pm0644 docs/_build/man/*.1 %{buildroot}%{_mandir}/man1/pip3.1
install -pm0644 $MAN %{buildroot}%{_mandir}/man1/${MAN/pip/pip3}
%endif
done
popd
%endif # with doc
%if %{with python2}
@ -371,6 +416,7 @@ echo rpm > %{buildroot}%{python3_sitelib}/pip-%{version}.dist-info/INSTALLER
%if %{with tests}
%check
export PYTHONPATH=src
%if %{with python2}
py.test-%{python2_version} -m 'not network'
%endif
@ -387,6 +433,8 @@ py.test-%{python3_version} -m 'not network'
%if %{with doc}
%{_mandir}/man1/pip.*
%{_mandir}/man1/pip2.*
%{_mandir}/man1/pip-*
%{_mandir}/man1/pip2-*
%endif
%{_bindir}/pip
%{_bindir}/pip2
@ -408,6 +456,7 @@ py.test-%{python3_version} -m 'not network'
%doc README.rst
%if %{with doc}
%{_mandir}/man1/pip3.*
%{_mandir}/man1/pip3-*
%endif
%{_bindir}/pip3
%{_bindir}/pip-3
@ -424,11 +473,14 @@ py.test-%{python3_version} -m 'not network'
%files doc
%license LICENSE.txt
%doc README.rst
%doc docs/_build/html
%doc docs/build/html
%endif # with doc
%endif # with python3
%changelog
* Mon Jul 23 2018 Marcel Plch <mplch@redhat.com> - 18.0-7
- Update to 18.0
* Sat Jul 14 2018 Fedora Release Engineering <releng@fedoraproject.org> - 9.0.3-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild