From 82235d4efa4549d0e9e44d02a028e18b77c20829 Mon Sep 17 00:00:00 2001 From: Miro Hrončok Date: Nov 22 2018 12:58:09 +0000 Subject: Update to 18.1 (#1652089) --- diff --git a/.gitignore b/.gitignore index 6276f03..9609481 100644 --- a/.gitignore +++ b/.gitignore @@ -26,3 +26,5 @@ pip-0.7.2.tar.gz /2018.2.tar.gz /pip-18.0-tests.tar.gz /d2e63fbfc62af3b7050f619b2f5bb8658985b931.tar.gz +/pip-18.1.tar.gz +/pip-18.1-tests.tar.gz diff --git a/allow-stripping-given-prefix-from-wheel-RECORD-files.patch b/allow-stripping-given-prefix-from-wheel-RECORD-files.patch index 00de3c5..182f0d9 100644 --- a/allow-stripping-given-prefix-from-wheel-RECORD-files.patch +++ b/allow-stripping-given-prefix-from-wheel-RECORD-files.patch @@ -1,7 +1,8 @@ -diff -ru pip-18.0/src/pip/_internal/commands/install.py pip-18.0_patched/src/pip/_internal/commands/install.py ---- pip-18.0/src/pip/_internal/commands/install.py 2018-07-20 06:10:48.000000000 +0200 -+++ pip-18.0_patched/src/pip/_internal/commands/install.py 2018-07-23 16:49:39.085357813 +0200 -@@ -110,6 +110,14 @@ +diff --git a/src/pip/_internal/commands/install.py b/src/pip/_internal/commands/install.py +index 6fc178f..1279d4a 100644 +--- a/src/pip/_internal/commands/install.py ++++ b/src/pip/_internal/commands/install.py +@@ -115,6 +115,14 @@ class InstallCommand(RequirementCommand): default=None, help="Installation prefix where lib, bin and other top-level " "folders are placed") @@ -16,7 +17,7 @@ diff -ru pip-18.0/src/pip/_internal/commands/install.py pip-18.0_patched/src/pip cmd_opts.add_option(cmdoptions.build_dir()) -@@ -345,6 +353,7 @@ +@@ -364,6 +372,7 @@ class InstallCommand(RequirementCommand): pycompile=options.compile, warn_script_location=warn_script_location, use_user_site=options.use_user_site, @@ -24,10 +25,11 @@ diff -ru pip-18.0/src/pip/_internal/commands/install.py pip-18.0_patched/src/pip ) lib_locations = get_lib_location_guesses( -diff -ru pip-18.0/src/pip/_internal/req/req_install.py pip-18.0_patched/src/pip/_internal/req/req_install.py ---- pip-18.0/src/pip/_internal/req/req_install.py 2018-07-22 07:14:20.000000000 +0200 -+++ pip-18.0_patched/src/pip/_internal/req/req_install.py 2018-07-23 16:51:51.115943214 +0200 -@@ -514,7 +514,7 @@ +diff --git a/src/pip/_internal/req/req_install.py b/src/pip/_internal/req/req_install.py +index c2624fe..922d10c 100644 +--- a/src/pip/_internal/req/req_install.py ++++ b/src/pip/_internal/req/req_install.py +@@ -370,7 +370,7 @@ class InstallRequirement(object): def move_wheel_files(self, wheeldir, root=None, home=None, prefix=None, warn_script_location=True, use_user_site=False, @@ -36,7 +38,7 @@ diff -ru pip-18.0/src/pip/_internal/req/req_install.py pip-18.0_patched/src/pip/ move_wheel_files( self.name, self.req, wheeldir, user=use_user_site, -@@ -524,6 +524,7 @@ +@@ -380,6 +380,7 @@ class InstallRequirement(object): pycompile=pycompile, isolated=self.isolated, warn_script_location=warn_script_location, @@ -44,7 +46,7 @@ diff -ru pip-18.0/src/pip/_internal/req/req_install.py pip-18.0_patched/src/pip/ ) # Things valid for sdists -@@ -924,7 +925,7 @@ +@@ -743,7 +744,7 @@ class InstallRequirement(object): def install(self, install_options, global_options=None, root=None, home=None, prefix=None, warn_script_location=True, @@ -53,7 +55,7 @@ diff -ru pip-18.0/src/pip/_internal/req/req_install.py pip-18.0_patched/src/pip/ global_options = global_options if global_options is not None else [] if self.editable: self.install_editable( -@@ -939,6 +940,7 @@ +@@ -758,6 +759,7 @@ class InstallRequirement(object): self.source_dir, root=root, prefix=prefix, home=home, warn_script_location=warn_script_location, use_user_site=use_user_site, pycompile=pycompile, @@ -61,10 +63,11 @@ diff -ru pip-18.0/src/pip/_internal/req/req_install.py pip-18.0_patched/src/pip/ ) self.install_succeeded = True return -diff -ru pip-18.0/src/pip/_internal/wheel.py pip-18.0_patched/src/pip/_internal/wheel.py ---- pip-18.0/src/pip/_internal/wheel.py 2018-07-17 10:26:00.000000000 +0200 -+++ pip-18.0_patched/src/pip/_internal/wheel.py 2018-07-23 16:52:57.749238655 +0200 -@@ -206,7 +206,7 @@ +diff --git a/src/pip/_internal/wheel.py b/src/pip/_internal/wheel.py +index 5ce890e..c42d77a 100644 +--- a/src/pip/_internal/wheel.py ++++ b/src/pip/_internal/wheel.py +@@ -206,7 +206,7 @@ def message_about_scripts_not_on_PATH(scripts): def move_wheel_files(name, req, wheeldir, user=False, home=None, root=None, pycompile=True, scheme=None, isolated=False, prefix=None, @@ -73,17 +76,16 @@ diff -ru pip-18.0/src/pip/_internal/wheel.py pip-18.0_patched/src/pip/_internal/ """Install a wheel""" if not scheme: -@@ -507,7 +507,12 @@ - writer.writerow(row) +@@ -508,7 +508,11 @@ if __name__ == '__main__': + outrows.append(tuple(row)) for f in generated: digest, length = rehash(f) -- writer.writerow((normpath(f, lib_dir), digest, length)) +- outrows.append((normpath(f, lib_dir), digest, length)) + final_path = normpath(f, lib_dir) + if strip_file_prefix and final_path.startswith(strip_file_prefix): + final_path = os.path.join(os.sep, + os.path.relpath(final_path, strip_file_prefix)) -+ writer.writerow((final_path, digest, length)) -+ ++ outrows.append((final_path, digest, length)) for f in installed: - writer.writerow((installed[f], '', '')) - shutil.move(temp_record, record) + outrows.append((installed[f], '', '')) + for row in sorted(outrows): diff --git a/emit-a-warning-when-running-with-root-privileges.patch b/emit-a-warning-when-running-with-root-privileges.patch index 3135fc3..5aa0b09 100644 --- a/emit-a-warning-when-running-with-root-privileges.patch +++ b/emit-a-warning-when-running-with-root-privileges.patch @@ -1,7 +1,8 @@ -diff -ru pip-18.0/src/pip/_internal/commands/install.py pip-18.0_patched/src/pip/_internal/commands/install.py ---- pip-18.0/src/pip/_internal/commands/install.py 2018-07-20 06:10:48.000000000 +0200 -+++ pip-18.0_patched/src/pip/_internal/commands/install.py 2018-07-31 12:15:43.777317780 +0200 -@@ -5,6 +5,8 @@ +diff --git a/src/pip/_internal/commands/install.py b/src/pip/_internal/commands/install.py +index 1279d4a..aeb9d26 100644 +--- a/src/pip/_internal/commands/install.py ++++ b/src/pip/_internal/commands/install.py +@@ -5,6 +5,8 @@ import logging import operator import os import shutil @@ -10,20 +11,22 @@ diff -ru pip-18.0/src/pip/_internal/commands/install.py pip-18.0_patched/src/pip from optparse import SUPPRESS_HELP from pip._vendor import pkg_resources -@@ -205,6 +207,18 @@ +@@ -217,6 +219,20 @@ class InstallCommand(RequirementCommand): + def run(self, options, args): cmdoptions.check_install_build_global(options) - ++ + def is_venv(): -+ return hasattr(sys, 'real_prefix') or \ -+ (hasattr(sys, 'base_prefix') and sys.base_prefix != sys.prefix) ++ return (hasattr(sys, 'real_prefix') or ++ (hasattr(sys, 'base_prefix') and ++ sys.base_prefix != sys.prefix)) + + # Check whether we have root privileges and aren't in venv/virtualenv + if os.getuid() == 0 and not is_venv(): + logger.warning( + "WARNING: Running pip install with root privileges is " + "generally not a good idea. Try `%s install --user` instead." -+ % path.basename(sys.argv[0]) ++ % path.basename(sys.argv[0]) + ) + upgrade_strategy = "to-satisfy-only" diff --git a/html_theme_path.patch b/html_theme_path.patch index f9b2100..4209471 100644 --- a/html_theme_path.patch +++ b/html_theme_path.patch @@ -1,6 +1,6 @@ diff -ru pip-10.0.1/docs/conf.py pip-10.0.1_patched/docs/conf.py ---- pip-10.0.1/docs/conf.py 2018-04-14 13:17:31.000000000 +0200 -+++ pip-10.0.1_patched/docs/conf.py 2018-07-23 15:23:31.053267611 +0200 +--- pip-10.0.1/docs/html/conf.py 2018-04-14 13:17:31.000000000 +0200 ++++ pip-10.0.1_patched/docs/html/conf.py 2018-07-23 15:23:31.053267611 +0200 @@ -134,6 +134,7 @@ # The theme to use for HTML and HTML Help pages. Major themes that come with # Sphinx are currently 'default' and 'sphinxdoc'. diff --git a/python-pip.spec b/python-pip.spec index a6868e9..cf4b6af 100644 --- a/python-pip.spec +++ b/python-pip.spec @@ -22,10 +22,9 @@ Name: python-%{srcname} # When updating, update the bundled libraries versions bellow! # You can use vendor_meta.sh in the dist git repo -Version: 18.0 -Release: 4%{?dist} +Version: 18.1 +Release: 1%{?dist} Summary: A tool for installing and managing Python packages -Group: Development/Libraries # We bundle a lot of libraries with pip, which itself is under MIT license. # Here is the list of the libraries with corresponding licenses: @@ -42,6 +41,7 @@ Group: Development/Libraries # progress: ISC # ipaddress: Python # packaging: ASL 2.0 or BSD +# pep517: MIT # pyparsing: MIT # pytoml: MIT # retrying: ASL 2.0 @@ -55,7 +55,7 @@ Group: Development/Libraries License: MIT and Python and ASL 2.0 and BSD and ISC and LGPLv2 and MPLv2.0 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 +Source0: %pypi_source BuildArch: noarch @@ -66,9 +66,9 @@ BuildRequires: bzr # to get tests: # git clone https://github.com/pypa/pip && cd pip -# git checkout 18.0 && tar -czvf ../pip-18.0-tests.tar.gz tests/ +# git checkout $VERSION && tar -czvf ../pip-$VERSION-tests.tar.gz tests/ %if %{with tests} -Source1: pip-18.0-tests.tar.gz +Source1: pip-%{version}-tests.tar.gz %endif # Themes required to build the docs. @@ -134,24 +134,24 @@ Provides: bundled(python%{1}dist(msgpack-python)) = 0.5.6 Provides: bundled(python%{1}dist(lockfile)) = 0.12.2 Provides: bundled(python%{1}dist(progress)) = 1.4 Provides: bundled(python%{1}dist(ipaddress)) = 1.0.22 -Provides: bundled(python%{1}dist(packaging)) = 17.1 -Provides: bundled(python%{1}dist(pyparsing)) = 2.2.0 -Provides: bundled(python%{1}dist(pytoml)) = 0.1.16 +Provides: bundled(python%{1}dist(packaging)) = 18.0 +Provides: bundled(python%{1}dist(pep517)) = 0.2 +Provides: bundled(python%{1}dist(pyparsing)) = 2.2.1 +Provides: bundled(python%{1}dist(pytoml)) = 0.1.19 Provides: bundled(python%{1}dist(retrying)) = 1.3.3 Provides: bundled(python%{1}dist(requests)) = 2.19.1 -Provides: bundled(python%{1}dist(idna)) = 2.7 -Provides: bundled(python%{1}dist(certifi)) = 2018.4.16 -Provides: bundled(python%{1}dist(setuptools)) = 39.2.0 -Provides: bundled(python%{1}dist(webencodings)) = 0.5.1 Provides: bundled(python%{1}dist(chardet)) = 3.0.4 +Provides: bundled(python%{1}dist(idna)) = 2.7 Provides: bundled(python%{1}dist(urllib3)) = 1.23 +Provides: bundled(python%{1}dist(certifi)) = 2018.8.24 +Provides: bundled(python%{1}dist(setuptools)) = 40.4.3 +Provides: bundled(python%{1}dist(webencodings)) = 0.5.1 } %if %{with python2} %package -n python2-%{srcname} Summary: A tool for installing and managing Python 2 packages -Group: Development/Libraries BuildRequires: python2-devel BuildRequires: python2-setuptools %if %{with tests} @@ -185,7 +185,6 @@ Packages" or "Pip Installs Python". %package -n python%{python3_pkgversion}-%{srcname} Summary: A tool for installing and managing Python3 packages -Group: Development/Libraries BuildRequires: python%{python3_pkgversion}-devel BuildRequires: python%{python3_pkgversion}-setuptools @@ -245,7 +244,7 @@ A Python wheel of pip to use with venv. tar -xf %{SOURCE1} %endif %if %{with doc} -pushd docs +pushd docs/html tar -xf %{SOURCE2} mv pypa-docs-theme-%{pypa_theme_commit_hash} pypa tar -xf %{SOURCE3} @@ -271,12 +270,11 @@ popd %endif %if %{with doc} -pushd docs -export PYTHONPATH=../src/ -make html -make man -rm build/html/.buildinfo -popd +export PYTHONPATH=./src/ +# from tox.ini +sphinx-build-3 -b html docs/html docs/build/html +sphinx-build-3 -b man docs/man docs/build/man -c docs/html +rm docs/build/html/.buildinfo %endif @@ -403,8 +401,6 @@ export PYTHONPATH=src %if %{with doc} %{_mandir}/man1/pip.* %{_mandir}/man1/pip2.* -%{_mandir}/man1/pip-* -%{_mandir}/man1/pip2-* %endif %{_bindir}/pip %{_bindir}/pip2 @@ -425,7 +421,6 @@ export PYTHONPATH=src %doc README.rst %if %{with doc} %{_mandir}/man1/pip3.* -%{_mandir}/man1/pip3-* %endif %{_bindir}/pip3 %{_bindir}/pip-3 @@ -454,6 +449,9 @@ export PYTHONPATH=src %endif %changelog +* Thu Nov 22 2018 Miro Hrončok - 18.1-1 +- Update to 18.1 (#1652089) + * Tue Sep 18 2018 Victor Stinner - 18.0-4 - Prevent removing of the system packages installed under /usr/lib when pip install -U is executed. Original patch by Michal Cyprian. diff --git a/remove-existing-dist-only-if-path-conflicts.patch b/remove-existing-dist-only-if-path-conflicts.patch index 85438de..9f85444 100644 --- a/remove-existing-dist-only-if-path-conflicts.patch +++ b/remove-existing-dist-only-if-path-conflicts.patch @@ -11,19 +11,19 @@ Date: Tue Sep 18 17:13:51 2018 +0200 Co-Authored-By: Michal Cyprian diff --git a/src/pip/_internal/req/req_install.py b/src/pip/_internal/req/req_install.py -index 8e91ecb..9beb100 100644 +index 922d10c..6f73f33 100644 --- a/src/pip/_internal/req/req_install.py +++ b/src/pip/_internal/req/req_install.py -@@ -36,7 +36,7 @@ from pip._internal.utils.hashes import Hashes +@@ -29,7 +29,7 @@ from pip._internal.utils.hashes import Hashes from pip._internal.utils.logging import indent_log from pip._internal.utils.misc import ( _make_build_dir, ask_path_exists, backup_dir, call_subprocess, - display_path, dist_in_site_packages, dist_in_usersite, ensure_dir, + display_path, dist_in_install_path, dist_in_site_packages, dist_in_usersite, ensure_dir, - get_installed_version, is_installable_dir, read_text_file, rmtree, + get_installed_version, rmtree, ) - from pip._internal.utils.setuptools_build import SETUPTOOLS_SHIM -@@ -503,7 +503,7 @@ class InstallRequirement(object): + from pip._internal.utils.packaging import get_metadata +@@ -359,7 +359,7 @@ class InstallRequirement(object): "lack sys.path precedence to %s in %s" % (existing_dist.project_name, existing_dist.location) ) @@ -33,12 +33,12 @@ index 8e91ecb..9beb100 100644 return True diff --git a/src/pip/_internal/resolve.py b/src/pip/_internal/resolve.py -index 8480e48..b118098 100644 +index 2d9f1c5..4ad9e77 100644 --- a/src/pip/_internal/resolve.py +++ b/src/pip/_internal/resolve.py @@ -20,7 +20,7 @@ from pip._internal.exceptions import ( ) - from pip._internal.req.req_install import InstallRequirement + from pip._internal.req.constructors import install_req_from_req from pip._internal.utils.logging import indent_log -from pip._internal.utils.misc import dist_in_usersite, ensure_dir +from pip._internal.utils.misc import dist_in_install_path, dist_in_usersite, ensure_dir @@ -57,19 +57,19 @@ index 8480e48..b118098 100644 req.satisfied_by = None diff --git a/src/pip/_internal/utils/misc.py b/src/pip/_internal/utils/misc.py -index 3236af6..e60287b 100644 +index 84a421f..c879a21 100644 --- a/src/pip/_internal/utils/misc.py +++ b/src/pip/_internal/utils/misc.py -@@ -32,7 +32,7 @@ from pip._internal.compat import ( +@@ -29,7 +29,7 @@ from pip._vendor.six.moves.urllib import parse as urllib_parse from pip._internal.exceptions import CommandError, InstallationError from pip._internal.locations import ( running_under_virtualenv, site_packages, user_site, virtualenv_no_global, - write_delete_marker_file, + write_delete_marker_file, distutils_scheme, ) - - if PY2: -@@ -324,6 +324,16 @@ def dist_in_site_packages(dist): + from pip._internal.utils.compat import ( + WINDOWS, console_to_str, expanduser, stdlib_pkgs, +@@ -328,6 +328,16 @@ def dist_in_site_packages(dist): ).startswith(normalize_path(site_packages)) diff --git a/sources b/sources index 5bd9ed8..d779adf 100644 --- a/sources +++ b/sources @@ -1,4 +1,4 @@ -SHA512 (pip-18.0.tar.gz) = 51b8708756a8cbe5ca284fa09908d4acf1127493e4b645f2756ae55e4afd5dec619a017cedb695a044aa24a377909810a1caea4242bb3dc475bfe3435fcaa1bc -SHA512 (pip-18.0-tests.tar.gz) = 1ce5bc8f64e6e55e30956f607e2e6b6f8bc16bb64c6715e28bebf22c17f1b85728db5c3f481fed223bd936a0ab7d0ea526417445cf33a80db6e9250cd2838975 +SHA512 (pip-18.1.tar.gz) = f13c129675f2de7f8bc10cfd0d49fc5c650cf59825282c3311c15841bca904604fe78a28d9b48f1c8fa4486826ac3d7d7362cec7a4631715b71b0928b48fff1d +SHA512 (pip-18.1-tests.tar.gz) = c1afa128e883c4bf1ebe1696c81e1bc2299010e43d6be01164359ee164b2b56c787b912d923b669b0ddc5efca77d7f7956f17737d1d378d8ba571695c09082d1 SHA512 (d2e63fbfc62af3b7050f619b2f5bb8658985b931.tar.gz) = fc7b11c5cbf6322469ce2eaca2a8d7eb60b17398d316f7465ab5d3d38dabd00ee22a3da7437a28f6312f0115f77f2df0d8bf0abc671e055eef06356c94283409 SHA512 (2018.2.tar.gz) = 4c09c43a70ecb3ca3bc9445b01bf209eb382e41d9c969145696dea38551992ed88fd9b725a1264380f3dbdf8acdaf5ada3ef86b44255cdfbdbe4a01a1630912d