[Python-modules-commits] [python-virtualenv] 08/17: merge patched into master
Barry Warsaw
barry at moszumanska.debian.org
Sun Jan 31 22:20:51 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 5cc72ad6754c4e5970a207814ae3242b9641be35
Merge: 8511733 6ca0ec9
Author: Barry Warsaw <barry at python.org>
Date: Fri Jan 29 22:06:49 2016 -0500
merge patched into master
LICENSE.txt | 2 +-
MANIFEST.in | 5 +-
PKG-INFO | 868 +----------------------------------
README.rst | 14 +-
bin/rebuild-script.py | 88 ++--
debian/.git-dpm | 6 +-
debian/patches/entry-points.patch | 6 +-
debian/patches/python2-default.patch | 6 +-
debian/patches/system-python.patch | 2 +-
debian/patches/use-wheels.patch | 30 +-
docs/changes.rst | 86 +++-
docs/conf.py | 8 +-
docs/index.rst | 4 +-
docs/reference.rst | 13 +-
docs/userguide.rst | 15 +-
setup.cfg | 4 +-
setup.py | 33 +-
tests/__init__.py | 0
tests/test_activate.sh | 96 ++++
tests/test_activate_output.expected | 2 +
tests/test_virtualenv.py | 139 ++++++
virtualenv.egg-info/PKG-INFO | 868 +----------------------------------
virtualenv.egg-info/SOURCES.txt | 17 +-
virtualenv.egg-info/entry_points.txt | 2 +-
virtualenv.egg-info/pbr.json | 1 -
virtualenv.py | 582 ++++++++++-------------
virtualenv_embedded/activate.bat | 20 +-
virtualenv_embedded/activate.csh | 8 +-
virtualenv_embedded/activate.fish | 68 +--
virtualenv_embedded/activate.sh | 32 +-
virtualenv_embedded/deactivate.bat | 39 +-
virtualenv_embedded/new_site.py | 814 ++++++++++++++++++++++++++++++++
virtualenv_embedded/python-config | 78 ++++
virtualenv_embedded/site.26.py | 577 +++++++++++++++++++++++
virtualenv_embedded/site.27.py | 600 ++++++++++++++++++++++++
35 files changed, 2889 insertions(+), 2244 deletions(-)
diff --cc debian/.git-dpm
index 303920f,0000000..9ed0cf8
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
- c03fb904e4f04371baf8007aa79efe87b98608e3
- c03fb904e4f04371baf8007aa79efe87b98608e3
- e92cbdff281c6cf2ca7da4af93d1cd55e8b600cf
++6ca0ec986bab79a34d52f137961d65a64922eb0a
++6ca0ec986bab79a34d52f137961d65a64922eb0a
++b97fe01129d70ed8267857e5ca9963c10ebcedd7
+b97fe01129d70ed8267857e5ca9963c10ebcedd7
+python-virtualenv_14.0.3+ds.orig.tar.gz
+d6806f6d8f740202b894c438cb2dac6dc62526f2
+96239
+debianTag="debian/%e%v"
+patchedTag="patched/%e%v"
+upstreamTag="upstream/%e%u"
diff --cc debian/patches/entry-points.patch
index 034d64f,0000000..73f674c
mode 100644,000000..100644
--- a/debian/patches/entry-points.patch
+++ b/debian/patches/entry-points.patch
@@@ -1,25 -1,0 +1,25 @@@
- From 871d82a121416e8b09611930229dc2c4b75c26e5 Mon Sep 17 00:00:00 2001
++From 760083ef8379d295542e04fd429544f1748cccc1 Mon Sep 17 00:00:00 2001
+From: Barry Warsaw <barry at debian.org>
+Date: Fri, 9 Oct 2015 22:23:57 +0200
+Subject: Prevent installation of virtualenv-X.Y since we're not
+
+ providing these for every supported version.
+Forwarded: no
+
+Patch-Name: entry-points.patch
+---
+ setup.py | 1 -
+ 1 file changed, 1 deletion(-)
+
+diff --git a/setup.py b/setup.py
- index ce35314..ab81f59 100644
++index 71261e0..69e072c 100644
+--- a/setup.py
++++ b/setup.py
- @@ -32,7 +32,6 @@ try:
++@@ -31,7 +31,6 @@ try:
+ 'entry_points': {
+ 'console_scripts': [
+ 'virtualenv=virtualenv:main',
+- 'virtualenv-%s.%s=virtualenv:main' % sys.version_info[:2]
+ ],
+ },
+ 'zip_safe': False,
diff --cc debian/patches/python2-default.patch
index bee7273,0000000..fdae360
mode 100644,000000..100644
--- a/debian/patches/python2-default.patch
+++ b/debian/patches/python2-default.patch
@@@ -1,31 -1,0 +1,31 @@@
- From c03fb904e4f04371baf8007aa79efe87b98608e3 Mon Sep 17 00:00:00 2001
++From 6ca0ec986bab79a34d52f137961d65a64922eb0a 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 1029e55..8589a25 100755
++index 869c060..aafb674 100755
+--- a/virtualenv.py
++++ b/virtualenv.py
- @@ -674,9 +674,10 @@ def main():
++@@ -541,9 +541,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/system-python.patch
index 6481fc5,0000000..a5f618a
mode 100644,000000..100644
--- a/debian/patches/system-python.patch
+++ b/debian/patches/system-python.patch
@@@ -1,23 -1,0 +1,23 @@@
- From 73e49cbd6470083483b36e985b604a8c88f8e185 Mon Sep 17 00:00:00 2001
++From 1180399aff7fe2403d28aa27cb06afdde11fb038 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 9761e46,0000000..b3aba65
mode 100644,000000..100644
--- a/debian/patches/use-wheels.patch
+++ b/debian/patches/use-wheels.patch
@@@ -1,126 -1,0 +1,126 @@@
- From 87296f2c923b6156b3e6c1961a5846ba9804bab5 Mon Sep 17 00:00:00 2001
++From a89a9c81c6cb021643ccedb810b422f0fdb8eee7 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 the archive's wheels instead of the bundled wheels, by
+
+ prepending their 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.
+Forwarded: not-needed
+
+Patch-Name: use-wheels.patch
+---
+ scripts/virtualenv | 9 +++++++++
+ setup.py | 4 ++--
+ virtualenv.py | 46 ++++++++++++++++++++++++++++++++++++++++++++--
+ 3 files changed, 55 insertions(+), 4 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 ab81f59..d3240c5 100644
++index 69e072c..8e16ced 100644
+--- a/setup.py
++++ b/setup.py
- @@ -105,6 +105,6 @@ setup(
++@@ -122,6 +122,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.py b/virtualenv.py
- index da25205..1029e55 100755
++index 4589dd9..869c060 100755
+--- a/virtualenv.py
++++ b/virtualenv.py
- @@ -23,6 +23,10 @@ import struct
- import subprocess
- import tarfile
++@@ -36,6 +36,10 @@ except ImportError:
++ __version__ = "14.0.3"
++ virtualenv_version = __version__ # legacy
+
++# Debian: Barry Warsaw <barry at debian.org> 2014-06-06
++DEBIAN_WHEEL_DEPS = ['chardet', 'colorama', 'distlib', 'html5lib',
++ 'pip', 'requests', 'setuptools', 'six', 'urllib3']
++
+ if sys.version_info < (2, 6):
+ print('ERROR: %s' % sys.exc_info()[1])
+ print('ERROR: this script requires Python 2.6 or greater.')
- @@ -526,7 +530,11 @@ def _find_file(filename, dirs):
++@@ -393,7 +397,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:
- @@ -863,7 +871,16 @@ def call_subprocess(cmd, show_stdout=True,
++@@ -734,7 +742,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,
- @@ -995,6 +1012,31 @@ def create_environment(home_dir, site_packages=False, clear=False,
++@@ -887,6 +904,31 @@ def create_environment(home_dir, site_packages=False, clear=False,
+
- install_distutils(home_dir)
++ 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>/lib/python-wheels.
- + destdir = os.path.join(home_dir, 'lib', 'python-wheels')
+++ # 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 = ['setuptools']
- if not no_pip:
++ to_install.append('setuptools')
++
--
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