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

Barry Warsaw barry at moszumanska.debian.org
Mon Mar 7 16:25:55 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 7f4112ffdfc976e8241dfb389fd21d66b59e2020
Merge: 43a85fa e738220
Author: Barry Warsaw <barry at python.org>
Date:   Mon Mar 7 11:14:38 2016 -0500

    merge patched into master

 AUTHORS.txt                                    |  25 ++
 CHANGES.txt                                    |  53 +++-
 MANIFEST.in                                    |   1 +
 PKG-INFO                                       |   6 +-
 README.rst                                     |   4 +-
 debian/.git-dpm                                |   6 +-
 debian/patches/debundle.patch                  |   4 +-
 debian/patches/handle-unbundled-requests.patch |   6 +-
 debian/patches/hands-off-system-packages.patch |   6 +-
 debian/patches/set_user_default.patch          |   6 +-
 docs/installing.rst                            |   2 +-
 docs/reference/pip_install.rst                 |  14 +-
 docs/user_guide.rst                            |  13 +-
 pip.egg-info/PKG-INFO                          |   6 +-
 pip.egg-info/SOURCES.txt                       |   4 +
 pip/__init__.py                                |   2 +-
 pip/_vendor/__init__.py                        |  30 ++-
 pip/_vendor/packaging/__about__.py             |   2 +-
 pip/_vendor/packaging/requirements.py          | 129 ++++++++++
 pip/_vendor/packaging/specifiers.py            |  32 ++-
 pip/_vendor/packaging/utils.py                 |  14 +
 pip/_vendor/pyparsing.py                       | 342 ++++++++++++++-----------
 pip/_vendor/vendor.txt                         |   4 +-
 pip/commands/__init__.py                       |   6 +-
 pip/commands/completion.py                     |   3 +-
 pip/commands/freeze.py                         |  17 +-
 pip/commands/search.py                         |  11 +-
 pip/commands/show.py                           |  23 ++
 pip/compat/__init__.py                         |  12 +-
 pip/compat/ordereddict.py                      | 129 ++++++++++
 pip/download.py                                |  21 +-
 pip/exceptions.py                              |  17 +-
 pip/index.py                                   |  19 +-
 pip/operations/freeze.py                       |  20 +-
 pip/pep425tags.py                              | 158 ++++++++++--
 pip/req/req_file.py                            |   4 +
 pip/req/req_install.py                         | 106 +++-----
 pip/req/req_set.py                             |   3 +-
 pip/utils/__init__.py                          |  13 +-
 pip/utils/encoding.py                          |  23 ++
 pip/vcs/git.py                                 |   7 +-
 pip/wheel.py                                   |   7 +-
 setup.cfg                                      |   2 +-
 43 files changed, 940 insertions(+), 372 deletions(-)

diff --cc debian/.git-dpm
index 8255754,0000000..52b1cdc
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
- d72211ae99990ba08eba3a5bf151f48e041679d5
- d72211ae99990ba08eba3a5bf151f48e041679d5
- cf2f0c79999bcec7ace285b22565952637cebbd5
++e7382206b65f652d101ca0c2eaca26c301bcb1db
++e7382206b65f652d101ca0c2eaca26c301bcb1db
++97afa06ae7302f419beab22476d7c77d021649d1
 +97afa06ae7302f419beab22476d7c77d021649d1
 +python-pip_8.1.0.orig.tar.gz
 +9f52c9f9d6da954e4d7e623ff7bc6d54a3c18f62
 +1138794
 +debianTag="debian/%e%v"
 +patchedTag="patched/%e%v"
 +upstreamTag="upstream/%e%u"
diff --cc debian/patches/debundle.patch
index c8acce9,0000000..d1d00eb
mode 100644,000000..100644
--- a/debian/patches/debundle.patch
+++ b/debian/patches/debundle.patch
@@@ -1,30 -1,0 +1,30 @@@
- From 35065c84b9c21c09cc3edf075603663fc5eaf15c Mon Sep 17 00:00:00 2001
++From 66b84750a89f8af441a48adb778c600ccdd2ad7b 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
++index d0e7b34..9811a3c 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 4be7620,0000000..4448ec7
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 dba4d7413a1f01a2ac3987f3c18e2576b1e48925 Mon Sep 17 00:00:00 2001
++From 771121a9683618c434d9308ba3d322e2e38bd864 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
++index 9811a3c..a822a5b 100644
 +--- a/pip/_vendor/__init__.py
 ++++ b/pip/_vendor/__init__.py
- @@ -82,8 +82,12 @@ if DEBUNDLED:
++@@ -88,8 +88,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 51876b8,0000000..ee2a722
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 11a461c84e7ffa61865bfa0c9270c02bab12e41c Mon Sep 17 00:00:00 2001
++From 65f51c36d56b4881228058c763a38cce6fcbc6bd 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 368d539..6489ea8 100644
++index b5d01cd..8ea2e38 100644
 +--- a/pip/utils/__init__.py
 ++++ b/pip/utils/__init__.py
- @@ -275,22 +275,40 @@ def renames(old, new):
++@@ -276,22 +276,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 185183f,0000000..b43c1d6
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 d72211ae99990ba08eba3a5bf151f48e041679d5 Mon Sep 17 00:00:00 2001
++From e7382206b65f652d101ca0c2eaca26c301bcb1db 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
++index 6bffdc2..c31f2a7 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
++@@ -509,8 +509,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