[Python-modules-commits] [python-pip] 09/10: merge patched into master

Barry Warsaw barry at moszumanska.debian.org
Mon Nov 28 22:47:12 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 233e0b4508d2752ae18bb1038419f4053e898e9d
Merge: 131cc86 03fda55
Author: Barry Warsaw <barry at python.org>
Date:   Mon Nov 28 13:47:02 2016 -0500

    merge patched into master

 AUTHORS.txt                                        |   41 +
 CHANGES.txt                                        |  145 +-
 PKG-INFO                                           |   10 +-
 README.rst                                         |    5 +-
 debian/.git-dpm                                    |    6 +-
 debian/patches/debundle.patch                      |    4 +-
 debian/patches/disable-pip-version-check.patch     |    6 +-
 debian/patches/handle-unbundled-requests.patch     |    6 +-
 debian/patches/hands-off-system-packages.patch     |    4 +-
 .../patches/html5lib-alternative-beta-name.patch   |   30 +-
 debian/patches/ignore-socks-warnings.patch         |   33 -
 debian/patches/series                              |    2 -
 debian/patches/set_user_default.patch              |   14 +-
 debian/patches/skip-bad-requirements.patch         |   49 -
 docs/conf.py                                       |    2 +-
 docs/development.rst                               |   32 +-
 docs/installing.rst                                |   14 +-
 docs/quickstart.rst                                |    9 +
 docs/reference/pip.rst                             |    2 +
 docs/reference/pip_download.rst                    |   91 +-
 docs/reference/pip_freeze.rst                      |   24 +-
 docs/reference/pip_install.rst                     |  112 +-
 docs/reference/pip_list.rst                        |   82 +-
 docs/reference/pip_search.rst                      |   10 +-
 docs/reference/pip_show.rst                        |   65 +-
 docs/reference/pip_uninstall.rst                   |    2 +-
 docs/reference/pip_wheel.rst                       |   10 +-
 docs/user_guide.rst                                |   18 +-
 pip.egg-info/PKG-INFO                              |   10 +-
 pip.egg-info/SOURCES.txt                           |   45 +-
 pip/__init__.py                                    |    8 +-
 pip/_vendor/README.rst                             |    4 +-
 pip/_vendor/__init__.py                            |    1 +
 pip/_vendor/appdirs.py                             |  552 ++++
 pip/_vendor/cachecontrol/__init__.py               |    2 +-
 pip/_vendor/cachecontrol/adapter.py                |   18 +-
 pip/_vendor/cachecontrol/controller.py             |    2 +-
 pip/_vendor/cachecontrol/filewrapper.py            |   33 +-
 pip/_vendor/cachecontrol/serialize.py              |    6 +
 pip/_vendor/distlib/__init__.py                    |    2 +-
 pip/_vendor/distlib/_backport/shutil.py            |    6 +-
 pip/_vendor/distlib/_backport/sysconfig.py         |    2 +-
 pip/_vendor/distlib/_backport/tarfile.py           |    2 +-
 pip/_vendor/distlib/compat.py                      |   17 +-
 pip/_vendor/distlib/database.py                    |    2 +-
 pip/_vendor/distlib/index.py                       |    8 +-
 pip/_vendor/distlib/locators.py                    |   41 +-
 pip/_vendor/distlib/manifest.py                    |   38 +-
 pip/_vendor/distlib/metadata.py                    |   14 +-
 pip/_vendor/distlib/resources.py                   |   11 +-
 pip/_vendor/distlib/scripts.py                     |    2 +-
 pip/_vendor/distlib/t32.exe                        |  Bin 89088 -> 89088 bytes
 pip/_vendor/distlib/t64.exe                        |  Bin 97792 -> 97792 bytes
 pip/_vendor/distlib/util.py                        |  268 +-
 pip/_vendor/distlib/version.py                     |    6 +-
 pip/_vendor/distlib/w32.exe                        |  Bin 85504 -> 85504 bytes
 pip/_vendor/distlib/w64.exe                        |  Bin 94208 -> 94208 bytes
 pip/_vendor/distro.py                              | 1081 +++++++
 pip/_vendor/html5lib/__init__.py                   |    2 +-
 pip/_vendor/html5lib/{ihatexml.py => _ihatexml.py} |   13 +-
 .../html5lib/{inputstream.py => _inputstream.py}   |  220 +-
 .../html5lib/{tokenizer.py => _tokenizer.py}       |   36 +-
 pip/_vendor/html5lib/{trie => _trie}/__init__.py   |    2 +
 pip/_vendor/html5lib/{trie => _trie}/_base.py      |    3 +-
 pip/_vendor/html5lib/{trie => _trie}/datrie.py     |    0
 pip/_vendor/html5lib/{trie => _trie}/py.py         |    0
 pip/_vendor/html5lib/{utils.py => _utils.py}       |   44 +-
 pip/_vendor/html5lib/constants.py                  |  303 +-
 .../html5lib/filters/alphabeticalattributes.py     |    6 +-
 pip/_vendor/html5lib/filters/{_base.py => base.py} |    0
 .../html5lib/filters/inject_meta_charset.py        |    8 +-
 pip/_vendor/html5lib/filters/lint.py               |  111 +-
 pip/_vendor/html5lib/filters/optionaltags.py       |   11 +-
 pip/_vendor/html5lib/filters/sanitizer.py          |  861 +++++-
 pip/_vendor/html5lib/filters/whitespace.py         |    6 +-
 pip/_vendor/html5lib/html5parser.py                |  555 ++--
 pip/_vendor/html5lib/sanitizer.py                  |  300 --
 .../htmlserializer.py => serializer.py}            |  179 +-
 pip/_vendor/html5lib/serializer/__init__.py        |   16 -
 pip/_vendor/html5lib/treeadapters/__init__.py      |   12 +
 pip/_vendor/html5lib/treeadapters/genshi.py        |   47 +
 pip/_vendor/html5lib/treebuilders/__init__.py      |    2 +-
 .../html5lib/treebuilders/{_base.py => base.py}    |   14 +-
 pip/_vendor/html5lib/treebuilders/dom.py           |   49 +-
 pip/_vendor/html5lib/treebuilders/etree.py         |   21 +-
 pip/_vendor/html5lib/treebuilders/etree_lxml.py    |   42 +-
 pip/_vendor/html5lib/treewalkers/__init__.py       |   50 +-
 .../html5lib/treewalkers/{_base.py => base.py}     |   88 +-
 pip/_vendor/html5lib/treewalkers/dom.py            |   16 +-
 pip/_vendor/html5lib/treewalkers/etree.py          |   21 +-
 .../treewalkers/{lxmletree.py => etree_lxml.py}    |   58 +-
 .../treewalkers/{genshistream.py => genshi.py}     |   12 +-
 pip/_vendor/html5lib/treewalkers/pulldom.py        |   63 -
 pip/_vendor/ipaddress.py                           |   32 +-
 pip/{compat => _vendor}/ordereddict.py             |    2 -
 pip/_vendor/packaging/__about__.py                 |    2 +-
 pip/_vendor/packaging/markers.py                   |   24 +-
 pip/_vendor/pkg_resources/__init__.py              |  344 ++-
 pip/_vendor/pyparsing.py                           | 3209 ++++++++++++++++----
 pip/_vendor/requests/__init__.py                   |   19 +-
 pip/_vendor/requests/adapters.py                   |   22 +-
 pip/_vendor/requests/api.py                        |    1 -
 pip/_vendor/requests/auth.py                       |   12 +-
 pip/_vendor/requests/certs.py                      |    4 +-
 pip/_vendor/requests/compat.py                     |   20 +-
 pip/_vendor/requests/cookies.py                    |  103 +-
 pip/_vendor/requests/exceptions.py                 |   18 +-
 pip/_vendor/requests/hooks.py                      |    2 +-
 pip/_vendor/requests/models.py                     |   54 +-
 pip/_vendor/requests/packages/urllib3/__init__.py  |    2 +-
 .../requests/packages/urllib3/connectionpool.py    |   37 +-
 .../requests/packages/urllib3/contrib/appengine.py |    2 +-
 .../requests/packages/urllib3/contrib/socks.py     |    2 +-
 .../requests/packages/urllib3/packages/six.py      |  635 +++-
 .../requests/packages/urllib3/poolmanager.py       |   93 +-
 pip/_vendor/requests/packages/urllib3/response.py  |    4 +
 .../requests/packages/urllib3/util/connection.py   |   47 +-
 .../requests/packages/urllib3/util/retry.py        |   14 +-
 pip/_vendor/requests/packages/urllib3/util/ssl_.py |    4 +-
 pip/_vendor/requests/sessions.py                   |   71 +-
 pip/_vendor/requests/status_codes.py               |    2 +-
 pip/_vendor/requests/structures.py                 |    7 +-
 pip/_vendor/requests/utils.py                      |  133 +-
 pip/_vendor/vendor.txt                             |   16 +-
 pip/_vendor/webencodings/__init__.py               |  342 +++
 pip/_vendor/webencodings/labels.py                 |  231 ++
 pip/_vendor/webencodings/mklabels.py               |   59 +
 pip/_vendor/webencodings/tests.py                  |  153 +
 pip/_vendor/webencodings/x_user_defined.py         |  325 ++
 pip/basecommand.py                                 |   10 +-
 pip/baseparser.py                                  |    3 +-
 pip/cmdoptions.py                                  |   25 +-
 pip/commands/__init__.py                           |    3 +
 pip/commands/check.py                              |   39 +
 pip/commands/completion.py                         |   16 +-
 pip/commands/download.py                           |   80 +-
 pip/commands/freeze.py                             |   11 +-
 pip/commands/install.py                            |  123 +-
 pip/commands/list.py                               |  226 +-
 pip/commands/search.py                             |   24 +-
 pip/commands/show.py                               |   76 +-
 pip/commands/wheel.py                              |    8 +-
 pip/compat/__init__.py                             |    4 +-
 pip/download.py                                    |   35 +-
 pip/exceptions.py                                  |    5 +
 pip/index.py                                       |   90 +-
 pip/locations.py                                   |    4 +-
 pip/operations/check.py                            |   49 +
 pip/operations/freeze.py                           |  112 +-
 pip/pep425tags.py                                  |   79 +-
 pip/req/req_file.py                                |    2 +-
 pip/req/req_install.py                             |  149 +-
 pip/req/req_set.py                                 |   80 +-
 pip/utils/__init__.py                              |   26 +-
 pip/utils/appdirs.py                               |   36 +-
 pip/utils/deprecation.py                           |    8 +-
 pip/utils/glibc.py                                 |   81 +
 pip/utils/packaging.py                             |   63 +
 pip/utils/setuptools_build.py                      |    6 +-
 pip/vcs/__init__.py                                |    9 +-
 pip/vcs/git.py                                     |   29 +-
 pip/vcs/subversion.py                              |   20 +
 pip/wheel.py                                       |   16 +-
 setup.py                                           |    1 +
 164 files changed, 10416 insertions(+), 3359 deletions(-)

