[Python-modules-commits] [python-pip] 07/08: merge patched into master
Barry Warsaw
barry at moszumanska.debian.org
Thu Mar 17 14:29:31 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 c659c64d4cc98fa0768a6c4cb800670b1a2e1a60
Merge: a47ed99 6b0f803
Author: Barry Warsaw <barry at python.org>
Date: Thu Mar 17 10:25:12 2016 -0400
merge patched into master
AUTHORS.txt | 2 ++
CHANGES.txt | 6 ++++++
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 | 2 +-
debian/patches/set_user_default.patch | 2 +-
docs/installing.rst | 2 +-
pip.egg-info/PKG-INFO | 2 +-
pip/__init__.py | 6 +++++-
pip/cmdoptions.py | 2 +-
pip/utils/encoding.py | 8 ++++++++
setup.cfg | 4 ++--
14 files changed, 34 insertions(+), 14 deletions(-)
diff --cc debian/.git-dpm
index a720d60,0000000..bb5ff73
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
- e7382206b65f652d101ca0c2eaca26c301bcb1db
- e7382206b65f652d101ca0c2eaca26c301bcb1db
- 97afa06ae7302f419beab22476d7c77d021649d1
++6b0f8037cf4494fd026067414dd79e617e890bba
++6b0f8037cf4494fd026067414dd79e617e890bba
++cb678960292d0979061d7c0f180510fa688a6528
+cb678960292d0979061d7c0f180510fa688a6528
+python-pip_8.1.1.orig.tar.gz
+6c6076664a51ac14849696df65ace8d44e42dea7
+1139175
+debianTag="debian/%e%v"
+patchedTag="patched/%e%v"
+upstreamTag="upstream/%e%u"
diff --cc debian/patches/debundle.patch
index d1d00eb,0000000..79e0345
mode 100644,000000..100644
--- a/debian/patches/debundle.patch
+++ b/debian/patches/debundle.patch
@@@ -1,30 -1,0 +1,30 @@@
- From 66b84750a89f8af441a48adb778c600ccdd2ad7b Mon Sep 17 00:00:00 2001
++From d563f7fdabb276a1bed40f482aa6531d16992b81 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 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 4448ec7,0000000..bfcf60b
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 771121a9683618c434d9308ba3d322e2e38bd864 Mon Sep 17 00:00:00 2001
++From b3fac5d6aa3fa956145ed4c9cb62fd960195c994 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 9811a3c..a822a5b 100644
+--- a/pip/_vendor/__init__.py
++++ b/pip/_vendor/__init__.py
+@@ -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 ee2a722,0000000..3541e04
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 65f51c36d56b4881228058c763a38cce6fcbc6bd Mon Sep 17 00:00:00 2001
++From df99b1ffafcfa0c5120926dfc554a74ae391cb76 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 b5d01cd..8ea2e38 100644
+--- a/pip/utils/__init__.py
++++ b/pip/utils/__init__.py
+@@ -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 b43c1d6,0000000..52ba38f
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 e7382206b65f652d101ca0c2eaca26c301bcb1db Mon Sep 17 00:00:00 2001
++From 6b0f8037cf4494fd026067414dd79e617e890bba 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 6bffdc2..c31f2a7 100644
+--- a/docs/user_guide.rst
++++ b/docs/user_guide.rst
+@@ -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