[Python-modules-commits] [python-pip] 07/08: merge patched into master

Barry Warsaw barry at moszumanska.debian.org
Thu Feb 25 22:09:48 UTC 2016


This is an automated email from the git hooks/post-receive script.

barry pushed a commit to branch master
in repository python-pip.

commit 6f4adbb4e8baf573920b4d632d61cc3e364b7e97
Merge: 981a53d d72211a
Author: Barry Warsaw <barry at python.org>
Date:   Thu Feb 25 16:15:01 2016 -0500

    merge patched into master

 CHANGES.txt                                    | 19 +++++++++
 PKG-INFO                                       |  2 +-
 debian/.git-dpm                                |  6 +--
 debian/patches/debundle.patch                  |  2 +-
 debian/patches/handle-unbundled-requests.patch |  2 +-
 debian/patches/hands-off-system-packages.patch |  4 +-
 debian/patches/set_user_default.patch          |  2 +-
 pip.egg-info/PKG-INFO                          |  2 +-
 pip.egg-info/requires.txt                      |  1 +
 pip/__init__.py                                |  6 +--
 pip/_vendor/distlib/__init__.py                |  4 +-
 pip/_vendor/distlib/compat.py                  |  2 +-
 pip/_vendor/distlib/database.py                | 21 ++++++----
 pip/_vendor/distlib/locators.py                | 16 ++++----
 pip/_vendor/distlib/metadata.py                | 16 ++++++--
 pip/_vendor/distlib/resources.py               |  2 +-
 pip/_vendor/distlib/scripts.py                 | 55 +++++++++++++++++---------
 pip/_vendor/distlib/util.py                    | 40 +++++++++++++------
 pip/_vendor/distlib/version.py                 |  6 +--
 pip/_vendor/distlib/wheel.py                   |  2 +-
 pip/_vendor/vendor.txt                         |  2 +-
 pip/index.py                                   |  4 +-
 pip/req/req_install.py                         |  6 ++-
 pip/utils/__init__.py                          | 55 ++++++++++++++++++++------
 pip/utils/deprecation.py                       | 32 +++++++--------
 pip/utils/ui.py                                |  5 +++
 pip/wheel.py                                   |  2 +-
 setup.cfg                                      |  4 +-
 setup.py                                       |  3 +-
 29 files changed, 213 insertions(+), 110 deletions(-)

diff --cc debian/.git-dpm
index 4a49d96,0000000..4c6e0b8
mode 100644,000000..100644
--- a/debian/.git-dpm
+++ b/debian/.git-dpm
@@@ -1,11 -1,0 +1,11 @@@
 +# see git-dpm(1) from git-dpm package
- 005bc25c2d771153764cf29cca974f2ed9f98f7c
- 005bc25c2d771153764cf29cca974f2ed9f98f7c
- c9fd1b7c41802c64663a7a4646bf9b546f2389e2
++d72211ae99990ba08eba3a5bf151f48e041679d5
++d72211ae99990ba08eba3a5bf151f48e041679d5
++cf2f0c79999bcec7ace285b22565952637cebbd5
 +cf2f0c79999bcec7ace285b22565952637cebbd5
 +python-pip_8.0.3.orig.tar.gz
 +661d3261486136ab678ac89a5a582148aa62fdf9
 +1131758
 +debianTag="debian/%e%v"
 +patchedTag="patched/%e%v"
 +upstreamTag="upstream/%e%u"
