[Python-modules-commits] [python-pip] 06/14: merge patched-dirtbike into dirtbike

Barry Warsaw barry at moszumanska.debian.org
Fri Jan 29 15:52:08 UTC 2016


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

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

commit 7f0af7f97af7fee8df870460cb59109ae44c44af
Merge: 1890a4e a93e5cf
Author: Barry Warsaw <barry at python.org>
Date:   Wed Jan 27 10:17:31 2016 -0500

    merge patched-dirtbike into dirtbike

 debian/.git-dpm                              |   4 +-
 debian/patches/disable-console-scripts.patch | 119 +++++++++++++++++++++++++++
 debian/patches/series                        |   1 +
 pip/__init__.py                              |  63 --------------
 setup.py                                     |  16 ++--
 5 files changed, 131 insertions(+), 72 deletions(-)

diff --cc debian/.git-dpm
index ffbbed4,0000000..a9d1068
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
- 0ddf5c266e00c9cd5b02f0ae31939f5200c57e6d
- 0ddf5c266e00c9cd5b02f0ae31939f5200c57e6d
++a93e5cf364fe501beaaf6bfcd417fa5f0cce8431
++a93e5cf364fe501beaaf6bfcd417fa5f0cce8431
 +3be157ea672de9d85e0e888ac4080ebe66fb4782
 +3be157ea672de9d85e0e888ac4080ebe66fb4782
 +python-pip_7.1.2.orig.tar.gz
 +9eb9ea19b630412bc2b2b587fc6bbbee71950a96
 +1049170
 +debianTag="debian/%e%v"
 +patchedTag="patched/%e%v"
 +upstreamTag="upstream/%e%u"
diff --cc debian/patches/disable-console-scripts.patch
index 0000000,0000000..d619f9f
new file mode 100644
--- /dev/null
+++ b/debian/patches/disable-console-scripts.patch
@@@ -1,0 -1,0 +1,119 @@@
++From a93e5cf364fe501beaaf6bfcd417fa5f0cce8431 Mon Sep 17 00:00:00 2001
++From: Barry Warsaw <barry at python.org>
++Date: Wed, 27 Jan 2016 10:15:23 -0500
++Subject: Disable auto-generation of console scripts.
++
++We'll disable these, and remove the sys.path hacking from
++pip/__init__.py because we need to put the distro wheels on sys.path
++earlier than here.  For this, we'll generate our own /usr/bin/pip*
++scripts from our own templates that include the necessary early sys.path
++hacking.  The main reason for this is the need to use the pkg_resources
++wheel.
++
++Patch-Name: disable-console-scripts.patch
++---
++ pip/__init__.py | 63 ---------------------------------------------------------
++ setup.py        | 16 ++++++++-------
++ 2 files changed, 9 insertions(+), 70 deletions(-)
++
++diff --git a/pip/__init__.py b/pip/__init__.py
++index f48172b..114bd59 100755
++--- a/pip/__init__.py
+++++ b/pip/__init__.py
++@@ -8,69 +8,6 @@ import warnings
++ 
++ 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 at 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.utils import get_installed_distributions, get_prog
++diff --git a/setup.py b/setup.py
++index 60843e5..cb0eab6 100644
++--- a/setup.py
+++++ b/setup.py
++@@ -81,13 +81,15 @@ setup(
++         "pip._vendor.distlib._backport": ["sysconfig.cfg"],
++         "pip._vendor.distlib": ["t32.exe", "t64.exe", "w32.exe", "w64.exe"],
++     },
++-    entry_points={
++-        "console_scripts": [
++-            "pip=pip:main",
++-            "pip%s=pip:main" % sys.version[:1],
++-            "pip%s=pip:main" % sys.version[:3],
++-        ],
++-    },
+++    # In Debian, we'll generate our own console scripts to properly handle
+++    # installing wheels early enough on sys.path.
+++    ## entry_points={
+++    ##     "console_scripts": [
+++    ##         "pip=pip:main",
+++    ##         "pip%s=pip:main" % sys.version[:1],
+++    ##         "pip%s=pip:main" % sys.version[:3],
+++    ##     ],
+++    ## },
++     tests_require=tests_require,
++     zip_safe=False,
++     extras_require={
diff --cc debian/patches/series
index ebeddd0,0000000..c0c58d3
mode 100644,000000..100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@@ -1,3 -1,0 +1,4 @@@
 +use-wheels.patch
 +hands-off-system-packages.patch
 +enable-debundling.patch
++disable-console-scripts.patch

-- 
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