[Python-modules-commits] [python-virtualenv] 06/10: merge patched into master
Barry Warsaw
barry at moszumanska.debian.org
Mon Mar 7 22:20:26 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 9237809b719f62f5ff241e9f090fc40e16559e6a
Merge: f66fdd4 3e874c2
Author: Barry Warsaw <barry at python.org>
Date: Mon Mar 7 11:38:08 2016 -0500
merge patched into master
PKG-INFO | 25 +-
debian/.git-dpm | 6 +-
debian/patches/entry-points.patch | 25 --
debian/patches/python2-default.patch | 4 +-
debian/patches/series | 1 -
debian/patches/system-python.patch | 2 +-
debian/patches/use-wheels.patch | 28 +-
docs/changes.rst | 28 +-
setup.cfg | 2 +-
setup.py | 8 +-
tests/test_cmdline.py | 44 ++
virtualenv.egg-info/PKG-INFO | 25 +-
virtualenv.egg-info/SOURCES.txt | 10 +-
virtualenv.egg-info/entry_points.txt | 1 -
virtualenv.py | 109 +++--
virtualenv_embedded/new_site.py | 814 -----------------------------------
virtualenv_embedded/site.26.py | 577 -------------------------
virtualenv_embedded/site.27.py | 600 --------------------------
18 files changed, 202 insertions(+), 2107 deletions(-)
diff --cc debian/.git-dpm
index 767743e,0000000..af0cc94
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
- 6c0099de9e1804520be10ecfb29265ee1530b92a
- 6c0099de9e1804520be10ecfb29265ee1530b92a
- d56e9859de93a25bcfaa2d7d304ab7ff8cfc82bc
++3e874c2c836e65cfa9fb669a8f7469a970809d1f
++3e874c2c836e65cfa9fb669a8f7469a970809d1f
++c02459dd1d36bb3e005424d9d7c5c84e81a64005
+c02459dd1d36bb3e005424d9d7c5c84e81a64005
+python-virtualenv_15.0.0+ds.orig.tar.gz
+3e5bb1eb7ec19829ada16511c5a8c975fd8611d5
+87642
+debianTag="debian/%e%v"
+patchedTag="patched/%e%v"
+upstreamTag="upstream/%e%u"
diff --cc debian/patches/python2-default.patch
index 1b50fa3,0000000..faa31aa
mode 100644,000000..100644
--- a/debian/patches/python2-default.patch
+++ b/debian/patches/python2-default.patch
@@@ -1,31 -1,0 +1,31 @@@
- From 6c0099de9e1804520be10ecfb29265ee1530b92a Mon Sep 17 00:00:00 2001
++From 3e874c2c836e65cfa9fb669a8f7469a970809d1f 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 d83403c..eafab84 100755
++index 4656339..48aeb77 100755
+--- a/virtualenv.py
++++ b/virtualenv.py
+@@ -543,9 +543,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/series
index 3da9e47,0000000..a98ac32
mode 100644,000000..100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@@ -1,4 -1,0 +1,3 @@@
+system-python.patch
- entry-points.patch
+use-wheels.patch
+python2-default.patch
diff --cc debian/patches/system-python.patch
index abc77ae,0000000..1d11aa0
mode 100644,000000..100644
--- a/debian/patches/system-python.patch
+++ b/debian/patches/system-python.patch
@@@ -1,23 -1,0 +1,23 @@@
- From c6588b8033e2ae30206c52a7c04b5aa2e8073e57 Mon Sep 17 00:00:00 2001
++From 9238e4d7afcd5325b6e812e6345d3fb77916577b Mon Sep 17 00:00:00 2001
+From: Stefano Rivera <stefanor at debian.org>
+Date: Fri, 9 Oct 2015 22:23:56 +0200
+Subject: Use /usr/bin/python3 in the shebang.
+
+Bug-Debian: #663228
+Forwarded: not-needed
+Last-Update: 2014-06-02
+
+Patch-Name: system-python.patch
+---
+ scripts/virtualenv | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/scripts/virtualenv b/scripts/virtualenv
+index c961dd7..418bd79 100644
+--- a/scripts/virtualenv
++++ b/scripts/virtualenv
+@@ -1,3 +1,3 @@
+-#!/usr/bin/env python
++#!/usr/bin/python3
+ import virtualenv
+ virtualenv.main()
diff --cc debian/patches/use-wheels.patch
index d06a891,0000000..a572c81
mode 100644,000000..100644
--- a/debian/patches/use-wheels.patch
+++ b/debian/patches/use-wheels.patch
@@@ -1,152 -1,0 +1,152 @@@
- From 4ba9e307b3e9a99d7a39122fc4e63e5c1d7e7d92 Mon Sep 17 00:00:00 2001
++From 60ef8d135d5b5cebb6c043028e1b7beb852913bf 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 | 2 +-
+ virtualenv.py | 50 +++++++++++++++++++++++++++++++++++++++--
+ 4 files changed, 60 insertions(+), 5 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 69e072c..8e16ced 100644
++index ee03bc5..978f1db 100644
+--- a/setup.py
++++ b/setup.py
- @@ -122,6 +122,6 @@ setup(
++@@ -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 6a63143..63c6a80 100644
++index 8e16da6..71dda9d 100644
+--- a/virtualenv.egg-info/SOURCES.txt
++++ b/virtualenv.egg-info/SOURCES.txt
- @@ -44,4 +44,4 @@ virtualenv_support/__init__.py
++@@ -42,4 +42,4 @@ virtualenv_support/__init__.py
+ virtualenv_support/argparse-1.4.0-py2.py3-none-any.whl
- virtualenv_support/pip-8.0.2-py2.py3-none-any.whl
- virtualenv_support/setuptools-19.6.2-py2.py3-none-any.whl
- -virtualenv_support/wheel-0.26.0-py2.py3-none-any.whl
++ virtualenv_support/pip-8.1.0-py2.py3-none-any.whl
++ virtualenv_support/setuptools-20.2.2-py2.py3-none-any.whl
++-virtualenv_support/wheel-0.29.0-py2.py3-none-any.whl
+\ No newline at end of file
- +virtualenv_support/wheel-0.26.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 c669b36..d83403c 100755
++index 68a5d87..4656339 100755
+--- a/virtualenv.py
++++ b/virtualenv.py
- @@ -36,6 +36,12 @@ except ImportError:
- __version__ = "14.0.5"
++@@ -39,6 +39,12 @@ except ImportError:
++ __version__ = "15.0.0"
+ 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.')
+@@ -393,7 +399,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:
+@@ -734,7 +744,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, stdin=None, stdout=stdout,
- @@ -887,8 +906,35 @@ def create_environment(home_dir, site_packages=False, clear=False,
++ cmd, stderr=subprocess.STDOUT,
++@@ -919,8 +938,35 @@ 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))
++ 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')
++ to_install.append('_markerlib')
+
+ 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