diff --cc debian/patches/debundle.patch
index 28bd76a,0000000..c8acce9
mode 100644,000000..100644
--- a/debian/patches/debundle.patch
+++ b/debian/patches/debundle.patch
@@@ -1,30 -1,0 +1,30 @@@
- From 4ad0c64374fc905a82542d4f56a36470a414b421 Mon Sep 17 00:00:00 2001
++From 35065c84b9c21c09cc3edf075603663fc5eaf15c Mon Sep 17 00:00:00 2001
 +From: Barry Warsaw <barry at python.org>
 +Date: Thu, 3 Dec 2015 17:24:13 -0500
 +Subject: Devendorize wheels and use system built wheels.
 +
 +Patch-Name: debundle.patch
 +---
 + pip/_vendor/__init__.py | 4 ++--
 + 1 file changed, 2 insertions(+), 2 deletions(-)
 +
 +diff --git a/pip/_vendor/__init__.py b/pip/_vendor/__init__.py
 +index b09a7c3..1cb35a1 100644
 +--- a/pip/_vendor/__init__.py
 ++++ b/pip/_vendor/__init__.py
 +@@ -14,13 +14,13 @@ import sys
 + # Downstream redistributors which have debundled our dependencies should also
 + # patch this value to be true. This will trigger the additional patching
 + # to cause things like "six" to be available as pip.
 +-DEBUNDLED = False
 ++DEBUNDLED = True
 + 
 + # By default, look in this directory for a bunch of .whl files which we will
 + # add to the beginning of sys.path before attempting to import anything. This
 + # is done to support downstream re-distributors like Debian and Fedora who
 + # wish to create their own Wheels for our dependencies to aid in debundling.
 +-WHEEL_DIR = os.path.abspath(os.path.dirname(__file__))
 ++WHEEL_DIR = os.path.abspath(os.path.join(sys.prefix, 'share', 'python-wheels'))
 + 
 + 
 + # Define a small helper function to alias our vendored modules to the real ones
diff --cc debian/patches/handle-unbundled-requests.patch
index e2be9c4,0000000..4be7620
mode 100644,000000..100644
--- a/debian/patches/handle-unbundled-requests.patch
+++ b/debian/patches/handle-unbundled-requests.patch
@@@ -1,29 -1,0 +1,29 @@@
- From 144ba146cde273b815a80859537b09c068fd47e6 Mon Sep 17 00:00:00 2001
++From dba4d7413a1f01a2ac3987f3c18e2576b1e48925 Mon Sep 17 00:00:00 2001
 +From: Barry Warsaw <barry at python.org>
 +Date: Fri, 29 Jan 2016 16:56:43 -0500
 +Subject: Debian already unbundles things from requests.
 +
 +Patch-Name: handle-unbundled-requests.patch
 +---
 + pip/_vendor/__init__.py | 8 ++++++--
 + 1 file changed, 6 insertions(+), 2 deletions(-)
 +
 +diff --git a/pip/_vendor/__init__.py b/pip/_vendor/__init__.py
 +index 1cb35a1..c64896a 100644
 +--- a/pip/_vendor/__init__.py
 ++++ b/pip/_vendor/__init__.py
 +@@ -82,8 +82,12 @@ if DEBUNDLED:
 +     vendored("requests.packages.urllib3.fields")
 +     vendored("requests.packages.urllib3.filepost")
 +     vendored("requests.packages.urllib3.packages")
 +-    vendored("requests.packages.urllib3.packages.ordered_dict")
 +-    vendored("requests.packages.urllib3.packages.six")
 ++    try:
 ++        vendored("requests.packages.urllib3.packages.ordered_dict")
 ++        vendored("requests.packages.urllib3.packages.six")
 ++    except ImportError:
 ++        # Debian already unbundles these from requests.
 ++        pass
 +     vendored("requests.packages.urllib3.packages.ssl_match_hostname")
 +     vendored("requests.packages.urllib3.packages.ssl_match_hostname."
 +              "_implementation")