diff --cc debian/.git-dpm
index dfa421f,0000000..ae533c3
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
- 0f249c6999e342e191c93323bdcb6252496e584b
- 0f249c6999e342e191c93323bdcb6252496e584b
- 030df74bb06ecef9a308cb8315a0c93f1f971cfb
++03fda551552d2f2b6f541ade5faabffda2f9b9cf
++03fda551552d2f2b6f541ade5faabffda2f9b9cf
++53621e66939b946103c9e560f6c78238a9c3ed2b
 +53621e66939b946103c9e560f6c78238a9c3ed2b
 +python-pip_9.0.1.orig.tar.gz
 +57ff41e99cb01b6a1c2b0999161589b726f0ec8b
 +1197370
 +debianTag="debian/%e%v"
 +patchedTag="patched/%e%v"
 +upstreamTag="upstream/%e%u"
diff --cc debian/patches/debundle.patch
index cb5c397,0000000..0c9c7f3
mode 100644,000000..100644
--- a/debian/patches/debundle.patch
+++ b/debian/patches/debundle.patch
@@@ -1,30 -1,0 +1,30 @@@
- From fd88a3d23538292914c72d0cb181e6418142e8b0 Mon Sep 17 00:00:00 2001
++From f74962daa477cdc7fd729185710ec9906f58f2ae 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
++index bee5f5e..7e9da3e 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/disable-pip-version-check.patch
index 8064002,0000000..b5f8c98
mode 100644,000000..100644
--- a/debian/patches/disable-pip-version-check.patch
+++ b/debian/patches/disable-pip-version-check.patch
@@@ -1,23 -1,0 +1,23 @@@
- From 278b3faec873b18333dba315ddbe97754d71c858 Mon Sep 17 00:00:00 2001
++From f9c06582c58e01deab10c6fcc081d4d7cb0f1507 Mon Sep 17 00:00:00 2001
 +From: Barry Warsaw <barry at python.org>
 +Date: Fri, 18 Nov 2016 17:07:47 -0500
 +Subject: Set --disable-pip-version-check=True by default.
 +
 +Patch-Name: disable-pip-version-check.patch
 +---
 + pip/cmdoptions.py | 2 +-
 + 1 file changed, 1 insertion(+), 1 deletion(-)
 +
 +diff --git a/pip/cmdoptions.py b/pip/cmdoptions.py
