...
 
Commits (17)
# see git-dpm(1) from git-dpm package
6cddedaac287e8d517b64d3858de71a405625afb
6cddedaac287e8d517b64d3858de71a405625afb
eb72925c46a091b609d1ecfbe305d262398a76c3
eb72925c46a091b609d1ecfbe305d262398a76c3
python-pip_1.5.6.orig.tar.gz
e6cd9e6f2fd8d28c9976313632ef8aa8ac31249e
938120
debianTag="debian/%e%v"
patchedTag="patched/%e%v"
upstreamTag="upstream/%e%u"
python-pip (1.5.6-7) unstable; urgency=medium
* d/patches/pep-440-arbitrary-equality-operator.patch: Don't fail an
assertion test when confronted with PEP 440 style arbitrary equality
operators. This patch will not be necessary after upgrading to
upstream pip >= 6.
-- Barry Warsaw <barry@debian.org> Tue, 18 Aug 2015 11:39:54 -0400
python-pip (1.5.6-6) unstable; urgency=medium
[ Felix C. Stegerman ]
* d/patches/0006-bug-785787.patch: Allow pip 1.5.6 to handle the PEP 440
"epoch" field. (Closes: #785787)
[ Barry Warsaw ]
* d/control:
- Update Vcs-* header for conversion to git-dpm.
- Add myself to Uploaders.
* d/watch: Update to pypi.debian.net redirector.
* wrap-and-sort
-- Barry Warsaw <barry@debian.org> Wed, 27 May 2015 10:11:32 -0400
python-pip (1.5.6-5) unstable; urgency=medium
* Team upload.
......
......@@ -2,7 +2,9 @@ Source: python-pip
Section: python
Priority: optional
Maintainer: Debian Python Modules Team <python-modules-team@lists.alioth.debian.org>
Uploaders: Carl Chenet <chaica@debian.org>, Jeff Licquia <licquia@debian.org>
Uploaders: Barry Warsaw <barry@debian.org>,
Carl Chenet <chaica@debian.org>,
Jeff Licquia <licquia@debian.org>
Homepage: http://www.pip-installer.org/
Build-Depends: debhelper (>= 8),
dh-python,
......@@ -22,8 +24,8 @@ Build-Depends: debhelper (>= 8),
Standards-Version: 3.9.6
X-Python-Version: >= 2.6
X-Python3-Version: >= 3.2
Vcs-Svn: svn://anonscm.debian.org/python-modules/packages/python-pip/trunk/
Vcs-Browser: http://anonscm.debian.org/viewvc/python-modules/packages/python-pip/trunk/
Vcs-Git: git://anonscm.debian.org/python-modules/packages/python-pip.git
Vcs-Browser: http://anonscm.debian.org/cgit/python-modules/packages/python-pip.git
Package: python-pip
Architecture: all
......
Description: We need to add all the recursively devendorized dependent wheels
From c5ad34d50e168db413ea1fdf67c5ab5b726eccb6 Mon Sep 17 00:00:00 2001
From: Barry Warsaw <barry@debian.org>
Date: Tue, 26 May 2015 15:53:34 -0400
Subject: We need to add all the recursively devendorized dependent wheels
to sys.path so that they can be imported. These wheel files live in
different places depending on whether we're inside or outside a virtual
environment.
Author: Barry Warsaw <barry@debian.org>
Forwarded: not-needed
---
pip/__init__.py | 63 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
setup.py | 8 +++++++-
2 files changed, 70 insertions(+), 1 deletion(-)
diff --git a/pip/__init__.py b/pip/__init__.py
index bb4a588..eba984e 100755
--- a/pip/__init__.py
+++ b/pip/__init__.py
@@ -4,6 +4,69 @@
@@ -4,6 +4,69 @@ import optparse
import sys
import re
......@@ -77,9 +86,11 @@ Forwarded: not-needed
from pip.exceptions import InstallationError, CommandError, PipError
from pip.log import logger
diff --git a/setup.py b/setup.py
index 56439f5..422fb9e 100644
--- a/setup.py
+++ b/setup.py
@@ -41,7 +41,13 @@
@@ -41,7 +41,13 @@ def find_version(*file_paths):
long_description = "\n" + "\n".join([read('PROJECT.txt'),
read('docs', 'quickstart.rst')])
......
Description: Provide a better, Debian-specific error message when someone
From df03ef5928ed78a83c441dc4a295111fe4ca9837 Mon Sep 17 00:00:00 2001
From: Barry Warsaw <barry@debian.org>
Date: Tue, 26 May 2015 15:53:35 -0400
Subject: Provide a better, Debian-specific error message when someone
tries to run the `pip wheel` command before installing the necessary package.
Author: Barry Warsaw <barry@debian.org>
Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=733286
Forwarded: not-needed
---
pip/commands/wheel.py | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/pip/commands/wheel.py b/pip/commands/wheel.py
index 6527063..08f3e18 100644
--- a/pip/commands/wheel.py
+++ b/pip/commands/wheel.py
@@ -88,7 +88,11 @@
@@ -88,7 +88,11 @@ class WheelCommand(Command):
try:
import wheel.bdist_wheel
except ImportError:
......
Description: Use randomized install directory
From f3c77da1a63683b531963d10b57f4702a8b99dee Mon Sep 17 00:00:00 2001
From: Donald Stufft <donald@stufft.io>
Date: Tue, 26 May 2015 15:53:36 -0400
Subject: Use randomized install directory
python-pip (1.5.6-4) UNRELEASED; urgency=medium
.
* Team upload.
* Backport upstream fix to use non-predictable download directories
- Fixes denial of service vector (CVE-2014-8991) (Closes: #725847)
- Fixes retry failures (Closes: #769930)
Author: Donald Stufft <donald@stufft.io>
Bug-Debian: http://bugs.debian.org/725847
Bug-Debian: http://bugs.debian.org/769930
Origin: https://github.com/pypa/pip/pull/2122
Forwarded: not-needed
Reviewed-By: Scott Kitterman <scott@kitterman.com>
Last-Update: 2014-12-03
---
pip/cmdoptions.py | 8 +--
pip/commands/install.py | 142 ++++++++++++++++++++++++++----------------------
pip/commands/wheel.py | 116 ++++++++++++++++++++-------------------
pip/util.py | 33 +++++++++++
4 files changed, 173 insertions(+), 126 deletions(-)
--- python-pip-1.5.6.orig/pip/cmdoptions.py
+++ python-pip-1.5.6/pip/cmdoptions.py
@@ -9,7 +9,7 @@ To be consistent, all options will follo
diff --git a/pip/cmdoptions.py b/pip/cmdoptions.py
index 8ed3d91..01b2104 100644
--- a/pip/cmdoptions.py
+++ b/pip/cmdoptions.py
@@ -9,7 +9,7 @@ To be consistent, all options will follow this design.
"""
import copy
from optparse import OptionGroup, SUPPRESS_HELP, Option
......@@ -37,8 +48,10 @@ Last-Update: 2014-12-03
install_options = OptionMaker(
'--install-option',
--- python-pip-1.5.6.orig/pip/commands/install.py
+++ python-pip-1.5.6/pip/commands/install.py
diff --git a/pip/commands/install.py b/pip/commands/install.py
index cbf22a0..cb7d0db 100644
--- a/pip/commands/install.py
+++ b/pip/commands/install.py
@@ -10,6 +10,7 @@ from pip.basecommand import Command
from pip.index import PackageFinder
from pip.exceptions import InstallationError, CommandError, PreviousBuildDirError
......@@ -209,8 +222,10 @@ Last-Update: 2014-12-03
if options.target_dir:
if not os.path.exists(options.target_dir):
--- python-pip-1.5.6.orig/pip/commands/wheel.py
+++ python-pip-1.5.6/pip/commands/wheel.py
diff --git a/pip/commands/wheel.py b/pip/commands/wheel.py
index 08f3e18..c1c6e50 100644
--- a/pip/commands/wheel.py
+++ b/pip/commands/wheel.py
@@ -8,7 +8,7 @@ from pip.index import PackageFinder
from pip.log import logger
from pip.exceptions import CommandError, PreviousBuildDirError
......@@ -346,8 +361,10 @@ Last-Update: 2014-12-03
+ finally:
+ if not options.no_clean:
+ requirement_set.cleanup_files()
--- python-pip-1.5.6.orig/pip/util.py
+++ python-pip-1.5.6/pip/util.py
diff --git a/pip/util.py b/pip/util.py
index bffc355..d8a5602 100644
--- a/pip/util.py
+++ b/pip/util.py
@@ -8,6 +8,7 @@ import zipfile
import tarfile
import subprocess
......
Description: Prevent pip from removing system installed packages
From 8003cce736bd068cb4f9ad891f0490f611c01bda Mon Sep 17 00:00:00 2001
From 38b3bc4b72355107051c716addb800f4ce664475 Mon Sep 17 00:00:00 2001
From: Geoffrey Thomas <geofft@ldpreload.com>
Date: Wed, 3 Dec 2014 11:18:11 -0600
Subject: [PATCH 1/2] Adjust is_local to consider OS-owned paths nonlocal.
Subject: =?UTF-8?q?Prevent=20pip=20from=20removing=20system=20installed=20?=
=?UTF-8?q?packages=0AAdjust=20is=5Flocal=20to=20consider=20OS-owned=20pat?=
=?UTF-8?q?hs=20nonlocal.=0AFix=20error=20message=20for=20is=5Flocal=20in?=
=?UTF-8?q?=20the=20non-virtualenv=20case?=
.
See Debian #771794 for the motivation.
From a2ec6cbdb6bcc23aeb39c0dc04741c8745b0ddc7 Mon Sep 17 00:00:00 2001
From: Geoffrey Thomas <geofft@ldpreload.com>
Date: Wed, 3 Dec 2014 13:38:58 -0600
Subject: [PATCH 2/2] Fix error message for is_local in the non-virtualenv case
.
While not committed upstream, the patch author has submitted it and it is
being reviewed. Upstream did provide positive feedback for inclusion in
......@@ -20,10 +20,16 @@ Forwarded: not-needed
Reviewed-By: Donald Stufft <donald@stufft.io>
Reviewed-By: Scott Kitterman <scott@kitterman.com>
Last-Update: 2014-12-04
---
pip/req.py | 13 +++++++++++--
pip/util.py | 38 ++++++++++++++++++++++++++++----------
2 files changed, 39 insertions(+), 12 deletions(-)
--- python-pip-1.5.6.orig/pip/req.py
+++ python-pip-1.5.6/pip/req.py
@@ -17,6 +17,7 @@ from pip.exceptions import (Installation
diff --git a/pip/req.py b/pip/req.py
index 5422121..3b72a16 100644
--- a/pip/req.py
+++ b/pip/req.py
@@ -17,6 +17,7 @@ from pip.exceptions import (InstallationError, UninstallationError, UnsupportedW
DistributionNotFound, PreviousBuildDirError)
from pip.vcs import vcs
from pip.log import logger
......@@ -50,8 +56,10 @@ Last-Update: 2014-12-04
return False
return True
--- python-pip-1.5.6.orig/pip/util.py
+++ python-pip-1.5.6/pip/util.py
diff --git a/pip/util.py b/pip/util.py
index d8a5602..7deb87b 100644
--- a/pip/util.py
+++ b/pip/util.py
@@ -13,7 +13,8 @@ import tempfile
from pip.exceptions import InstallationError, BadCommand, PipError
from pip.backwardcompat import(WindowsError, string_types, raw_input,
......
From b42fc879de7be5e3a89a165f23fd0d43bfa5f2a2 Mon Sep 17 00:00:00 2001
From: Barry Warsaw <barry@python.org>
Date: Tue, 26 May 2015 15:55:08 -0400
Subject: bug-785787
Allow pip 1.5.6 to handle PEP 440 epoch fields.
---
pip/util.py | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/pip/util.py b/pip/util.py
index 7deb87b..968e28f 100644
--- a/pip/util.py
+++ b/pip/util.py
@@ -735,7 +735,10 @@ def is_prerelease(vers):
# Cannot normalize, assume it is a pre-release
return True
- parsed = version._normalized_key(normalized)
+ if version._normalized_key.__name__ == "_pep_440_key":
+ parsed = version._normalized_key(normalized)[1:]
+ else:
+ parsed = version._normalized_key(normalized)
return any([any([y in set(["a", "b", "c", "rc", "dev"]) for y in x]) for x in parsed])
Description: Don't install Python minor version specific endpoints
Forwarded: https://github.com/pypa/pip/pull/976
Bug-Upstream: https://github.com/pypa/pip/issues/943
Author: Stefano Rivera <stefanor@debian.org>
--- a/setup.py
+++ b/setup.py
@@ -50,7 +50,7 @@
url='http://www.pip-installer.org',
license='MIT',
packages=find_packages(exclude=["contrib", "docs", "tests*"]),
- entry_points=dict(console_scripts=['pip=pip:main', 'pip-%s=pip:main' % sys.version[:3]]),
+ entry_points=dict(console_scripts=['pip=pip:main', 'pip%i=pip:main' % sys.version_info[0]]),
test_suite='nose.collector',
tests_require=tests_require,
zip_safe=False,
From 6cddedaac287e8d517b64d3858de71a405625afb Mon Sep 17 00:00:00 2001
From: Barry Warsaw <barry@debian.org>
Date: Tue, 18 Aug 2015 11:05:51 -0400
Subject: =?UTF-8?q?When=20calling=20`pip=20list`=20where=20some=20system?=
=?UTF-8?q?=20packages=20are=20installed=20with=20non-PEP=0A440=20complian?=
=?UTF-8?q?t=20version=20numbers,=20this=20assertion=20gets=20tripped.=20?=
=?UTF-8?q?=20E.g.=20python-apt's=0A1.0.0~beta3.1ubuntu1.=20=20In=20those?=
=?UTF-8?q?=20cases,=20the=20package's=20requirements=20use=20the=20PEP=0A?=
=?UTF-8?q?440=20'=3D=3D=3D'=20arbitrary=20equality=20operator,=20which=20?=
=?UTF-8?q?isn't=20supported=20in=20pip=201.5.6.=0AThis=20allows=20the=20a?=
=?UTF-8?q?ssertion=20to=20pass=20in=20those=20cases,=20without=20any=20kn?=
=?UTF-8?q?own=20side=0Aeffects.=20=20Thanks=20to=20upstream=20developer?=
=?UTF-8?q?=20Donald=20Stufft=20for=20assistance.?=
Patch-Name: pep-440-arbitrary-equality-operator.patch
Forwarded: not-needed
---
pip/__init__.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pip/__init__.py b/pip/__init__.py
index eba984e..1c6deb3 100755
--- a/pip/__init__.py
+++ b/pip/__init__.py
@@ -296,7 +296,7 @@ class FrozenRequirement(object):
editable = False
req = dist.as_requirement()
specs = req.specs
- assert len(specs) == 1 and specs[0][0] == '=='
+ assert len(specs) == 1 and specs[0][0] in ('==', '==='), specs
version = specs[0][1]
ver_match = cls._rev_re.search(version)
date_match = cls._date_re.search(version)
de-vendorize.patch
use-wheels.patch
better-error-message.patch
random-install-dir.patch
no-touch-system-files.patch
0001-Use-Debian-packages-instead-of-vendorized-versions.patch
0002-We-need-to-add-all-the-recursively-devendorized-depe.patch
0003-Provide-a-better-Debian-specific-error-message-when-.patch
0004-Use-randomized-install-directory.patch
0005-Prevent-pip-from-removing-system-installed-packages.patch
0006-bug-785787.patch
pep-440-arbitrary-equality-operator.patch
Description: Get CA certificates from the Debian ca-certificates package
Forwarded: not-needed
Author: Stefano Rivera <stefanor@debian.org>
--- a/pip/locations.py
+++ b/pip/locations.py
@@ -9,7 +9,7 @@
from pip.backwardcompat import get_python_lib
import pip.exceptions
-default_cert_path = os.path.join(os.path.dirname(__file__), 'cacert.pem')
+default_cert_path = '/etc/ssl/certs/ca-certificates.crt'
DELETE_MARKER_MESSAGE = '''\
This file is placed here by pip to indicate the source was put
--- a/setup.py
+++ b/setup.py
@@ -50,7 +50,6 @@
url='http://www.pip-installer.org',
license='MIT',
packages=find_packages(exclude=["contrib", "docs", "tests*"]),
- package_data={'pip': ['*.pem']},
entry_points=dict(console_scripts=['pip=pip:main', 'pip-%s=pip:main' % sys.version[:3]]),
test_suite='nose.collector',
tests_require=tests_require,
--- a/pip/download.py
+++ b/pip/download.py
@@ -128,6 +128,11 @@
# get alternate bundle or use our included bundle
cert_path = os.environ.get('PIP_CERT', '') or default_cert_path
+ if (cert_path == default_cert_path
+ and not os.path.exists(default_cert_path)):
+ logger.fatal('No CA bundle available. '
+ 'Install the Debian "ca-certificates" package to '
+ 'allow pip to use https.')
self.sock = ssl.wrap_socket(sock,
self.key_file,
usr/share/python-wheels
debian/pip.dependencies usr/share/python-wheels
usr/share/python-wheels
version=3
https://pypi.python.org/packages/source/p/pip/ pip-(.*)\.tar\.gz
opts=uversionmangle=s/(rc|a|b|c)/~$1/ \
http://pypi.debian.net/Mypackage/Mypackage-(.+)\.(?:zip|tgz|tbz|txz|(?:tar\.(?:gz|bz2|xz)))
......@@ -49,156 +49,6 @@ pip.egg-info/entry_points.txt
pip.egg-info/not-zip-safe
pip.egg-info/requires.txt
pip.egg-info/top_level.txt
pip/_vendor/__init__.py
pip/_vendor/pkg_resources.py
pip/_vendor/re-vendor.py
pip/_vendor/six.py
pip/_vendor/_markerlib/__init__.py
pip/_vendor/_markerlib/markers.py
pip/_vendor/colorama/__init__.py
pip/_vendor/colorama/ansi.py
pip/_vendor/colorama/ansitowin32.py
pip/_vendor/colorama/initialise.py
pip/_vendor/colorama/win32.py
pip/_vendor/colorama/winterm.py
pip/_vendor/distlib/__init__.py
pip/_vendor/distlib/compat.py
pip/_vendor/distlib/database.py
pip/_vendor/distlib/index.py
pip/_vendor/distlib/locators.py
pip/_vendor/distlib/manifest.py
pip/_vendor/distlib/markers.py
pip/_vendor/distlib/metadata.py
pip/_vendor/distlib/resources.py
pip/_vendor/distlib/scripts.py
pip/_vendor/distlib/t32.exe
pip/_vendor/distlib/t64.exe
pip/_vendor/distlib/util.py
pip/_vendor/distlib/version.py
pip/_vendor/distlib/w32.exe
pip/_vendor/distlib/w64.exe
pip/_vendor/distlib/wheel.py
pip/_vendor/distlib/_backport/__init__.py
pip/_vendor/distlib/_backport/misc.py
pip/_vendor/distlib/_backport/shutil.py
pip/_vendor/distlib/_backport/sysconfig.cfg
pip/_vendor/distlib/_backport/sysconfig.py
pip/_vendor/distlib/_backport/tarfile.py
pip/_vendor/html5lib/__init__.py
pip/_vendor/html5lib/constants.py
pip/_vendor/html5lib/html5parser.py
pip/_vendor/html5lib/ihatexml.py
pip/_vendor/html5lib/inputstream.py
pip/_vendor/html5lib/sanitizer.py
pip/_vendor/html5lib/tokenizer.py
pip/_vendor/html5lib/utils.py
pip/_vendor/html5lib/filters/__init__.py
pip/_vendor/html5lib/filters/_base.py
pip/_vendor/html5lib/filters/alphabeticalattributes.py
pip/_vendor/html5lib/filters/inject_meta_charset.py
pip/_vendor/html5lib/filters/lint.py
pip/_vendor/html5lib/filters/optionaltags.py
pip/_vendor/html5lib/filters/sanitizer.py
pip/_vendor/html5lib/filters/whitespace.py
pip/_vendor/html5lib/serializer/__init__.py
pip/_vendor/html5lib/serializer/htmlserializer.py
pip/_vendor/html5lib/treeadapters/__init__.py
pip/_vendor/html5lib/treeadapters/sax.py
pip/_vendor/html5lib/treebuilders/__init__.py
pip/_vendor/html5lib/treebuilders/_base.py
pip/_vendor/html5lib/treebuilders/dom.py
pip/_vendor/html5lib/treebuilders/etree.py
pip/_vendor/html5lib/treebuilders/etree_lxml.py
pip/_vendor/html5lib/treewalkers/__init__.py
pip/_vendor/html5lib/treewalkers/_base.py
pip/_vendor/html5lib/treewalkers/dom.py
pip/_vendor/html5lib/treewalkers/etree.py
pip/_vendor/html5lib/treewalkers/genshistream.py
pip/_vendor/html5lib/treewalkers/lxmletree.py
pip/_vendor/html5lib/treewalkers/pulldom.py
pip/_vendor/html5lib/trie/__init__.py
pip/_vendor/html5lib/trie/_base.py
pip/_vendor/html5lib/trie/datrie.py
pip/_vendor/html5lib/trie/py.py
pip/_vendor/requests/__init__.py
pip/_vendor/requests/adapters.py
pip/_vendor/requests/api.py
pip/_vendor/requests/auth.py
pip/_vendor/requests/cacert.pem
pip/_vendor/requests/certs.py
pip/_vendor/requests/compat.py
pip/_vendor/requests/cookies.py
pip/_vendor/requests/exceptions.py
pip/_vendor/requests/hooks.py
pip/_vendor/requests/models.py
pip/_vendor/requests/sessions.py
pip/_vendor/requests/status_codes.py
pip/_vendor/requests/structures.py
pip/_vendor/requests/utils.py
pip/_vendor/requests/packages/__init__.py
pip/_vendor/requests/packages/chardet/__init__.py
pip/_vendor/requests/packages/chardet/big5freq.py
pip/_vendor/requests/packages/chardet/big5prober.py
pip/_vendor/requests/packages/chardet/chardetect.py
pip/_vendor/requests/packages/chardet/chardistribution.py
pip/_vendor/requests/packages/chardet/charsetgroupprober.py
pip/_vendor/requests/packages/chardet/charsetprober.py
pip/_vendor/requests/packages/chardet/codingstatemachine.py
pip/_vendor/requests/packages/chardet/compat.py
pip/_vendor/requests/packages/chardet/constants.py
pip/_vendor/requests/packages/chardet/cp949prober.py
pip/_vendor/requests/packages/chardet/escprober.py
pip/_vendor/requests/packages/chardet/escsm.py
pip/_vendor/requests/packages/chardet/eucjpprober.py
pip/_vendor/requests/packages/chardet/euckrfreq.py
pip/_vendor/requests/packages/chardet/euckrprober.py
pip/_vendor/requests/packages/chardet/euctwfreq.py
pip/_vendor/requests/packages/chardet/euctwprober.py
pip/_vendor/requests/packages/chardet/gb2312freq.py
pip/_vendor/requests/packages/chardet/gb2312prober.py
pip/_vendor/requests/packages/chardet/hebrewprober.py
pip/_vendor/requests/packages/chardet/jisfreq.py
pip/_vendor/requests/packages/chardet/jpcntx.py
pip/_vendor/requests/packages/chardet/langbulgarianmodel.py
pip/_vendor/requests/packages/chardet/langcyrillicmodel.py
pip/_vendor/requests/packages/chardet/langgreekmodel.py
pip/_vendor/requests/packages/chardet/langhebrewmodel.py
pip/_vendor/requests/packages/chardet/langhungarianmodel.py
pip/_vendor/requests/packages/chardet/langthaimodel.py
pip/_vendor/requests/packages/chardet/latin1prober.py
pip/_vendor/requests/packages/chardet/mbcharsetprober.py
pip/_vendor/requests/packages/chardet/mbcsgroupprober.py
pip/_vendor/requests/packages/chardet/mbcssm.py
pip/_vendor/requests/packages/chardet/sbcharsetprober.py
pip/_vendor/requests/packages/chardet/sbcsgroupprober.py
pip/_vendor/requests/packages/chardet/sjisprober.py
pip/_vendor/requests/packages/chardet/universaldetector.py
pip/_vendor/requests/packages/chardet/utf8prober.py
pip/_vendor/requests/packages/urllib3/__init__.py
pip/_vendor/requests/packages/urllib3/_collections.py
pip/_vendor/requests/packages/urllib3/connection.py
pip/_vendor/requests/packages/urllib3/connectionpool.py
pip/_vendor/requests/packages/urllib3/exceptions.py
pip/_vendor/requests/packages/urllib3/fields.py
pip/_vendor/requests/packages/urllib3/filepost.py
pip/_vendor/requests/packages/urllib3/poolmanager.py
pip/_vendor/requests/packages/urllib3/request.py
pip/_vendor/requests/packages/urllib3/response.py
pip/_vendor/requests/packages/urllib3/contrib/__init__.py
pip/_vendor/requests/packages/urllib3/contrib/ntlmpool.py
pip/_vendor/requests/packages/urllib3/contrib/pyopenssl.py
pip/_vendor/requests/packages/urllib3/packages/__init__.py
pip/_vendor/requests/packages/urllib3/packages/ordered_dict.py
pip/_vendor/requests/packages/urllib3/packages/six.py
pip/_vendor/requests/packages/urllib3/packages/ssl_match_hostname/__init__.py
pip/_vendor/requests/packages/urllib3/packages/ssl_match_hostname/_implementation.py
pip/_vendor/requests/packages/urllib3/util/__init__.py
pip/_vendor/requests/packages/urllib3/util/connection.py
pip/_vendor/requests/packages/urllib3/util/request.py
pip/_vendor/requests/packages/urllib3/util/response.py
pip/_vendor/requests/packages/urllib3/util/ssl_.py
pip/_vendor/requests/packages/urllib3/util/timeout.py
pip/_vendor/requests/packages/urllib3/util/url.py
pip/backwardcompat/__init__.py
pip/commands/__init__.py
pip/commands/bundle.py
......@@ -217,4 +67,4 @@ pip/vcs/__init__.py
pip/vcs/bazaar.py
pip/vcs/git.py
pip/vcs/mercurial.py
pip/vcs/subversion.py
\ No newline at end of file
pip/vcs/subversion.py
......@@ -4,6 +4,69 @@ import optparse
import sys
import re
import errno
# Upstream pip vendorizes a bunch of its dependencies. Debian de-vendorizes
# (unbundles) these dependencies to be compliant with Debian policy. Instead,
# these dependencies are packaged as wheel (.whl) files in a known location.
# When pip itself executes, we have to arrange for these wheels to show up
# earlier on sys.path than any other version of these packages, otherwise
# things can break. See for example Bug #744145.
#
# The location of the wheels differs depending on whether we're inside or
# outside a virtual environment, regardless of whether that venv was created
# with virtualenv or pyvenv. The first thing we have to do is figure out if
# we're inside or outside a venv, then search the appropriate wheel directory
# and add all the .whls found there to the front of sys.path. As per Debian
# Python Policy, only the wheels needed to support this de-vendorization will
# be present, so it's safe to add them all.
#
# venv determination is a bit of a black art, but this algorithm should work
# in both Python 2 (virtualenv-only) and Python 3 (pyvenv and virtualenv). -
# updated by barry@debian.org 2015-02-25
base_prefix = getattr(sys, 'base_prefix', None)
real_prefix = getattr(sys, 'real_prefix', None)
if base_prefix is None:
# Python 2 has no base_prefix at all. It also has no pyvenv. Fall back
# to checking real_prefix.
if real_prefix is None:
# We are not in a venv.
in_venv = False
else:
# We're in a Python 2 virtualenv created venv, but real_prefix should
# never be the same as sys.prefix.
assert sys.prefix != real_prefix
in_venv = True
elif sys.prefix != base_prefix:
# We're in a Python 3, pyvenv created venv.
in_venv = True
elif real_prefix is None:
# We're in Python 3, outside a venv, but base better equal prefix.
assert sys.prefix == base_prefix
in_venv = False
else:
# We're in a Python 3, virtualenv created venv.
assert real_prefix != sys.prefix
in_venv = True
if in_venv:
wheel_dir = os.path.join(sys.prefix, 'lib', 'python-wheels')
else:
wheel_dir = '/usr/share/python-wheels'
# We'll add all the wheels we find to the front of sys.path so that they're
# found first, even if the same dependencies are available in site-packages.
try:
for filename in os.listdir(wheel_dir):
if os.path.splitext(filename)[1] == '.whl':
sys.path.insert(0, os.path.join(wheel_dir, filename))
# FileNotFoundError doesn't exist in Python 2, but ignore it anyway.
except OSError as error:
if error.errno != errno.ENOENT:
raise
from pip.exceptions import InstallationError, CommandError, PipError
from pip.log import logger
......@@ -233,7 +296,7 @@ class FrozenRequirement(object):
editable = False
req = dist.as_requirement()
specs = req.specs
assert len(specs) == 1 and specs[0][0] == '=='
assert len(specs) == 1 and specs[0][0] in ('==', '==='), specs
version = specs[0][1]
ver_match = cls._rev_re.search(version)
date_match = cls._date_re.search(version)
......
......@@ -9,7 +9,6 @@ from distutils.util import strtobool
from pip.backwardcompat import ConfigParser, string_types
from pip.locations import default_config_file
from pip.util import get_terminal_size, get_prog
from pip._vendor import pkg_resources
class PrettyHelpFormatter(optparse.IndentedHelpFormatter):
......
......@@ -9,7 +9,7 @@ To be consistent, all options will follow this design.
"""
import copy
from optparse import OptionGroup, SUPPRESS_HELP, Option
from pip.locations import build_prefix, default_log_file
from pip.locations import default_log_file
def make_option_group(group, parser):
......@@ -297,10 +297,8 @@ build_dir = OptionMaker(
'-b', '--build', '--build-dir', '--build-directory',
dest='build_dir',
metavar='dir',
default=build_prefix,
help='Directory to unpack packages into and build in. '
'The default in a virtualenv is "<venv path>/build". '
'The default for global installs is "<OS temp dir>/pip_build_<username>".')
help='Directory to unpack packages into and build in.',
)
install_options = OptionMaker(
'--install-option',
......
......@@ -6,7 +6,7 @@ from pip.req import InstallRequirement
from pip.log import logger
from pip.basecommand import Command
from pip.util import get_installed_distributions
from pip._vendor import pkg_resources
import pkg_resources
class FreezeCommand(Command):
......
......@@ -10,6 +10,7 @@ from pip.basecommand import Command
from pip.index import PackageFinder
from pip.exceptions import InstallationError, CommandError, PreviousBuildDirError
from pip import cmdoptions
from pip.util import BuildDirectory
class InstallCommand(Command):
......@@ -188,7 +189,7 @@ class InstallCommand(Command):
if (
options.no_install or
options.no_download or
(options.build_dir != build_prefix) or
options.build_dir or
options.no_clean
):
logger.deprecated('1.7', 'DEPRECATION: --no-install, --no-download, --build, '
......@@ -197,7 +198,16 @@ class InstallCommand(Command):
if options.download_dir:
options.no_install = True
options.ignore_installed = True
options.build_dir = os.path.abspath(options.build_dir)
# If we have --no-install or --no-download and no --build we use the
# legacy static build dir
if (options.build_dir is None
and (options.no_install or options.no_download)):
options.build_dir = build_prefix
if options.build_dir:
options.build_dir = os.path.abspath(options.build_dir)
options.src_dir = os.path.abspath(options.src_dir)
install_options = options.install_options or []
if options.use_user_site:
......@@ -237,69 +247,71 @@ class InstallCommand(Command):
finder = self._build_package_finder(options, index_urls, session)
requirement_set = RequirementSet(
build_dir=options.build_dir,
src_dir=options.src_dir,
download_dir=options.download_dir,
download_cache=options.download_cache,
upgrade=options.upgrade,
as_egg=options.as_egg,
ignore_installed=options.ignore_installed,
ignore_dependencies=options.ignore_dependencies,
force_reinstall=options.force_reinstall,
use_user_site=options.use_user_site,
target_dir=temp_target_dir,
session=session,
pycompile=options.compile,
)
for name in args:
requirement_set.add_requirement(
InstallRequirement.from_line(name, None))
for name in options.editables:
requirement_set.add_requirement(
InstallRequirement.from_editable(name, default_vcs=options.default_vcs))
for filename in options.requirements:
for req in parse_requirements(filename, finder=finder, options=options, session=session):
requirement_set.add_requirement(req)
if not requirement_set.has_requirements:
opts = {'name': self.name}
if options.find_links:
msg = ('You must give at least one requirement to %(name)s '
'(maybe you meant "pip %(name)s %(links)s"?)' %
dict(opts, links=' '.join(options.find_links)))
else:
msg = ('You must give at least one requirement '
'to %(name)s (see "pip help %(name)s")' % opts)
logger.warn(msg)
return
try:
if not options.no_download:
requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle)
else:
requirement_set.locate_files()
if not options.no_install and not self.bundle:
requirement_set.install(install_options, global_options, root=options.root_path)
installed = ' '.join([req.name for req in
requirement_set.successfully_installed])
if installed:
logger.notify('Successfully installed %s' % installed)
elif not self.bundle:
downloaded = ' '.join([req.name for req in
requirement_set.successfully_downloaded])
if downloaded:
logger.notify('Successfully downloaded %s' % downloaded)
elif self.bundle:
requirement_set.create_bundle(self.bundle_filename)
logger.notify('Created bundle in %s' % self.bundle_filename)
except PreviousBuildDirError:
options.no_clean = True
raise
finally:
# Clean up
if (not options.no_clean) and ((not options.no_install) or options.download_dir):
requirement_set.cleanup_files(bundle=self.bundle)
build_delete = (not (options.no_clean or options.build_dir))
with BuildDirectory(options.build_dir, delete=build_delete) as build_dir:
requirement_set = RequirementSet(
build_dir=build_dir,
src_dir=options.src_dir,
download_dir=options.download_dir,
download_cache=options.download_cache,
upgrade=options.upgrade,
as_egg=options.as_egg,
ignore_installed=options.ignore_installed,
ignore_dependencies=options.ignore_dependencies,
force_reinstall=options.force_reinstall,
use_user_site=options.use_user_site,
target_dir=temp_target_dir,
session=session,
pycompile=options.compile,
)
for name in args:
requirement_set.add_requirement(
InstallRequirement.from_line(name, None))
for name in options.editables:
requirement_set.add_requirement(
InstallRequirement.from_editable(name, default_vcs=options.default_vcs))
for filename in options.requirements:
for req in parse_requirements(filename, finder=finder, options=options, session=session):
requirement_set.add_requirement(req)
if not requirement_set.has_requirements:
opts = {'name': self.name}
if options.find_links:
msg = ('You must give at least one requirement to %(name)s '
'(maybe you meant "pip %(name)s %(links)s"?)' %
dict(opts, links=' '.join(options.find_links)))
else:
msg = ('You must give at least one requirement '
'to %(name)s (see "pip help %(name)s")' % opts)
logger.warn(msg)
return
try:
if not options.no_download:
requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle)
else:
requirement_set.locate_files()
if not options.no_install and not self.bundle:
requirement_set.install(install_options, global_options, root=options.root_path)
installed = ' '.join([req.name for req in
requirement_set.successfully_installed])
if installed:
logger.notify('Successfully installed %s' % installed)
elif not self.bundle:
downloaded = ' '.join([req.name for req in
requirement_set.successfully_downloaded])
if downloaded:
logger.notify('Successfully downloaded %s' % downloaded)
elif self.bundle:
requirement_set.create_bundle(self.bundle_filename)
logger.notify('Created bundle in %s' % self.bundle_filename)
except PreviousBuildDirError:
options.no_clean = True
raise
finally:
# Clean up
if (not options.no_clean) and ((not options.no_install) or options.download_dir):
requirement_set.cleanup_files(bundle=self.bundle)
if options.target_dir:
if not os.path.exists(options.target_dir):
......
......@@ -9,7 +9,7 @@ from pip.log import logger
from pip.backwardcompat import xmlrpclib, reduce, cmp
from pip.exceptions import CommandError
from pip.status_codes import NO_MATCHES_FOUND
from pip._vendor import pkg_resources
import pkg_resources
from distutils.version import StrictVersion, LooseVersion
......
......@@ -2,7 +2,7 @@ import os
from pip.basecommand import Command
from pip.log import logger
from pip._vendor import pkg_resources
import pkg_resources
class ShowCommand(Command):
......
......@@ -8,7 +8,7 @@ from pip.index import PackageFinder
from pip.log import logger
from pip.exceptions import CommandError, PreviousBuildDirError
from pip.req import InstallRequirement, RequirementSet, parse_requirements
from pip.util import normalize_path
from pip.util import BuildDirectory, normalize_path
from pip.wheel import WheelBuilder
from pip import cmdoptions
......@@ -88,7 +88,11 @@ class WheelCommand(Command):
try:
import wheel.bdist_wheel
except ImportError:
raise CommandError("'pip wheel' requires the 'wheel' package. To fix this, run: pip install wheel")
if sys.version_info < (3,):
debian_package = 'python-wheel'
else:
debian_package = 'python3-wheel'
raise CommandError("'pip wheel' requires the 'wheel' package. To fix this, run: sudo apt-get install %s" % debian_package)
try:
import pkg_resources
......@@ -123,6 +127,9 @@ class WheelCommand(Command):
"--extra-index-url is suggested.")
index_urls += options.mirrors
if options.build_dir:
options.build_dir = os.path.abspath(options.build_dir)
session = self._build_session(options)
finder = PackageFinder(find_links=options.find_links,
......@@ -137,59 +144,60 @@ class WheelCommand(Command):
session=session,
)
options.build_dir = os.path.abspath(options.build_dir)
requirement_set = RequirementSet(
build_dir=options.build_dir,
src_dir=None,
download_dir=None,
download_cache=options.download_cache,
ignore_dependencies=options.ignore_dependencies,
ignore_installed=True,
session=session,
wheel_download_dir=options.wheel_dir
)
# make the wheelhouse
if not os.path.exists(options.wheel_dir):
os.makedirs(options.wheel_dir)
#parse args and/or requirements files
for name in args:
requirement_set.add_requirement(
InstallRequirement.from_line(name, None))
for filename in options.requirements:
for req in parse_requirements(
filename,
finder=finder,
options=options,
session=session):
if req.editable:
logger.notify("ignoring %s" % req.url)
continue
requirement_set.add_requirement(req)
#fail if no requirements
if not requirement_set.has_requirements:
opts = {'name': self.name}
msg = ('You must give at least one requirement '
'to %(name)s (see "pip help %(name)s")' % opts)
logger.error(msg)
return
build_delete = (not (options.no_clean or options.build_dir))
with BuildDirectory(options.build_dir, delete=build_delete) as build_dir:
requirement_set = RequirementSet(
build_dir=build_dir,
src_dir=None,
download_dir=None,
download_cache=options.download_cache,
ignore_dependencies=options.ignore_dependencies,
ignore_installed=True,
session=session,
wheel_download_dir=options.wheel_dir
)
try:
#build wheels
wb = WheelBuilder(
requirement_set,
finder,
options.wheel_dir,
build_options = options.build_options or [],
global_options = options.global_options or []
)
wb.build()
except PreviousBuildDirError:
options.no_clean = True
raise
finally:
if not options.no_clean:
requirement_set.cleanup_files()
# make the wheelhouse
if not os.path.exists(options.wheel_dir):
os.makedirs(options.wheel_dir)
#parse args and/or requirements files
for name in args:
requirement_set.add_requirement(
InstallRequirement.from_line(name, None))
for filename in options.requirements:
for req in parse_requirements(
filename,
finder=finder,
options=options,
session=session):
if req.editable:
logger.notify("ignoring %s" % req.url)
continue
requirement_set.add_requirement(req)
#fail if no requirements
if not requirement_set.has_requirements:
opts = {'name': self.name}
msg = ('You must give at least one requirement '
'to %(name)s (see "pip help %(name)s")' % opts)
logger.error(msg)
return
try:
#build wheels
wb = WheelBuilder(
requirement_set,
finder,
options.wheel_dir,
build_options = options.build_options or [],
global_options = options.global_options or []
)
wb.build()
except PreviousBuildDirError:
options.no_clean = True
raise
finally:
if not options.no_clean:
requirement_set.cleanup_files()
......@@ -19,13 +19,13 @@ from pip.util import (splitext, rmtree, format_size, display_path,
create_download_cache_folder, cache_download)
from pip.vcs import vcs
from pip.log import logger
from pip._vendor import requests, six
from pip._vendor.requests.adapters import BaseAdapter
from pip._vendor.requests.auth import AuthBase, HTTPBasicAuth
from pip._vendor.requests.compat import IncompleteRead
from pip._vendor.requests.exceptions import InvalidURL, ChunkedEncodingError
from pip._vendor.requests.models import Response
from pip._vendor.requests.structures import CaseInsensitiveDict
import requests, six
from requests.adapters import BaseAdapter
from requests.auth import AuthBase, HTTPBasicAuth
from requests.compat import IncompleteRead
from requests.exceptions import InvalidURL, ChunkedEncodingError
from requests.models import Response
from requests.structures import CaseInsensitiveDict
__all__ = ['get_file_content',
'is_url', 'url_to_path', 'path_to_url',
......
......@@ -14,8 +14,8 @@ from pip.backwardcompat import urlparse, url2pathname
from pip.download import PipSession, url_to_path, path_to_url
from pip.wheel import Wheel, wheel_ext
from pip.pep425tags import supported_tags, supported_tags_noarch, get_platform
from pip._vendor import html5lib, requests, pkg_resources
from pip._vendor.requests.exceptions import SSLError
import html5lib, requests, pkg_resources
from requests.exceptions import SSLError
__all__ = ['PackageFinder']
......
......@@ -6,7 +6,7 @@ import os
import logging
from pip import backwardcompat
from pip._vendor import colorama, pkg_resources
import colorama, pkg_resources
def _color_wrap(*colors):
......
......@@ -17,6 +17,7 @@ from pip.exceptions import (InstallationError, UninstallationError, UnsupportedW
DistributionNotFound, PreviousBuildDirError)
from pip.vcs import vcs
from pip.log import logger
from pip.locations import running_under_virtualenv
from pip.util import (display_path, rmtree, ask, ask_path_exists, backup_dir,
is_installable_dir, is_local, dist_is_local,
dist_in_usersite, dist_in_site_packages, renames,
......@@ -33,7 +34,7 @@ from pip.download import (PipSession, get_file_content, is_url, url_to_path,
unpack_file_url, unpack_http_url)
import pip.wheel
from pip.wheel import move_wheel_files, Wheel, wheel_ext
from pip._vendor import pkg_resources, six
import pkg_resources, six
def read_text_file(filename):
......@@ -1759,8 +1760,16 @@ class UninstallPathSet(object):
def _can_uninstall(self):
if not dist_is_local(self.dist):
logger.notify("Not uninstalling %s at %s, outside environment %s"
% (self.dist.project_name, normalize_path(self.dist.location), sys.prefix))
if running_under_virtualenv():
reason = "outside environment %s" % (sys.prefix,)
else:
reason = "owned by OS"
logger.notify(
"Not uninstalling %s at %s, %s",
self.dist.project_name,
normalize_path(self.dist.location),
reason
)
return False
return True
......
......@@ -8,14 +8,16 @@ import zipfile
import tarfile
import subprocess
import textwrap
import tempfile
from pip.exceptions import InstallationError, BadCommand, PipError
from pip.backwardcompat import(WindowsError, string_types, raw_input,
console_to_str, user_site, PermissionError)
from pip.locations import site_packages, running_under_virtualenv, virtualenv_no_global
from pip.locations import (site_packages, running_under_virtualenv, virtualenv_no_global,
distutils_scheme)
from pip.log import logger
from pip._vendor import pkg_resources
from pip._vendor.distlib import version
import pkg_resources
from distlib import version
__all__ = ['rmtree', 'display_path', 'backup_dir',
'find_command', 'ask', 'Inf',
......@@ -304,22 +306,39 @@ 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:
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))
......@@ -716,5 +735,40 @@ def is_prerelease(vers):
# Cannot normalize, assume it is a pre-release
return True
parsed = version._normalized_key(normalized)
if version._normalized_key.__name__ == "_pep_440_key":
parsed = version._normalized_key(normalized)[1:]
else:
parsed = version._normalized_key(normalized)
return any([any([y in set(["a", "b", "c", "rc", "dev"]) for y in x]) for x in parsed])
class BuildDirectory(object):
def __init__(self, name=None, delete=None):
# If we were not given an explicit directory, and we were not given an
# explicit delete option, then we'll default to deleting.
if name is None and delete is None:
delete = True
if name is None:
name = tempfile.mkdtemp(prefix="pip-build-")
# If we were not given an explicit directory, and we were not given
# an explicit delete option, then we'll default to deleting.
if delete is None:
delete = True
self.name = name
self.delete = delete
def __repr__(self):
return "<{} {!r}>".format(self.__class__.__name__, self.name)
def __enter__(self):
return self.name
def __exit__(self, exc, value, tb):
self.cleanup()
def cleanup(self):
if self.delete:
rmtree(self.name)
......@@ -21,9 +21,8 @@ from pip.locations import distutils_scheme
from pip.log import logger
from pip import pep425tags
from pip.util import call_subprocess, normalize_path, make_path_relative
from pip._vendor import pkg_resources
from pip._vendor.distlib.scripts import ScriptMaker
from pip._vendor import pkg_resources
import pkg_resources
from distlib.scripts import ScriptMaker
wheel_ext = '.whl'
......
......@@ -41,7 +41,13 @@ def find_version(*file_paths):
long_description = "\n" + "\n".join([read('PROJECT.txt'),
read('docs', 'quickstart.rst')])
tests_require = ['pytest', 'virtualenv>=1.10', 'scripttest>=1.3', 'mock']
tests_require = ['pytest', 'scripttest>=1.3', 'mock']
# In Debian, the virtualenv Build-Depends will satisfy this requirement
# but setup() is too dumb to notice that.
if sys.version_info < (3,):
tests_require.append('virtualenv>=1.10')
setup(name="pip",
version=find_version('pip', '__init__.py'),
......@@ -67,9 +73,6 @@ setup(name="pip",
license='MIT',
packages=find_packages(exclude=["contrib", "docs", "tests*"]),
package_data={
'pip._vendor.requests': ['*.pem'],
'pip._vendor.distlib._backport': ['sysconfig.cfg'],
'pip._vendor.distlib': ['t32.exe', 't64.exe', 'w32.exe', 'w64.exe'],
},
entry_points=dict(console_scripts=['pip=pip:main', 'pip%s=pip:main' % sys.version[:1],
'pip%s=pip:main' % sys.version[:3]]),
......