diff --cc debian/patches/hands-off-system-packages.patch
index 70c4962,0000000..51876b8
mode 100644,000000..100644
--- a/debian/patches/hands-off-system-packages.patch
+++ b/debian/patches/hands-off-system-packages.patch
@@@ -1,75 -1,0 +1,75 @@@
- From f740c160e0e133d889e674046bc249d08c22bb34 Mon Sep 17 00:00:00 2001
++From 11a461c84e7ffa61865bfa0c9270c02bab12e41c Mon Sep 17 00:00:00 2001
 +From: Geoffrey Thomas <geofft at ldpreload.com>
 +Date: Wed, 3 Dec 2014 11:18:11 -0600
 +Subject: Prevent pip from removing system packages.
 +
 +Adjust is_local() to consider OS-owned paths non-local.  Fix the error
 +message for is_local() in the non-virtualenv case.
 +
 +Author: Geoffrey Thomas <geofft at ldpreload.com>
 +Bug-Debian: http://bugs.debian.org/771794
 +Origin: https://github.com/geofft/pip.git
 +Forwarded: not-needed
 +Reviewed-By: Donald Stufft <donald at stufft.io>
 +Reviewed-By: Scott Kitterman <scott at kitterman.com>
 +Last-Update: 2014-12-04
 +
 +Patch-Name: hands-off-system-packages.patch
 +---
 + pip/utils/__init__.py | 36 +++++++++++++++++++++++++++---------
 + 1 file changed, 27 insertions(+), 9 deletions(-)
 +
 +diff --git a/pip/utils/__init__.py b/pip/utils/__init__.py
- index 4768ecb..7bf8de4 100644
++index 368d539..6489ea8 100644
 +--- a/pip/utils/__init__.py
 ++++ b/pip/utils/__init__.py
 +@@ -275,22 +275,40 @@ def renames(old, new):
 + 
 + def is_local(path):
 +     """
 +-    Return True if path is within sys.prefix, if we're running in a virtualenv.
 ++    Return True if this is a path pip is allowed to modify.
 + 
 +-    If we're not in a virtualenv, all paths are considered "local."
 ++    If we're in a virtualenv, sys.prefix points to the virtualenv's
 ++    prefix; only sys.prefix is considered local.
 ++
 ++    If we're not in a virtualenv, in general we can modify anything.
 ++    However, if the OS vendor has configured distutils to install
 ++    somewhere other than sys.prefix (which could be a subdirectory of
 ++    sys.prefix, e.g. /usr/local), we consider sys.prefix itself nonlocal
 ++    and the domain of the OS vendor. (In other words, everything _other
 ++    than_ sys.prefix is considered local.)
 + 
 +     """
 +-    if not running_under_virtualenv():
 +-        return True
 +-    return normalize_path(path).startswith(normalize_path(sys.prefix))
 ++
 ++    path = normalize_path(path)
 ++    prefix = normalize_path(sys.prefix)
 ++
 ++    if running_under_virtualenv():
 ++        return path.startswith(normalize_path(sys.prefix))
 ++    else:
 ++        from pip.locations import distutils_scheme
 ++        if path.startswith(prefix):
 ++            for local_path in distutils_scheme("").values():
 ++                if path.startswith(normalize_path(local_path)):
 ++                    return True
 ++            return False
 ++        else:
 ++            return True
 + 
 + 
 + def dist_is_local(dist):
 +     """
 +-    Return True if given Distribution object is installed locally
 +-    (i.e. within current virtualenv).
 +-
 +-    Always True if we're not in a virtualenv.
 ++    Return True if given Distribution object is installed somewhere pip
 ++    is allowed to modify.
 + 
 +     """
 +     return is_local(dist_location(dist))
