Update to 20.1~b1

Don't install pip wheel via path to prevent PEP 610 treatment, see:
https://discuss.python.org/t/pep-610-usage-guidelines-for-linux-distributions/4012
This commit is contained in:
Tomas Hrnciar 2020-04-26 23:10:08 +02:00 committed by churchyard
commit 55406531cf
6 changed files with 90 additions and 216 deletions

View file

@ -3,7 +3,10 @@
%bcond_without doc
%global srcname pip
%global python_wheelname %{srcname}-%{version}-py2.py3-none-any.whl
%global base_version 20.1
%global prerel b1
%global upstream_version %{base_version}%{?prerel}
%global python_wheelname %{srcname}-%{upstream_version}-py2.py3-none-any.whl
%global python_wheeldir %{_datadir}/python-wheels
%if %{with doc}
@ -15,8 +18,8 @@
Name: python-%{srcname}
# When updating, update the bundled libraries versions bellow!
# You can use vendor_meta.sh in the dist git repo
Version: 20.0.2
Release: 4%{?dist}
Version: %{base_version}%{?prerel:~%{prerel}}
Release: 1%{?dist}
Summary: A tool for installing and managing Python packages
# We bundle a lot of libraries with pip, which itself is under MIT license.
@ -48,7 +51,7 @@ Summary: A tool for installing and managing Python packages
License: MIT and Python and ASL 2.0 and BSD and ISC and LGPLv2 and MPLv2.0 and (ASL 2.0 or BSD)
URL: https://pip.pypa.io/
Source0: https://github.com/pypa/pip/archive/%{version}/%{srcname}-%{version}.tar.gz
Source0: https://github.com/pypa/pip/archive/%{upstream_version}/%{srcname}-%{upstream_version}.tar.gz
BuildArch: noarch
@ -88,11 +91,6 @@ Patch4: dummy-certifi.patch
# this warning is juts moot. Also, the warning breaks CPython test suite.
Patch5: nowarn-pip._internal.main.patch
# Allow setting $TMPDIR to $PWD/... during pip wheel
# This is needed to have proper debugsource packages with pyproject-rpm-macros
# https://bugzilla.redhat.com/show_bug.cgi?id=1806625
Patch6: https://github.com/pypa/pip/pull/7873.patch
# Downstream only patch
# Users might have local installations of pip from using
# `pip install --user --upgrade pip` on older/newer versions.
@ -241,7 +239,7 @@ Requires: ca-certificates
A Python wheel of pip to use with venv.
%prep
%setup -q -n %{srcname}-%{version}
%setup -q -n %{srcname}-%{upstream_version}
%if %{with doc}
pushd docs/html
@ -257,7 +255,6 @@ popd
%patch3 -p1
%patch4 -p1
%patch5 -p1
%patch6 -p1
# this goes together with patch4
rm src/pip/_vendor/certifi/*.pem
@ -265,6 +262,11 @@ rm src/pip/_vendor/certifi/*.pem
# tests expect wheels in here
ln -s %{python_wheeldir} tests/data/common_wheels
# Upstream uses a Python 2/3 compatibility library for csv with Python 3 semantics in tests
# We only target Python 3 and csv23 is not (yet) packaged
# As of 20.1b1, this workaround was sufficient to get around the missing dependency
sed -i -e 's/csv23/csv/g' tests/lib/wheel.py
%build
%py3_build_wheel
@ -279,15 +281,18 @@ rm -rf docs/build/html/{.doctrees,.buildinfo}
%install
# The following is similar to %%py3_install_wheel, but we don't have
# /usr/bin/pip yet, so we install using the wheel directly.
# (This is not standard wheel usage, but the pip wheel supports it -- see
# pip/__main__.py)
%{__python3} dist/%{python_wheelname}/pip install \
-I 'dist/%{python_wheelname}' \
--root %{buildroot} \
--no-deps
--no-deps \
--no-cache-dir \
--no-index \
--ignore-installed \
--find-links dist \
'pip==%{upstream_version}'
%if %{with doc}
pushd docs/build/man
@ -306,7 +311,6 @@ for PIP in %{buildroot}%{_bindir}/pip*; do
patch -p1 --no-backup-if-mismatch $PIP < %{SOURCE10}
done
mkdir -p %{buildroot}%{bashcompdir}
PYTHONPATH=%{buildroot}%{python3_sitelib} \
%{buildroot}%{_bindir}/pip completion --bash \
@ -325,7 +329,7 @@ ln -s ./pip-%{python3_version} %{buildroot}%{_bindir}/pip-3
# Make sure the INSTALLER is not pip, otherwise Patch2 won't work
# %%pyproject macros do this for all packages
echo rpm > %{buildroot}%{python3_sitelib}/pip-%{version}.dist-info/INSTALLER
echo rpm > %{buildroot}%{python3_sitelib}/pip-%{upstream_version}.dist-info/INSTALLER
mkdir -p %{buildroot}%{python_wheeldir}
install -p dist/%{python_wheelname} -t %{buildroot}%{python_wheeldir}
@ -385,6 +389,9 @@ ln -sf %{buildroot}%{_bindir}/pip3 _bin/pip
%{python_wheeldir}/%{python_wheelname}
%changelog
* Mon Apr 27 2020 Tomas Hrnciar <thrnciar@redhat.com> - 20.1~b1-1
- Update to 20.1~b1
* Wed Apr 15 2020 Miro Hrončok <mhroncok@redhat.com> - 20.0.2-4
- Only recommend setuptools, don't require them