[Python-modules-commits] [python-virtualenv] 03/04: merge patched into master
Barry Warsaw
barry at moszumanska.debian.org
Mon Nov 14 15:52:32 UTC 2016
This is an automated email from the git hooks/post-receive script.
barry pushed a commit to branch master
in repository python-virtualenv.
commit 90bd5cfce1237394b3a321f6a5fd5a60ad5fe0d9
Merge: 3da973a f71c8f8
Author: Barry Warsaw <barry at python.org>
Date: Mon Nov 14 10:30:51 2016 -0500
merge patched into master
debian/.git-dpm | 4 ++--
debian/patches/python2-default.patch | 4 ++--
debian/patches/use-wheels.patch | 6 +++---
virtualenv.py | 2 +-
4 files changed, 8 insertions(+), 8 deletions(-)
diff --cc debian/.git-dpm
index 8c3a8ce,0000000..0655175
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
- 36a6df6e9c1dde967e2a04ff319ff8aeba279260
- 36a6df6e9c1dde967e2a04ff319ff8aeba279260
++f71c8f8e68870960f52602d23a0fe56fa6a1431f
++f71c8f8e68870960f52602d23a0fe56fa6a1431f
+72e282aa85135921129990c97c95b4da9eb66bbd
+72e282aa85135921129990c97c95b4da9eb66bbd
+python-virtualenv_15.0.3+ds.orig.tar.gz
+1302c21aa5fffb8d056165642c8dfe40818784b2
+89206
+debianTag="debian/%e%v"
+patchedTag="patched/%e%v"
+upstreamTag="upstream/%e%u"
diff --cc debian/patches/python2-default.patch
index d1b6036,0000000..b6cb83f
mode 100644,000000..100644
--- a/debian/patches/python2-default.patch
+++ b/debian/patches/python2-default.patch
@@@ -1,31 -1,0 +1,31 @@@
- From 36a6df6e9c1dde967e2a04ff319ff8aeba279260 Mon Sep 17 00:00:00 2001
++From f71c8f8e68870960f52602d23a0fe56fa6a1431f Mon Sep 17 00:00:00 2001
+From: Barry Warsaw <barry at debian.org>
+Date: Fri, 9 Oct 2015 22:23:59 +0200
+Subject: Even though /usr/bin/virtualenv is a Python 3 script now, in
+
+ Debian we still want to default to using Python 2 unless the -p/--python
+ argument is given.
+Forwarded: not-needed
+
+Patch-Name: python2-default.patch
+---
+ virtualenv.py | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/virtualenv.py b/virtualenv.py
- index 3a821fe..49a305d 100755
++index 7db92a9..bea02bb 100755
+--- a/virtualenv.py
++++ b/virtualenv.py
+@@ -546,9 +546,10 @@ def main():
+ '-p', '--python',
+ dest='python',
+ metavar='PYTHON_EXE',
++ default='python2',
+ help='The Python interpreter to use, e.g., --python=python2.5 will use the python2.5 '
+- 'interpreter to create the new environment. The default is the interpreter that '
+- 'virtualenv was installed with (%s)' % sys.executable)
++ 'interpreter to create the new environment. The default is the python2 '
++ 'interpreter on your path (e.g. /usr/bin/python2)')
+
+ parser.add_option(
+ '--clear',
diff --cc debian/patches/use-wheels.patch
index 859902d,0000000..42e398e
mode 100644,000000..100644
--- a/debian/patches/use-wheels.patch
+++ b/debian/patches/use-wheels.patch
@@@ -1,163 -1,0 +1,163 @@@
- From 93704f90a7782641c2d231ce05896bf68ff0b859 Mon Sep 17 00:00:00 2001
++From 724eee2ee5c9296efdc10ca07d6c916705e96bc4 Mon Sep 17 00:00:00 2001
+From: Barry Warsaw <barry at debian.org>
+Date: Fri, 9 Oct 2015 22:23:58 +0200
+Subject: Use distro wheels instead of the bundled wheels.
+
+Prepend the wheel paths onto the front of sys.path. Also, when the venv
+is created, copy the system wheels into <venv>/lib/python-wheels for use
+by our patched pip wheel. Make sure the command line script uses the
+system wheels first.
+
+Under Debian, we also have to install pkg_resources and _markerlib.
+Since these get installed from distro wheels, and since Debian splits
+setuptools and pkg_resources into separate binary packages, they get
+built into separate wheels. Thus we have to explicitly install
+pkg_resources from wheel or assumptions made by Python packages that the
+two always go together will be broken.
+
+Forwarded: not-needed
+
+Patch-Name: use-wheels.patch
+---
+ scripts/virtualenv | 9 +++++++
+ setup.py | 4 ++--
+ virtualenv.egg-info/SOURCES.txt | 4 ++--
+ virtualenv.py | 52 ++++++++++++++++++++++++++++++++++++++---
+ 4 files changed, 62 insertions(+), 7 deletions(-)
+
+diff --git a/scripts/virtualenv b/scripts/virtualenv
+index 418bd79..7dd0203 100644
+--- a/scripts/virtualenv
++++ b/scripts/virtualenv
+@@ -1,3 +1,12 @@
+ #!/usr/bin/python3
+ import virtualenv
++
++# Debian: Barry Warsaw <barry at debian.org> 2014-06-02
++# Instead of using the bundled wheels, use the ones in the archive.
++import sys
++for path in virtualenv.find_wheels(virtualenv.DEBIAN_WHEEL_DEPS,
++ ['/usr/share/python-wheels']):
++ if path not in sys.path:
++ sys.path.insert(0, path)
++
+ virtualenv.main()
+diff --git a/setup.py b/setup.py
+index ee03bc5..978f1db 100644
+--- a/setup.py
++++ b/setup.py
+@@ -118,6 +118,6 @@ setup(
+ url='https://virtualenv.pypa.io/',
+ license='MIT',
+ py_modules=['virtualenv'],
+- packages=['virtualenv_support'],
+- package_data={'virtualenv_support': ['*.whl']},
++ #packages=['virtualenv_support'],
++ #package_data={'virtualenv_support': ['*.whl']},
+ **setup_params)
+diff --git a/virtualenv.egg-info/SOURCES.txt b/virtualenv.egg-info/SOURCES.txt
+index 25b9437..963bead 100644
+--- a/virtualenv.egg-info/SOURCES.txt
++++ b/virtualenv.egg-info/SOURCES.txt
+@@ -41,5 +41,5 @@ virtualenv_embedded/site.py
+ virtualenv_support/__init__.py
+ virtualenv_support/argparse-1.4.0-py2.py3-none-any.whl
+ virtualenv_support/pip-8.1.2-py2.py3-none-any.whl
+-virtualenv_support/setuptools-22.0.5-py2.py3-none-any.whl
+-virtualenv_support/wheel-0.29.0-py2.py3-none-any.whl
+\ No newline at end of file
++virtualenv_support/setuptools-25.2.0-py2.py3-none-any.whl
++virtualenv_support/wheel-0.29.0-py2.py3-none-any.whl
+diff --git a/virtualenv.py b/virtualenv.py
- index 14706b0..3a821fe 100755
++index 14706b0..7db92a9 100755
+--- a/virtualenv.py
++++ b/virtualenv.py
+@@ -39,6 +39,12 @@ except ImportError:
+ __version__ = "15.0.3"
+ virtualenv_version = __version__ # legacy
+
++# Debian: Barry Warsaw <barry at debian.org> 2014-06-06
++DEBIAN_WHEEL_DEPS = [
++ os.path.basename(whl).split('-')[0]
++ for whl in glob.glob('/usr/share/python-wheels/*.whl')
++ ]
++
+ if sys.version_info < (2, 6):
+ print('ERROR: %s' % sys.exc_info()[1])
+ print('ERROR: this script requires Python 2.6 or greater.')
+@@ -396,7 +402,11 @@ def _find_file(filename, dirs):
+
+ def file_search_dirs():
+ here = os.path.dirname(os.path.abspath(__file__))
+- dirs = [here, join(here, 'virtualenv_support')]
++ # Debian: Barry Warsaw <barry at debian.org> 2015-06-11
++ # Don't include the bundled wheels in the search dirs, since we strip them
++ # out in favor of the system wheels.
++ #dirs = [here, join(here, 'virtualenv_support')]
++ dirs = [here, '/usr/share/python-wheels/']
+ if os.path.splitext(os.path.dirname(__file__))[0] != 'virtualenv':
+ # Probably some boot script; just in case virtualenv is installed...
+ try:
+@@ -742,7 +752,16 @@ def call_subprocess(cmd, show_stdout=True,
+ for varname in remove_from_env:
+ env.pop(varname, None)
+ else:
+- env = None
++ env = {}
++ # Debian: Barry Warsaw <barry at debian.org> 2014-06-06
++ # We're about to execute $python -c "import sys, pip ..." and run
++ # pip.main(). We have to make sure to find pip and setuptools via the
++ # wheels if they exist.
++ syspath_parts = env.get('PYTHONPATH', '').split(os.pathsep)
++ for path in find_wheels(DEBIAN_WHEEL_DEPS, ['/usr/share/python-wheels']):
++ if path not in syspath_parts:
++ syspath_parts.insert(0, path)
++ env['PYTHONPATH'] = os.pathsep.join(syspath_parts)
+ try:
+ proc = subprocess.Popen(
+ cmd, stderr=subprocess.STDOUT,
+@@ -859,7 +878,8 @@ def install_wheel(project_names, py_executable, search_dirs=None,
+
+ import pip
+
+- cert_data = pkgutil.get_data("pip._vendor.requests", "cacert.pem")
++ #cert_data = pkgutil.get_data("pip._vendor.requests", "cacert.pem")
++ cert_data = None
+ if cert_data is not None:
+ cert_file = tempfile.NamedTemporaryFile(delete=False)
+ cert_file.write(cert_data)
+@@ -927,8 +947,34 @@ def create_environment(home_dir, site_packages=False, clear=False,
+
+ to_install = []
+
++ # Debian: Barry Warsaw <barry at debian.org> 2014-06-06
++ # Copy system wheels into the venv directory where our hacked pip will
++ # search, i.e. <venv>/share/python-wheels.
++ destdir = os.path.join(home_dir, 'share', 'python-wheels')
++ try:
++ # The directory could exist. Because this code may run under Python
++ # 2, we can't use `exist_ok=True`. Catch and ignore the old way.
++ os.makedirs(destdir)
++ except OSError as error:
++ if error.errno != errno.EEXIST:
++ raise
++ for project in DEBIAN_WHEEL_DEPS:
++ wheel_names = glob.glob(
- + '/usr/share/python-wheels/{}-*.whl'.format(project))
+++ '/usr/share/python-wheels/{0}-*.whl'.format(project))
++ if len(wheel_names) == 0:
++ raise RuntimeError('missing dependency wheel %s' % project)
++ assert len(wheel_names) == 1, wheel_names
++ wheel_name = os.path.basename(wheel_names[0])
++ path = os.path.join('/usr/share/python-wheels', wheel_name)
++ with open(path, 'rb') as fp:
++ whl = fp.read()
++ dest = os.path.join(destdir, wheel_name)
++ with open(dest, 'wb') as fp:
++ fp.write(whl)
++
+ if not no_setuptools:
+ to_install.append('setuptools')
++ to_install.append('pkg_resources')
+
+ if not no_pip:
+ to_install.append('pip')
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/python-virtualenv.git
More information about the Python-modules-commits
mailing list