diff --cc debian/patches/set_user_default.patch
index b716286,0000000..185183f
mode 100644,000000..100644
--- a/debian/patches/set_user_default.patch
+++ b/debian/patches/set_user_default.patch
@@@ -1,93 -1,0 +1,93 @@@
- From 005bc25c2d771153764cf29cca974f2ed9f98f7c Mon Sep 17 00:00:00 2001
++From d72211ae99990ba08eba3a5bf151f48e041679d5 Mon Sep 17 00:00:00 2001
 +From: Barry Warsaw <barry at python.org>
 +Date: Wed, 10 Feb 2016 11:18:37 -0500
 +Subject: Default to --user in non-virtual environments.
 +
 +When running as a normal user in a non-virtual environment, default to
 +--user and --ignore-installed.  When inside virtual environments or when
 +running as root, keep the default behavior.
 +
 +Author: Didier Roche <didrocks at ubuntu.com>,
 +        Barry Warsaw <barry at debian.org>
 +Bug: https://github.com/pypa/pip/issues/1668
 +Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=725848
 +Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/pip/+bug/1419695
 +
 +Patch-Name: set_user_default.patch
 +---
 + docs/user_guide.rst     |  6 ++++--
 + pip/commands/install.py | 20 +++++++++++++++++++-
 + 2 files changed, 23 insertions(+), 3 deletions(-)
 +
 +diff --git a/docs/user_guide.rst b/docs/user_guide.rst
 +index 90f941c..d3f7945 100644
 +--- a/docs/user_guide.rst
 ++++ b/docs/user_guide.rst
 +@@ -508,8 +508,10 @@ which means that all Python distributions support an alternative install
 + location that is specific to a user.  The default location for each OS is
 + explained in the python documentation for the `site.USER_BASE
 + <http://docs.python.org/library/site.html#site.USER_BASE>`_ variable.  This mode
 +-of installation can be turned on by specifying the :ref:`--user
 +-<install_--user>` option to ``pip install``.
 ++of installation is the default on Debian and derivative systems (--user has no
 ++effect) when inside non-virtual environments, and when the script is run as
 ++non-root. --ignore-installed is then used.  This behavior can be turned off by
 ++specifying the :ref:`--system <install_--system>` option to ``pip install``.
 + 
 + Moreover, the "user scheme" can be customized by setting the
 + ``PYTHONUSERBASE`` environment variable, which updates the value of ``site.USER_BASE``.
 +diff --git a/pip/commands/install.py b/pip/commands/install.py
 +index 7ddde93..13b328f 100644
 +--- a/pip/commands/install.py
 ++++ b/pip/commands/install.py
 +@@ -24,6 +24,7 @@ from pip.utils.deprecation import RemovedInPip10Warning
 + from pip.utils.filesystem import check_path_owner
 + from pip.wheel import WheelCache, WheelBuilder
 + 
 ++from pip.locations import running_under_virtualenv
 + 
 + logger = logging.getLogger(__name__)
 + 
 +@@ -54,6 +55,12 @@ class InstallCommand(RequirementCommand):
 +     def __init__(self, *args, **kw):
 +         super(InstallCommand, self).__init__(*args, **kw)
 + 
 ++        default_user = True
 ++        if running_under_virtualenv():
 ++            default_user = False
 ++        if os.geteuid() == 0:
 ++            default_user = False
 ++
 +         cmd_opts = self.cmd_opts
 + 
 +         cmd_opts.add_option(cmdoptions.constraints())
 +@@ -103,6 +110,7 @@ class InstallCommand(RequirementCommand):
 +             '-I', '--ignore-installed',
 +             dest='ignore_installed',
 +             action='store_true',
 ++            default=default_user,
 +             help='Ignore the installed packages (reinstalling instead).')
 + 
 +         cmd_opts.add_option(cmdoptions.no_deps())
 +@@ -114,10 +122,20 @@ class InstallCommand(RequirementCommand):
 +             '--user',
 +             dest='use_user_site',
 +             action='store_true',
 ++            default=default_user,
 +             help="Install to the Python user install directory for your "
 +                  "platform. Typically ~/.local/, or %APPDATA%\Python on "
 +                  "Windows. (See the Python documentation for site.USER_BASE "
 +-                 "for full details.)")
 ++                 "for full details.)  On Debian systems, this is the "
 ++                 "default when running outside of a virtual environment "
 ++                 "and not as root.")
 ++
 ++        cmd_opts.add_option(
 ++            '--system',
 ++            dest='use_user_site',
 ++            action='store_false',
 ++            help="Install using the system scheme (overrides --user on "
 ++                 "Debian systems)")
 + 
 +         cmd_opts.add_option(
 +             '--egg',

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/python-pip.git



More information about the Python-modules-commits mailing list