- index 1fade87..4ddb39b 100644
++index f71488c..f75c093 100644
 +--- a/pip/cmdoptions.py
 ++++ b/pip/cmdoptions.py
- @@ -510,7 +510,7 @@ disable_pip_version_check = partial(
++@@ -525,7 +525,7 @@ disable_pip_version_check = partial(
 +     "--disable-pip-version-check",
 +     dest="disable_pip_version_check",
 +     action="store_true",
 +-    default=False,
 ++    default=True,
 +     help="Don't periodically check PyPI to determine whether a new version "
 +          "of pip is available for download. Implied with --no-index.")
 + 
diff --cc debian/patches/handle-unbundled-requests.patch
index d0d7354,0000000..93c6e2d
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 78dc4c10e26a79b3b6f630a98113c9a2b1f26305 Mon Sep 17 00:00:00 2001
++From d0d585984310634ec865c0f96e68eb78e209d7ca 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
++index 7e9da3e..8e76ab8 100644
 +--- a/pip/_vendor/__init__.py
 ++++ b/pip/_vendor/__init__.py
- @@ -88,8 +88,12 @@ if DEBUNDLED:
++@@ -89,8 +89,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 da692f7,0000000..9269e07
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 f9a388d8bf916779ba19e4f5baac16c1051a881d Mon Sep 17 00:00:00 2001
++From 64446a63a0e31bad2f6927f2213710dfcc50b3ab 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
++index 815bd33..0d25d91 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/html5lib-alternative-beta-name.patch
index c959b2d,0000000..ef17c23
mode 100644,000000..100644
--- a/debian/patches/html5lib-alternative-beta-name.patch
+++ b/debian/patches/html5lib-alternative-beta-name.patch
@@@ -1,37 -1,0 +1,25 @@@
- From 0f249c6999e342e191c93323bdcb6252496e584b Mon Sep 17 00:00:00 2001
++From 03fda551552d2f2b6f541ade5faabffda2f9b9cf Mon Sep 17 00:00:00 2001
 +From: Barry Warsaw <barry at python.org>
 +Date: Mon, 21 Nov 2016 13:27:41 -0500
 +Subject: Use alternative html5lib beta version number.
 +
 +This matches what's in the Debian archive.
 +
 +Patch-Name: html5lib-alternative-beta-name.patch
 +---
 + pip/_vendor/vendor.txt | 2 +-
-  pip/index.py           | 2 +-
-  2 files changed, 2 insertions(+), 2 deletions(-)
++ 1 file changed, 1 insertion(+), 1 deletion(-)
 +
 +diff --git a/pip/_vendor/vendor.txt b/pip/_vendor/vendor.txt
- index c2917c2..0871ef6 100644
++index 6d07f2d..8f878ba 100644
 +--- a/pip/_vendor/vendor.txt
 ++++ b/pip/_vendor/vendor.txt
- @@ -1,5 +1,5 @@
-  distlib==0.2.3
- -html5lib==1.0b8
++@@ -1,7 +1,7 @@
++ appdirs==1.4.0
++ distlib==0.2.4
++ distro==1.0.1
++-html5lib==1.0b10
 ++html5lib==0.999999999-1
 + six==1.10.0
 + colorama==0.3.7
-  requests==2.10.0
- diff --git a/pip/index.py b/pip/index.py
- index cae4c2d..5dfed36 100644
- --- a/pip/index.py
- +++ b/pip/index.py
- @@ -692,7 +692,7 @@ class HTMLPage(object):
-          self.content = content
-          self.parsed = html5lib.parse(
-              self.content,
- -            encoding=encoding,
- +            likely_encoding=encoding,
-              namespaceHTMLElements=False,
-          )
-          self.url = url
++ requests==2.11.1
diff --cc debian/patches/series
index 626ed90,0000000..61a0252
mode 100644,000000..100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@@ -1,8 -1,0 +1,6 @@@
 +hands-off-system-packages.patch
 +debundle.patch
 +handle-unbundled-requests.patch
 +set_user_default.patch
- skip-bad-requirements.patch
- ignore-socks-warnings.patch
 +disable-pip-version-check.patch
 +html5lib-alternative-beta-name.patch
diff --cc debian/patches/set_user_default.patch
index 19a52e2,0000000..f57557f
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 8fe149e53336bea3e78371e124e22526ddf85025 Mon Sep 17 00:00:00 2001
++From f392f69c8f813779b3ad3a384f57dc1f805890ef 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
++index 7d7fb86..83d6a7c 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
++@@ -513,8 +513,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
++index 227c526..39292b1 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):
++@@ -116,6 +123,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):
++         cmd_opts.add_option(cmdoptions.ignore_requires_python())
++@@ -128,10 +136,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