Bug 1242228 - Upgrade virtualenv to 14.0.1; r=mshal

Downloaded from https://pypi.python.org/packages/source/v/virtualenv/virtualenv-14.0.1.tar.gz
and extracted without any modifications.

This appears to speed up `mach configure` for artifact builds by ~3.3s on
my Linux machine (~16.3s to 13.0s). A significant part of this appears
to be newer version of pip caching and reusing wheels after first
install.

This should be a rubber stamp review, as all changes are from trusted
upstream packages.
This commit is contained in:
Gregory Szorc 2016-01-23 18:48:43 -08:00
parent 4f64151598
commit e6396a0dd8
28 changed files with 1003 additions and 1306 deletions

View File

@ -1,6 +1,6 @@
Copyright (c) 2007 Ian Bicking and Contributors
Copyright (c) 2009 Ian Bicking, The Open Planning Project
Copyright (c) 2011-2014 The virtualenv developers
Copyright (c) 2011-2015 The virtualenv developers
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the

View File

@ -1,11 +1,12 @@
recursive-include bin *
recursive-include docs *
recursive-include scripts *
recursive-include tests *.py *.sh *.expected
recursive-include virtualenv_support *.whl
recursive-include virtualenv_embedded *
recursive-exclude docs/_templates *
recursive-exclude docs/_build *
include virtualenv_support/__init__.py
include bin/*
include scripts/*
include *.py
include AUTHORS.txt
include LICENSE.txt

View File

@ -1,6 +1,6 @@
Metadata-Version: 1.1
Name: virtualenv
Version: 12.0.5
Version: 14.0.1
Summary: Virtual Python Environment builder
Home-page: https://virtualenv.pypa.io/
Author: Jannis Leidel, Carl Meyer and Brian Rosner
@ -47,785 +47,57 @@ Description: Virtualenv
Release History
===============
12.0.5 (2015-01-03)
~~~~~~~~~~~~~~~~~~~
14.0.1 (2016-01-21)
-------------------
* Upgrade pip to 6.0.6
* Upgrade from pip 8.0.0 to 8.0.2.
* Upgrade setuptools to 11.0
* Fix the default of ``--(no-)download`` to default to downloading.
12.0.4 (2014-22-23)
~~~~~~~~~~~~~~~~~~~
14.0.0 (2016-01-19)
-------------------
* Revert the fix to ``-p`` on Debian based pythons as it was broken in other
situations.
* **BACKWARDS INCOMPATIBLE** Drop support for Python 3.2.
* Revert several sys.path changes new in 12.0 which were breaking virtualenv.
* Upgrade setuptools to 19.4
12.0.3 (2014-22-23)
~~~~~~~~~~~~~~~~~~~
* Upgrade wheel to 0.26.0
* Fix an issue where Debian based Pythons would fail when using -p with the
host Python.
* Upgrade pip to 8.0.0
* Upgrade pip to 6.0.3
* Upgrade argparse to 1.4.0
12.0.2 (2014-12-23)
~~~~~~~~~~~~~~~~~~~
* Added support for ``python-config`` script (PR #798)
* Upgraded pip to 6.0.2
* Updated activate.fish (PR #589) (PR #799)
12.0.1 (2014-12-22)
~~~~~~~~~~~~~~~~~~~
* Account for a ``site.pyo`` correctly in some python implementations (PR #759)
* Upgraded pip to 6.0.1
* Properly restore an empty PS1 (#407)
12.0 (2014-12-22)
~~~~~~~~~~~~~~~~~
* Properly remove ``pydoc`` when deactivating
* **PROCESS** Version numbers are now simply ``X.Y`` where the leading ``1``
has been dropped.
* Split up documentation into structured pages
* Now using pytest framework
* Correct sys.path ordering for debian, issue #461
* Correctly throws error on older Pythons, issue #619
* Allow for empty $PATH, pull #601
* Don't set prompt if $env:VIRTUAL_ENV_DISABLE_PROMPT is set for Powershell
* Updated setuptools to 7.0
* Remove workaround for very old Mageia / Mandriva linuxes (PR #472)
1.11.6 (2014-05-16)
~~~~~~~~~~~~~~~~~~~
* Added a space after virtualenv name in the prompt: ``(env) $PS1``
* Updated setuptools to 3.6
* Updated pip to 1.5.6
* Make sure not to run a --user install when creating the virtualenv (PR #803)
1.11.5 (2014-05-03)
~~~~~~~~~~~~~~~~~~~
* Remove virtualenv file's path from directory when executing with a new
python. Fixes issue #779, #763 (PR #805)
* Updated setuptools to 3.4.4
* Updated documentation to use https://virtualenv.pypa.io/
* Updated pip to 1.5.5
* Remove use of () in .bat files so ``Program Files (x86)`` works #35
1.11.4 (2014-02-21)
~~~~~~~~~~~~~~~~~~~
* Download new releases of the preinstalled software from PyPI when there are
new releases available. This behavior can be disabled using
``--no-download``.
* Updated pip to 1.5.4
* Make ``--no-setuptools``, ``--no-pip``, and ``--no-wheel`` independent of
each other.
1.11.3 (2014-02-20)
~~~~~~~~~~~~~~~~~~~
* Updated setuptools to 2.2
* Updated pip to 1.5.3
1.11.2 (2014-01-26)
~~~~~~~~~~~~~~~~~~~
* Fixed easy_install installed virtualenvs by updated pip to 1.5.2
1.11.1 (2014-01-20)
~~~~~~~~~~~~~~~~~~~
* Fixed an issue where pip and setuptools were not getting installed when using
the ``--system-site-packages`` flag.
* Updated setuptools to fix an issue when installed with easy_install
* Fixed an issue with Python 3.4 and sys.stdout encoding being set to ascii
* Upgraded pip to v1.5.1
* Upgraded setuptools to v2.1
1.11 (2014-01-02)
~~~~~~~~~~~~~~~~~
* **BACKWARDS INCOMPATIBLE** Switched to using wheels for the bundled copies of
setuptools and pip. Using sdists is no longer supported - users supplying
their own versions of pip/setuptools will need to provide wheels.
* **BACKWARDS INCOMPATIBLE** Modified the handling of ``--extra-search-dirs``.
This option now works like pip's ``--find-links`` option, in that it adds
extra directories to search for compatible wheels for pip and setuptools.
The actual wheel selected is chosen based on version and compatibility, using
the same algorithm as ``pip install setuptools``.
* Fixed #495, --always-copy was failing (#PR 511)
* Upgraded pip to v1.5
* Upgraded setuptools to v1.4
1.10.1 (2013-08-07)
~~~~~~~~~~~~~~~~~~~
* **New Signing Key** Release 1.10.1 is using a different key than normal with
fingerprint: 7C6B 7C5D 5E2B 6356 A926 F04F 6E3C BCE9 3372 DCFA
* Upgraded pip to v1.4.1
* Upgraded setuptools to v0.9.8
1.10 (2013-07-23)
~~~~~~~~~~~~~~~~~
* **BACKWARDS INCOMPATIBLE** Dropped support for Python 2.5. The minimum
supported Python version is now Python 2.6.
* **BACKWARDS INCOMPATIBLE** Using ``virtualenv.py`` as an isolated script
(i.e. without an associated ``virtualenv_support`` directory) is no longer
supported for security reasons and will fail with an error.
Along with this, ``--never-download`` is now always pinned to ``True``, and
is only being maintained in the short term for backward compatibility
(Pull #412).
* **IMPORTANT** Switched to the new setuptools (v0.9.7) which has been merged
with Distribute_ again and works for Python 2 and 3 with one codebase.
The ``--distribute`` and ``--setuptools`` options are now no-op.
* Updated to pip 1.4.
* Added support for PyPy3k
* Added the option to use a version number with the ``-p`` option to get the
system copy of that Python version (Windows only)
* Removed embedded ``ez_setup.py``, ``distribute_setup.py`` and
``distribute_from_egg.py`` files as part of switching to merged setuptools.
* Fixed ``--relocatable`` to work better on Windows.
* Fixed issue with readline on Windows.
.. _Distribute: https://pypi.python.org/pypi/distribute
1.9.1 (2013-03-08)
~~~~~~~~~~~~~~~~~~
* Updated to pip 1.3.1 that fixed a major backward incompatible change of
parsing URLs to externally hosted packages that got accidentily included
in pip 1.3.
1.9 (2013-03-07)
~~~~~~~~~~~~~~~~
* Unset VIRTUAL_ENV environment variable in deactivate.bat (Pull #364)
* Upgraded distribute to 0.6.34.
* Added ``--no-setuptools`` and ``--no-pip`` options (Pull #336).
* Fixed Issue #373. virtualenv-1.8.4 was failing in cygwin (Pull #382).
* Fixed Issue #378. virtualenv is now "multiarch" aware on debian/ubuntu (Pull #379).
* Fixed issue with readline module path on pypy and OSX (Pull #374).
* Made 64bit detection compatible with Python 2.5 (Pull #393).
1.8.4 (2012-11-25)
~~~~~~~~~~~~~~~~~~
* Updated distribute to 0.6.31. This fixes #359 (numpy install regression) on
UTF-8 platforms, and provides a workaround on other platforms:
``PYTHONIOENCODING=utf8 pip install numpy``.
* When installing virtualenv via curl, don't forget to filter out arguments
the distribute setup script won't understand. Fixes #358.
* Added some more integration tests.
* Removed the unsupported embedded setuptools egg for Python 2.4 to reduce
file size.
1.8.3 (2012-11-21)
~~~~~~~~~~~~~~~~~~
* Fixed readline on OS X. Thanks minrk
* Updated distribute to 0.6.30 (improves our error reporting, plus new
distribute features and fixes). Thanks Gabriel (g2p)
* Added compatibility with multiarch Python (Python 3.3 for example). Added an
integration test. Thanks Gabriel (g2p)
* Added ability to install distribute from a user-provided egg, rather than the
bundled sdist, for better speed. Thanks Paul Moore.
* Make the creation of lib64 symlink smarter about already-existing symlink,
and more explicit about full paths. Fixes #334 and #330. Thanks Jeremy Orem.
* Give lib64 site-dir preference over lib on 64-bit systems, to avoid wrong
32-bit compiles in the venv. Fixes #328. Thanks Damien Nozay.
* Fix a bug with prompt-handling in ``activate.csh`` in non-interactive csh
shells. Fixes #332. Thanks Benjamin Root for report and patch.
* Make it possible to create a virtualenv from within a Python
3.3. pyvenv. Thanks Chris McDonough for the report.
* Add optional --setuptools option to be able to switch to it in case
distribute is the default (like in Debian).
1.8.2 (2012-09-06)
~~~~~~~~~~~~~~~~~~
* Updated the included pip version to 1.2.1 to fix regressions introduced
there in 1.2.
1.8.1 (2012-09-03)
~~~~~~~~~~~~~~~~~~
* Fixed distribute version used with `--never-download`. Thanks michr for
report and patch.
* Fix creating Python 3.3 based virtualenvs by unsetting the
``__PYVENV_LAUNCHER__`` environment variable in subprocesses.
1.8 (2012-09-01)
~~~~~~~~~~~~~~~~
* **Dropped support for Python 2.4** The minimum supported Python version is
now Python 2.5.
* Fix `--relocatable` on systems that use lib64. Fixes #78. Thanks Branden
Rolston.
* Symlink some additional modules under Python 3. Fixes #194. Thanks Vinay
Sajip, Ian Clelland, and Stefan Holek for the report.
* Fix ``--relocatable`` when a script uses ``__future__`` imports. Thanks
Branden Rolston.
* Fix a bug in the config option parser that prevented setting negative
options with environment variables. Thanks Ralf Schmitt.
* Allow setting ``--no-site-packages`` from the config file.
* Use ``/usr/bin/multiarch-platform`` if available to figure out the include
directory. Thanks for the patch, Mika Laitio.
* Fix ``install_name_tool`` replacement to work on Python 3.X.
* Handle paths of users' site-packages on Mac OS X correctly when changing
the prefix.
* Updated the embedded version of distribute to 0.6.28 and pip to 1.2.
1.7.2 (2012-06-22)
~~~~~~~~~~~~~~~~~~
* Updated to distribute 0.6.27.
* Fix activate.fish on OS X. Fixes #8. Thanks David Schoonover.
* Create a virtualenv-x.x script with the Python version when installing, so
virtualenv for multiple Python versions can be installed to the same
script location. Thanks Miki Tebeka.
* Restored ability to create a virtualenv with a path longer than 78
characters, without breaking creation of virtualenvs with non-ASCII paths.
Thanks, Bradley Ayers.
* Added ability to create virtualenvs without having installed Apple's
developers tools (using an own implementation of ``install_name_tool``).
Thanks Mike Hommey.
* Fixed PyPy and Jython support on Windows. Thanks Konstantin Zemlyak.
* Added pydoc script to ease use. Thanks Marc Abramowitz. Fixes #149.
* Fixed creating a bootstrap script on Python 3. Thanks Raul Leal. Fixes #280.
* Fixed inconsistency when having set the ``PYTHONDONTWRITEBYTECODE`` env var
with the --distribute option or the ``VIRTUALENV_USE_DISTRIBUTE`` env var.
``VIRTUALENV_USE_DISTRIBUTE`` is now considered again as a legacy alias.
1.7.1.2 (2012-02-17)
~~~~~~~~~~~~~~~~~~~~
* Fixed minor issue in `--relocatable`. Thanks, Cap Petschulat.
1.7.1.1 (2012-02-16)
~~~~~~~~~~~~~~~~~~~~
* Bumped the version string in ``virtualenv.py`` up, too.
* Fixed rST rendering bug of long description.
1.7.1 (2012-02-16)
~~~~~~~~~~~~~~~~~~
* Update embedded pip to version 1.1.
* Fix `--relocatable` under Python 3. Thanks Doug Hellmann.
* Added environ PATH modification to activate_this.py. Thanks Doug
Napoleone. Fixes #14.
* Support creating virtualenvs directly from a Python build directory on
Windows. Thanks CBWhiz. Fixes #139.
* Use non-recursive symlinks to fix things up for posix_local install
scheme. Thanks michr.
* Made activate script available for use with msys and cygwin on Windows.
Thanks Greg Haskins, Cliff Xuan, Jonathan Griffin and Doug Napoleone.
Fixes #176.
* Fixed creation of virtualenvs on Windows when Python is not installed for
all users. Thanks Anatoly Techtonik for report and patch and Doug
Napoleone for testing and confirmation. Fixes #87.
* Fixed creation of virtualenvs using -p in installs where some modules
that ought to be in the standard library (e.g. `readline`) are actually
installed in `site-packages` next to `virtualenv.py`. Thanks Greg Haskins
for report and fix. Fixes #167.
* Added activation script for Powershell (signed by Jannis Leidel). Many
thanks to Jason R. Coombs.
1.7 (2011-11-30)
~~~~~~~~~~~~~~~~
* Gave user-provided ``--extra-search-dir`` priority over default dirs for
finding setuptools/distribute (it already had priority for finding pip).
Thanks Ethan Jucovy.
* Updated embedded Distribute release to 0.6.24. Thanks Alex Gronholm.
* Made ``--no-site-packages`` behavior the default behavior. The
``--no-site-packages`` flag is still permitted, but displays a warning when
used. Thanks Chris McDonough.
* New flag: ``--system-site-packages``; this flag should be passed to get the
previous default global-site-package-including behavior back.
* Added ability to set command options as environment variables and options
in a ``virtualenv.ini`` file.
* Fixed various encoding related issues with paths. Thanks Gunnlaugur Thor Briem.
* Made ``virtualenv.py`` script executable.
1.6.4 (2011-07-21)
~~~~~~~~~~~~~~~~~~
* Restored ability to run on Python 2.4, too.
1.6.3 (2011-07-16)
~~~~~~~~~~~~~~~~~~
* Restored ability to run on Python < 2.7.
1.6.2 (2011-07-16)
~~~~~~~~~~~~~~~~~~
* Updated embedded distribute release to 0.6.19.
* Updated embedded pip release to 1.0.2.
* Fixed #141 - Be smarter about finding pkg_resources when using the
non-default Python interpreter (by using the ``-p`` option).
* Fixed #112 - Fixed path in docs.
* Fixed #109 - Corrected doctests of a Logger method.
* Fixed #118 - Fixed creating virtualenvs on platforms that use the
"posix_local" install scheme, such as Ubuntu with Python 2.7.
* Add missing library to Python 3 virtualenvs (``_dummy_thread``).
1.6.1 (2011-04-30)
~~~~~~~~~~~~~~~~~~
* Start to use git-flow.
* Added support for PyPy 1.5
* Fixed #121 -- added sanity-checking of the -p argument. Thanks Paul Nasrat.
* Added progress meter for pip installation as well as setuptools. Thanks Ethan
Jucovy.
* Added --never-download and --search-dir options. Thanks Ethan Jucovy.
1.6
~~~
* Added Python 3 support! Huge thanks to Vinay Sajip and Vitaly Babiy.
* Fixed creation of virtualenvs on Mac OS X when standard library modules
(readline) are installed outside the standard library.
* Updated bundled pip to 1.0.
1.5.2
~~~~~
* Moved main repository to Github: https://github.com/pypa/virtualenv
* Transferred primary maintenance from Ian to Jannis Leidel, Carl Meyer and Brian Rosner
* Fixed a few more pypy related bugs.
* Updated bundled pip to 0.8.2.
* Handed project over to new team of maintainers.
* Moved virtualenv to Github at https://github.com/pypa/virtualenv
1.5.1
~~~~~
* Added ``_weakrefset`` requirement for Python 2.7.1.
* Fixed Windows regression in 1.5
1.5
~~~
* Include pip 0.8.1.
* Add support for PyPy.
* Uses a proper temporary dir when installing environment requirements.
* Add ``--prompt`` option to be able to override the default prompt prefix.
* Fix an issue with ``--relocatable`` on Windows.
* Fix issue with installing the wrong version of distribute.
* Add fish and csh activate scripts.
1.4.9
~~~~~
* Include pip 0.7.2
1.4.8
~~~~~
* Fix for Mac OS X Framework builds that use
``--universal-archs=intel``
* Fix ``activate_this.py`` on Windows.
* Allow ``$PYTHONHOME`` to be set, so long as you use ``source
bin/activate`` it will get unset; if you leave it set and do not
activate the environment it will still break the environment.
* Include pip 0.7.1
1.4.7
~~~~~
* Include pip 0.7
1.4.6
~~~~~
* Allow ``activate.sh`` to skip updating the prompt (by setting
``$VIRTUAL_ENV_DISABLE_PROMPT``).
1.4.5
~~~~~
* Include pip 0.6.3
* Fix ``activate.bat`` and ``deactivate.bat`` under Windows when
``PATH`` contained a parenthesis
1.4.4
~~~~~
* Include pip 0.6.2 and Distribute 0.6.10
* Create the ``virtualenv`` script even when Setuptools isn't
installed
* Fix problem with ``virtualenv --relocate`` when ``bin/`` has
subdirectories (e.g., ``bin/.svn/``); from Alan Franzoni.
* If you set ``$VIRTUALENV_DISTRIBUTE`` then virtualenv will use
Distribute by default (so you don't have to remember to use
``--distribute``).
1.4.3
~~~~~
* Include pip 0.6.1
1.4.2
~~~~~
* Fix pip installation on Windows
* Fix use of stand-alone ``virtualenv.py`` (and boot scripts)
* Exclude ~/.local (user site-packages) from environments when using
``--no-site-packages``
1.4.1
~~~~~
* Include pip 0.6
1.4
~~~
* Updated setuptools to 0.6c11
* Added the --distribute option
* Fixed packaging problem of support-files
1.3.4
~~~~~
* Virtualenv now copies the actual embedded Python binary on
Mac OS X to fix a hang on Snow Leopard (10.6).
* Fail more gracefully on Windows when ``win32api`` is not installed.
* Fix site-packages taking precedent over Jython's ``__classpath__``
and also specially handle the new ``__pyclasspath__`` entry in
``sys.path``.
* Now copies Jython's ``registry`` file to the virtualenv if it exists.
* Better find libraries when compiling extensions on Windows.
* Create ``Scripts\pythonw.exe`` on Windows.
* Added support for the Debian/Ubuntu
``/usr/lib/pythonX.Y/dist-packages`` directory.
* Set ``distutils.sysconfig.get_config_vars()['LIBDIR']`` (based on
``sys.real_prefix``) which is reported to help building on Windows.
* Make ``deactivate`` work on ksh
* Fixes for ``--python``: make it work with ``--relocatable`` and the
symlink created to the exact Python version.
1.3.3
~~~~~
* Use Windows newlines in ``activate.bat``, which has been reported to help
when using non-ASCII directory names.
* Fixed compatibility with Jython 2.5b1.
* Added a function ``virtualenv.install_python`` for more fine-grained
access to what ``virtualenv.create_environment`` does.
* Fix `a problem <https://bugs.launchpad.net/virtualenv/+bug/241581>`_
with Windows and paths that contain spaces.
* If ``/path/to/env/.pydistutils.cfg`` exists (or
``/path/to/env/pydistutils.cfg`` on Windows systems) then ignore
``~/.pydistutils.cfg`` and use that other file instead.
* Fix ` a problem
<https://bugs.launchpad.net/virtualenv/+bug/340050>`_ picking up
some ``.so`` libraries in ``/usr/local``.
1.3.2
~~~~~
* Remove the ``[install] prefix = ...`` setting from the virtualenv
``distutils.cfg`` -- this has been causing problems for a lot of
people, in rather obscure ways.
* If you use a boot script it will attempt to import ``virtualenv``
and find a pre-downloaded Setuptools egg using that.
* Added platform-specific paths, like ``/usr/lib/pythonX.Y/plat-linux2``
1.3.1
~~~~~
* Real Python 2.6 compatibility. Backported the Python 2.6 updates to
``site.py``, including `user directories
<http://docs.python.org/dev/whatsnew/2.6.html#pep-370-per-user-site-packages-directory>`_
(this means older versions of Python will support user directories,
whether intended or not).
* Always set ``[install] prefix`` in ``distutils.cfg`` -- previously
on some platforms where a system-wide ``distutils.cfg`` was present
with a ``prefix`` setting, packages would be installed globally
(usually in ``/usr/local/lib/pythonX.Y/site-packages``).
* Sometimes Cygwin seems to leave ``.exe`` off ``sys.executable``; a
workaround is added.
* Fix ``--python`` option.
* Fixed handling of Jython environments that use a
jython-complete.jar.
1.3
~~~
* Update to Setuptools 0.6c9
* Added an option ``virtualenv --relocatable EXISTING_ENV``, which
will make an existing environment "relocatable" -- the paths will
not be absolute in scripts, ``.egg-info`` and ``.pth`` files. This
may assist in building environments that can be moved and copied.
You have to run this *after* any new packages installed.
* Added ``bin/activate_this.py``, a file you can use like
``execfile("path_to/activate_this.py",
dict(__file__="path_to/activate_this.py"))`` -- this will activate
the environment in place, similar to what `the mod_wsgi example
does <http://code.google.com/p/modwsgi/wiki/VirtualEnvironments>`_.
* For Mac framework builds of Python, the site-packages directory
``/Library/Python/X.Y/site-packages`` is added to ``sys.path``, from
Andrea Rech.
* Some platform-specific modules in Macs are added to the path now
(``plat-darwin/``, ``plat-mac/``, ``plat-mac/lib-scriptpackages``),
from Andrea Rech.
* Fixed a small Bashism in the ``bin/activate`` shell script.
* Added ``__future__`` to the list of required modules, for Python
2.3. You'll still need to backport your own ``subprocess`` module.
* Fixed the ``__classpath__`` entry in Jython's ``sys.path`` taking
precedent over virtualenv's libs.
1.2
~~~
* Added a ``--python`` option to select the Python interpreter.
* Add ``warnings`` to the modules copied over, for Python 2.6 support.
* Add ``sets`` to the module copied over for Python 2.3 (though Python
2.3 still probably doesn't work).
1.1.1
~~~~~
* Added support for Jython 2.5.
1.1
~~~
* Added support for Python 2.6.
* Fix a problem with missing ``DLLs/zlib.pyd`` on Windows. Create
* ``bin/python`` (or ``bin/python.exe``) even when you run virtualenv
with an interpreter named, e.g., ``python2.4``
* Fix MacPorts Python
* Added --unzip-setuptools option
* Update to Setuptools 0.6c8
* If the current directory is not writable, run ez_setup.py in ``/tmp``
* Copy or symlink over the ``include`` directory so that packages will
more consistently compile.
1.0
~~~
* Fix build on systems that use ``/usr/lib64``, distinct from
``/usr/lib`` (specifically CentOS x64).
* Fixed bug in ``--clear``.
* Fixed typos in ``deactivate.bat``.
* Preserve ``$PYTHONPATH`` when calling subprocesses.
0.9.2
~~~~~
* Fix include dir copying on Windows (makes compiling possible).
* Include the main ``lib-tk`` in the path.
* Patch ``distutils.sysconfig``: ``get_python_inc`` and
``get_python_lib`` to point to the global locations.
* Install ``distutils.cfg`` before Setuptools, so that system
customizations of ``distutils.cfg`` won't effect the installation.
* Add ``bin/pythonX.Y`` to the virtualenv (in addition to
``bin/python``).
* Fixed an issue with Mac Framework Python builds, and absolute paths
(from Ronald Oussoren).
0.9.1
~~~~~
* Improve ability to create a virtualenv from inside a virtualenv.
* Fix a little bug in ``bin/activate``.
* Actually get ``distutils.cfg`` to work reliably.
0.9
~~~
* Added ``lib-dynload`` and ``config`` to things that need to be
copied over in an environment.
* Copy over or symlink the ``include`` directory, so that you can
build packages that need the C headers.
* Include a ``distutils`` package, so you can locally update
``distutils.cfg`` (in ``lib/pythonX.Y/distutils/distutils.cfg``).
* Better avoid downloading Setuptools, and hitting PyPI on environment
creation.
* Fix a problem creating a ``lib64/`` directory.
* Should work on MacOSX Framework builds (the default Python
installations on Mac). Thanks to Ronald Oussoren.
0.8.4
~~~~~
* Windows installs would sometimes give errors about ``sys.prefix`` that
were inaccurate.
* Slightly prettier output.
0.8.3
~~~~~
* Added support for Windows.
0.8.2
~~~~~
* Give a better warning if you are on an unsupported platform (Mac
Framework Pythons, and Windows).
* Give error about running while inside a workingenv.
* Give better error message about Python 2.3.
0.8.1
~~~~~
Fixed packaging of the library.
0.8
~~~
Initial release. Everything is changed and new!
`Full Changelog <https://virtualenv.pypa.io/en/latest/changes.html>`_.
Keywords: setuptools deployment installation distutils
Platform: UNKNOWN
Classifier: Development Status :: 5 - Production/Stable
@ -837,3 +109,5 @@ Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.1
Classifier: Programming Language :: Python :: 3.2
Classifier: Programming Language :: Python :: 3.3
Classifier: Programming Language :: Python :: 3.4

View File

@ -1,10 +1,20 @@
virtualenv
==========
.. image:: https://pypip.in/v/virtualenv/badge.png
.. image:: https://img.shields.io/pypi/v/virtualenv.svg
:target: https://pypi.python.org/pypi/virtualenv
.. image:: https://secure.travis-ci.org/pypa/virtualenv.png?branch=develop
.. image:: https://img.shields.io/travis/pypa/virtualenv/develop.svg
:target: http://travis-ci.org/pypa/virtualenv
For documentation, see https://virtualenv.pypa.io/
Code of Conduct
---------------
Everyone interacting in the virtualenv project's codebases, issue trackers,
chat rooms, and mailing lists is expected to follow the
`PyPA Code of Conduct`_.
.. _PyPA Code of Conduct: https://www.pypa.io/en/latest/code-of-conduct/

View File

@ -2,70 +2,72 @@
"""
Helper script to rebuild virtualenv.py from virtualenv_support
"""
from __future__ import print_function
import re
import os
import sys
import re
import codecs
from zlib import crc32
here = os.path.dirname(__file__)
script = os.path.join(here, '..', 'virtualenv.py')
file_regex = re.compile(
r'##file (.*?)\n([a-zA-Z][a-zA-Z0-9_]+)\s*=\s*convert\("""(.*?)"""\)',
re.S)
file_template = '##file %(filename)s\n%(varname)s = convert("""\n%(data)s""")'
gzip = codecs.lookup('zlib')
b64 = codecs.lookup('base64')
def rebuild():
f = open(script, 'rb')
content = f.read()
f.close()
file_regex = re.compile(
br'##file (.*?)\n([a-zA-Z][a-zA-Z0-9_]+)\s*=\s*convert\("""\n(.*?)"""\)',
re.S)
file_template = b'##file %(filename)s\n%(varname)s = convert("""\n%(data)s""")'
def rebuild(script_path):
with open(script_path, 'rb') as f:
script_content = f.read()
parts = []
last_pos = 0
match = None
for match in file_regex.finditer(content):
parts.append(content[last_pos:match.start()])
for match in file_regex.finditer(script_content):
parts += [script_content[last_pos:match.start()]]
last_pos = match.end()
filename = match.group(1)
filename, fn_decoded = match.group(1), match.group(1).decode()
varname = match.group(2)
data = match.group(3)
print('Found reference to file %s' % filename)
pathname = os.path.join(here, '..', 'virtualenv_embedded', filename)
f = open(pathname, 'rb')
c = f.read()
f.close()
new_data = c.encode('zlib').encode('base64')
print('Found file %s' % fn_decoded)
pathname = os.path.join(here, '..', 'virtualenv_embedded', fn_decoded)
with open(pathname, 'rb') as f:
embedded = f.read()
new_crc = crc32(embedded)
new_data = b64.encode(gzip.encode(embedded)[0])[0]
if new_data == data:
print(' Reference up to date (%s bytes)' % len(c))
parts.append(match.group(0))
print(' File up to date (crc: %s)' % new_crc)
parts += [match.group(0)]
continue
print(' Content changed (%s bytes -> %s bytes)' % (
zipped_len(data), len(c)))
new_match = file_template % dict(
filename=filename,
varname=varname,
data=new_data)
parts.append(new_match)
parts.append(content[last_pos:])
new_content = ''.join(parts)
if new_content != content:
sys.stdout.write('Content updated; overwriting... ')
f = open(script, 'wb')
f.write(new_content)
f.close()
# Else: content has changed
crc = crc32(gzip.decode(b64.decode(data)[0])[0])
print(' Content changed (crc: %s -> %s)' %
(crc, new_crc))
new_match = file_template % {
b'filename': filename,
b'varname': varname,
b'data': new_data
}
parts += [new_match]
parts += [script_content[last_pos:]]
new_content = b''.join(parts)
if new_content != script_content:
print('Content updated; overwriting... ', end='')
with open(script_path, 'wb') as f:
f.write(new_content)
print('done.')
else:
print('No changes in content')
if match is None:
print('No variables were matched/found')
def zipped_len(data):
if not data:
return 'no data'
try:
return len(data.decode('base64').decode('zlib'))
except:
return 'unknown'
if __name__ == '__main__':
rebuild()
rebuild(script)

View File

@ -1,24 +1,158 @@
Release History
===============
14.0.1 (2016-01-21)
-------------------
* Upgrade from pip 8.0.0 to 8.0.2.
* Fix the default of ``--(no-)download`` to default to downloading.
14.0.0 (2016-01-19)
-------------------
* **BACKWARDS INCOMPATIBLE** Drop support for Python 3.2.
* Upgrade setuptools to 19.4
* Upgrade wheel to 0.26.0
* Upgrade pip to 8.0.0
* Upgrade argparse to 1.4.0
* Added support for ``python-config`` script (:pull:`798`)
* Updated activate.fish (:pull:`589`) (:pull:`799`)
* Account for a ``site.pyo`` correctly in some python implementations (:pull:`759`)
* Properly restore an empty PS1 (:issue:`407`)
* Properly remove ``pydoc`` when deactivating
* Remove workaround for very old Mageia / Mandriva linuxes (:pull:`472`)
* Added a space after virtualenv name in the prompt: ``(env) $PS1``
* Make sure not to run a --user install when creating the virtualenv (:pull:`803`)
* Remove virtualenv file's path from directory when executing with a new
python. Fixes issue :issue:`779`, :issue:`763` (:pull:`805`)
* Remove use of () in .bat files so ``Program Files (x86)`` works :issue:`35`
* Download new releases of the preinstalled software from PyPI when there are
new releases available. This behavior can be disabled using
``--no-download``.
* Make ``--no-setuptools``, ``--no-pip``, and ``--no-wheel`` independent of
each other.
13.1.2 (2015-08-23)
-------------------
* Upgrade pip to 7.1.2.
13.1.1 (2015-08-20)
-------------------
* Upgrade pip to 7.1.1.
* Upgrade setuptools to 18.2.
* Make the activate script safe to use when bash is running with ``-u``.
13.1.0 (2015-06-30)
-------------------
* Upgrade pip to 7.1.0
* Upgrade setuptools to 18.0.1
13.0.3 (2015-06-01)
-------------------
* Upgrade pip to 7.0.3
13.0.2 (2015-06-01)
-------------------
* Upgrade pip to 7.0.2
* Upgrade setuptools to 17.0
13.0.1 (2015-05-22)
-------------------
* Upgrade pip to 7.0.1
13.0.0 (2015-05-21)
-------------------
* Automatically install wheel when creating a new virutalenv. This can be
disabled by using the ``--no-wheel`` option.
* Don't trust the current directory as a location to discover files to install
packages from.
* Upgrade setuptools to 16.0.
* Upgrade pip to 7.0.0.
12.1.1 (2015-04-07)
-------------------
* Upgrade pip to 6.1.1
12.1.0 (2015-04-07)
-------------------
* Upgrade setuptools to 15.0
* Upgrade pip to 6.1.0
12.0.7 (2015-02-04)
-------------------
* Upgrade pip to 6.0.8
12.0.6 (2015-01-28)
-------------------
* Upgrade pip to 6.0.7
* Upgrade setuptools to 12.0.5
12.0.5 (2015-01-03)
~~~~~~~~~~~~~~~~~~~
-------------------
* Upgrade pip to 6.0.6
* Upgrade setuptools to 11.0
12.0.4 (2014-22-23)
~~~~~~~~~~~~~~~~~~~
12.0.4 (2014-12-23)
-------------------
* Revert the fix to ``-p`` on Debian based pythons as it was broken in other
situations.
* Revert several sys.path changes new in 12.0 which were breaking virtualenv.
12.0.3 (2014-22-23)
~~~~~~~~~~~~~~~~~~~
12.0.3 (2014-12-23)
-------------------
* Fix an issue where Debian based Pythons would fail when using -p with the
host Python.
@ -26,17 +160,18 @@ Release History
* Upgrade pip to 6.0.3
12.0.2 (2014-12-23)
~~~~~~~~~~~~~~~~~~~
-------------------
* Upgraded pip to 6.0.2
12.0.1 (2014-12-22)
~~~~~~~~~~~~~~~~~~~
-------------------
* Upgraded pip to 6.0.1
12.0 (2014-12-22)
~~~~~~~~~~~~~~~~~
-----------------
* **PROCESS** Version numbers are now simply ``X.Y`` where the leading ``1``
has been dropped.
@ -49,38 +184,38 @@ Release History
* Updated setuptools to 7.0
1.11.6 (2014-05-16)
~~~~~~~~~~~~~~~~~~~
-------------------
* Updated setuptools to 3.6
* Updated pip to 1.5.6
1.11.5 (2014-05-03)
~~~~~~~~~~~~~~~~~~~
-------------------
* Updated setuptools to 3.4.4
* Updated documentation to use https://virtualenv.pypa.io/
* Updated pip to 1.5.5
1.11.4 (2014-02-21)
~~~~~~~~~~~~~~~~~~~
-------------------
* Updated pip to 1.5.4
1.11.3 (2014-02-20)
~~~~~~~~~~~~~~~~~~~
-------------------
* Updated setuptools to 2.2
* Updated pip to 1.5.3
1.11.2 (2014-01-26)
~~~~~~~~~~~~~~~~~~~
-------------------
* Fixed easy_install installed virtualenvs by updated pip to 1.5.2
1.11.1 (2014-01-20)
~~~~~~~~~~~~~~~~~~~
-------------------
* Fixed an issue where pip and setuptools were not getting installed when using
the ``--system-site-packages`` flag.
@ -90,7 +225,7 @@ Release History
* Upgraded setuptools to v2.1
1.11 (2014-01-02)
~~~~~~~~~~~~~~~~~
-----------------
* **BACKWARDS INCOMPATIBLE** Switched to using wheels for the bundled copies of
setuptools and pip. Using sdists is no longer supported - users supplying
@ -105,7 +240,7 @@ Release History
* Upgraded setuptools to v1.4
1.10.1 (2013-08-07)
~~~~~~~~~~~~~~~~~~~
-------------------
* **New Signing Key** Release 1.10.1 is using a different key than normal with
fingerprint: 7C6B 7C5D 5E2B 6356 A926 F04F 6E3C BCE9 3372 DCFA
@ -114,7 +249,7 @@ Release History
1.10 (2013-07-23)
~~~~~~~~~~~~~~~~~
-----------------
* **BACKWARDS INCOMPATIBLE** Dropped support for Python 2.5. The minimum
supported Python version is now Python 2.6.
@ -148,14 +283,14 @@ Release History
.. _Distribute: https://pypi.python.org/pypi/distribute
1.9.1 (2013-03-08)
~~~~~~~~~~~~~~~~~~
------------------
* Updated to pip 1.3.1 that fixed a major backward incompatible change of
parsing URLs to externally hosted packages that got accidentily included
in pip 1.3.
1.9 (2013-03-07)
~~~~~~~~~~~~~~~~
----------------
* Unset VIRTUAL_ENV environment variable in deactivate.bat (Pull #364)
* Upgraded distribute to 0.6.34.
@ -167,7 +302,7 @@ Release History
1.8.4 (2012-11-25)
~~~~~~~~~~~~~~~~~~
------------------
* Updated distribute to 0.6.31. This fixes #359 (numpy install regression) on
UTF-8 platforms, and provides a workaround on other platforms:
@ -182,7 +317,7 @@ Release History
file size.
1.8.3 (2012-11-21)
~~~~~~~~~~~~~~~~~~
------------------
* Fixed readline on OS X. Thanks minrk
@ -211,14 +346,14 @@ Release History
distribute is the default (like in Debian).
1.8.2 (2012-09-06)
~~~~~~~~~~~~~~~~~~
------------------
* Updated the included pip version to 1.2.1 to fix regressions introduced
there in 1.2.
1.8.1 (2012-09-03)
~~~~~~~~~~~~~~~~~~
------------------
* Fixed distribute version used with `--never-download`. Thanks michr for
report and patch.
@ -228,7 +363,7 @@ Release History
1.8 (2012-09-01)
~~~~~~~~~~~~~~~~
----------------
* **Dropped support for Python 2.4** The minimum supported Python version is
now Python 2.5.
@ -259,7 +394,7 @@ Release History
1.7.2 (2012-06-22)
~~~~~~~~~~~~~~~~~~
------------------
* Updated to distribute 0.6.27.
@ -289,13 +424,13 @@ Release History
1.7.1.2 (2012-02-17)
~~~~~~~~~~~~~~~~~~~~
--------------------
* Fixed minor issue in `--relocatable`. Thanks, Cap Petschulat.
1.7.1.1 (2012-02-16)
~~~~~~~~~~~~~~~~~~~~
--------------------
* Bumped the version string in ``virtualenv.py`` up, too.
@ -303,7 +438,7 @@ Release History
1.7.1 (2012-02-16)
~~~~~~~~~~~~~~~~~~
------------------
* Update embedded pip to version 1.1.
@ -336,7 +471,7 @@ Release History
1.7 (2011-11-30)
~~~~~~~~~~~~~~~~
----------------
* Gave user-provided ``--extra-search-dir`` priority over default dirs for
finding setuptools/distribute (it already had priority for finding pip).
@ -360,19 +495,19 @@ Release History
1.6.4 (2011-07-21)
~~~~~~~~~~~~~~~~~~
------------------
* Restored ability to run on Python 2.4, too.
1.6.3 (2011-07-16)
~~~~~~~~~~~~~~~~~~
------------------
* Restored ability to run on Python < 2.7.
1.6.2 (2011-07-16)
~~~~~~~~~~~~~~~~~~
------------------
* Updated embedded distribute release to 0.6.19.
@ -392,7 +527,7 @@ Release History
1.6.1 (2011-04-30)
~~~~~~~~~~~~~~~~~~
------------------
* Start to use git-flow.
@ -407,7 +542,7 @@ Release History
1.6
~~~
---
* Added Python 3 support! Huge thanks to Vinay Sajip and Vitaly Babiy.
@ -418,7 +553,7 @@ Release History
1.5.2
~~~~~
-----
* Moved main repository to Github: https://github.com/pypa/virtualenv
@ -434,7 +569,7 @@ Release History
1.5.1
~~~~~
-----
* Added ``_weakrefset`` requirement for Python 2.7.1.
@ -442,7 +577,7 @@ Release History
1.5
~~~
---
* Include pip 0.8.1.
@ -460,13 +595,13 @@ Release History
1.4.9
~~~~~
-----
* Include pip 0.7.2
1.4.8
~~~~~
-----
* Fix for Mac OS X Framework builds that use
``--universal-archs=intel``
@ -481,20 +616,20 @@ Release History
1.4.7
~~~~~
-----
* Include pip 0.7
1.4.6
~~~~~
-----
* Allow ``activate.sh`` to skip updating the prompt (by setting
``$VIRTUAL_ENV_DISABLE_PROMPT``).
1.4.5
~~~~~
-----
* Include pip 0.6.3
@ -503,7 +638,7 @@ Release History
1.4.4
~~~~~
-----
* Include pip 0.6.2 and Distribute 0.6.10
@ -519,13 +654,13 @@ Release History
1.4.3
~~~~~
-----
* Include pip 0.6.1
1.4.2
~~~~~
-----
* Fix pip installation on Windows
@ -536,13 +671,13 @@ Release History
1.4.1
~~~~~
-----
* Include pip 0.6
1.4
~~~
---
* Updated setuptools to 0.6c11
@ -552,7 +687,7 @@ Release History
1.3.4
~~~~~
-----
* Virtualenv now copies the actual embedded Python binary on
Mac OS X to fix a hang on Snow Leopard (10.6).
@ -582,7 +717,7 @@ Release History
1.3.3
~~~~~
-----
* Use Windows newlines in ``activate.bat``, which has been reported to help
when using non-ASCII directory names.
@ -605,7 +740,7 @@ Release History
1.3.2
~~~~~
-----
* Remove the ``[install] prefix = ...`` setting from the virtualenv
``distutils.cfg`` -- this has been causing problems for a lot of
@ -618,7 +753,7 @@ Release History
1.3.1
~~~~~
-----
* Real Python 2.6 compatibility. Backported the Python 2.6 updates to
``site.py``, including `user directories
@ -641,7 +776,7 @@ Release History
1.3
~~~
---
* Update to Setuptools 0.6c9
* Added an option ``virtualenv --relocatable EXISTING_ENV``, which
@ -668,7 +803,7 @@ Release History
1.2
~~~
---
* Added a ``--python`` option to select the Python interpreter.
* Add ``warnings`` to the modules copied over, for Python 2.6 support.
@ -677,13 +812,13 @@ Release History
1.1.1
~~~~~
-----
* Added support for Jython 2.5.
1.1
~~~
---
* Added support for Python 2.6.
* Fix a problem with missing ``DLLs/zlib.pyd`` on Windows. Create
@ -698,7 +833,7 @@ Release History
1.0
~~~
---
* Fix build on systems that use ``/usr/lib64``, distinct from
``/usr/lib`` (specifically CentOS x64).
@ -708,7 +843,7 @@ Release History
0.9.2
~~~~~
-----
* Fix include dir copying on Windows (makes compiling possible).
* Include the main ``lib-tk`` in the path.
@ -723,7 +858,7 @@ Release History
0.9.1
~~~~~
-----
* Improve ability to create a virtualenv from inside a virtualenv.
* Fix a little bug in ``bin/activate``.
@ -731,7 +866,7 @@ Release History
0.9
~~~
---
* Added ``lib-dynload`` and ``config`` to things that need to be
copied over in an environment.
@ -747,7 +882,7 @@ Release History
0.8.4
~~~~~
-----
* Windows installs would sometimes give errors about ``sys.prefix`` that
were inaccurate.
@ -755,13 +890,13 @@ Release History
0.8.3
~~~~~
-----
* Added support for Windows.
0.8.2
~~~~~
-----
* Give a better warning if you are on an unsupported platform (Mac
Framework Pythons, and Windows).
@ -770,12 +905,12 @@ Release History
0.8.1
~~~~~
-----
Fixed packaging of the library.
0.8
~~~
---
Initial release. Everything is changed and new!

View File

@ -24,10 +24,9 @@ sys.path.insert(0, os.path.abspath(os.pardir))
# Add any Sphinx extension module names here, as strings. They can be extensions
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
extensions = ['sphinx.ext.autodoc']
extensions = ['sphinx.ext.autodoc', 'sphinx.ext.extlinks']
# Add any paths that contain templates here, relative to this directory.
## FIXME: disabled for now because I haven't figured out how to use this:
#templates_path = ['_templates']
# The suffix of source filenames.
@ -74,6 +73,11 @@ unused_docs = []
# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx'
extlinks = {
'issue': ('https://github.com/pypa/virtualenv/issues/%s', '#'),
'pull': ('https://github.com/pypa/virtualenv/pull/%s', 'PR #'),
}
# Options for HTML output
# -----------------------

View File

@ -77,8 +77,8 @@ Other Documentation and Links
He also wrote `an example of using virtualenv to try IPython`__.
.. _virtualenvwrapper: https://pypi.python.org/pypi/virtualenvwrapper/
.. __: http://www.doughellmann.com/articles/CompletelyDifferent-2008-05-virtualenvwrapper/index.html
.. __: http://www.doughellmann.com/articles/CompletelyDifferent-2008-02-ipython-and-virtualenv/index.html
.. __: https://doughellmann.com/blog/2008/05/01/virtualenvwrapper/
.. __: https://doughellmann.com/blog/2008/02/01/ipython-and-virtualenv/
* `Pew`_ is another wrapper for virtualenv that makes use of a different
activation technique.

View File

@ -69,13 +69,16 @@ Options
.. option:: --no-setuptools
Do not install setuptools (or pip) in the new
virtualenv.
Do not install setuptools in the new virtualenv.
.. option:: --no-pip
Do not install pip in the new virtualenv.
.. option:: --no-wheel
Do not install wheel in the new virtualenv.
.. option:: --extra-search-dir=DIR
Directory to look for setuptools/pip distributions in.
@ -86,11 +89,13 @@ Options
Provides an alternative prompt prefix for this
environment.
.. option:: --never-download
.. option:: --download
DEPRECATED. Retained only for backward compatibility.
This option has no effect. Virtualenv never downloads
pip or setuptools.
Download preinstalled packages from PyPI.
.. option:: --no-download
Do not download preinstalled packages from PyPI.
.. option:: --no-site-packages

View File

@ -125,6 +125,15 @@ below.
.. _`execution policies`: http://technet.microsoft.com/en-us/library/dd347641.aspx
Removing an Environment
~~~~~~~~~~~~~~~~~~~~~~~
Removing a virtual environment is simply done by deactivating it and deleting the
environment folder with all its contents::
(ENV)$ deactivate
$ rm -r /path/to/ENV
The :option:`--system-site-packages` Option
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@ -245,5 +254,3 @@ As well as the extra directories, the search order includes:
#. The directory where virtualenv.py is located.
#. The current directory.
If no satisfactory local distributions are found, virtualenv will
fail. Virtualenv will never download packages.

View File

@ -1,5 +1,8 @@
[wheel]
universal = 1
[egg_info]
tag_build =
tag_svn_revision = 0
tag_date = 0
tag_build =

View File

@ -15,18 +15,17 @@ try:
def initialize_options(self):
TestCommand.initialize_options(self)
self.pytest_args = None
self.pytest_args = []
def finalize_options(self):
TestCommand.finalize_options(self)
self.test_args = []
self.test_suite = True
#self.test_args = []
#self.test_suite = True
def run_tests(self):
# import here, because outside the eggs aren't loaded
import pytest
errno = pytest.main(self.pytest_args)
sys.exit(errno)
sys.exit(pytest.main(self.pytest_args))
setup_params = {
'entry_points': {
@ -61,7 +60,24 @@ def read_file(*paths):
long_description = read_file('docs', 'index.rst')
long_description = long_description.strip().split('split here', 1)[0]
# Add release history
long_description += "\n\n" + read_file('docs', 'changes.rst')
changes = read_file('docs', 'changes.rst')
# Only report last two releases for brevity
releases_found = 0
change_lines = []
for line in changes.splitlines():
change_lines.append(line)
if line.startswith('--------------'):
releases_found += 1
if releases_found > 2:
break
changes = '\n'.join(change_lines[:-2]) + '\n'
changes += '`Full Changelog <https://virtualenv.pypa.io/en/latest/changes.html>`_.'
# Replace issue/pull directives
changes = re.sub(r':pull:`(\d+)`', r'PR #\1', changes)
changes = re.sub(r':issue:`(\d+)`', r'#\1', changes)
long_description += '\n\n' + changes
def get_version():
@ -97,6 +113,8 @@ setup(
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.1',
'Programming Language :: Python :: 3.2',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
],
keywords='setuptools deployment installation distutils',
author='Ian Bicking',

View File

View File

@ -0,0 +1,96 @@
#!/bin/sh
set -u
ROOT="$(dirname $0)/.."
VIRTUALENV="${ROOT}/virtualenv.py"
TESTENV="/tmp/test_virtualenv_activate.venv"
rm -rf ${TESTENV}
echo "$0: Creating virtualenv ${TESTENV}..." 1>&2
${VIRTUALENV} ${TESTENV} | tee ${ROOT}/tests/test_activate_output.actual
if ! diff ${ROOT}/tests/test_activate_output.expected ${ROOT}/tests/test_activate_output.actual; then
echo "$0: Failed to get expected output from ${VIRTUALENV}!" 1>&2
exit 1
fi
echo "$0: Created virtualenv ${TESTENV}." 1>&2
echo "$0: Activating ${TESTENV}..." 1>&2
. ${TESTENV}/bin/activate
echo "$0: Activated ${TESTENV}." 1>&2
echo "$0: Checking value of \$VIRTUAL_ENV..." 1>&2
if [ "$VIRTUAL_ENV" != "${TESTENV}" ]; then
echo "$0: Expected \$VIRTUAL_ENV to be set to \"${TESTENV}\"; actual value: \"${VIRTUAL_ENV}\"!" 1>&2
exit 2
fi
echo "$0: \$VIRTUAL_ENV = \"${VIRTUAL_ENV}\" -- OK." 1>&2
echo "$0: Checking output of \$(which python)..." 1>&2
if [ "$(which python)" != "${TESTENV}/bin/python" ]; then
echo "$0: Expected \$(which python) to return \"${TESTENV}/bin/python\"; actual value: \"$(which python)\"!" 1>&2
exit 3
fi
echo "$0: Output of \$(which python) is OK." 1>&2
echo "$0: Checking output of \$(which pip)..." 1>&2
if [ "$(which pip)" != "${TESTENV}/bin/pip" ]; then
echo "$0: Expected \$(which pip) to return \"${TESTENV}/bin/pip\"; actual value: \"$(which pip)\"!" 1>&2
exit 4
fi
echo "$0: Output of \$(which pip) is OK." 1>&2
echo "$0: Checking output of \$(which easy_install)..." 1>&2
if [ "$(which easy_install)" != "${TESTENV}/bin/easy_install" ]; then
echo "$0: Expected \$(which easy_install) to return \"${TESTENV}/bin/easy_install\"; actual value: \"$(which easy_install)\"!" 1>&2
exit 5
fi
echo "$0: Output of \$(which easy_install) is OK." 1>&2
echo "$0: Executing a simple Python program..." 1>&2
TESTENV=${TESTENV} python <<__END__
import os, sys
expected_site_packages = os.path.join(os.environ['TESTENV'], 'lib','python%s' % sys.version[:3], 'site-packages')
site_packages = os.path.join(os.environ['VIRTUAL_ENV'], 'lib', 'python%s' % sys.version[:3], 'site-packages')
assert site_packages == expected_site_packages, 'site_packages did not have expected value; actual value: %r' % site_packages
open(os.path.join(site_packages, 'pydoc_test.py'), 'w').write('"""This is pydoc_test.py"""\n')
__END__
if [ $? -ne 0 ]; then
echo "$0: Python script failed!" 1>&2
exit 6
fi
echo "$0: Execution of a simple Python program -- OK." 1>&2
echo "$0: Testing pydoc..." 1>&2
if ! PAGER=cat pydoc pydoc_test | grep 'This is pydoc_test.py' > /dev/null; then
echo "$0: pydoc test failed!" 1>&2
exit 7
fi
echo "$0: pydoc is OK." 1>&2
echo "$0: Deactivating ${TESTENV}..." 1>&2
deactivate
echo "$0: Deactivated ${TESTENV}." 1>&2
echo "$0: OK!" 1>&2
rm -rf ${TESTENV}

View File

@ -0,0 +1,2 @@
New python executable in /tmp/test_virtualenv_activate.venv/bin/python
Installing setuptools, pip, wheel...done.

View File

@ -0,0 +1,139 @@
import virtualenv
import optparse
import os
import shutil
import sys
import tempfile
import pytest
import platform # noqa
from mock import patch, Mock
def test_version():
"""Should have a version string"""
assert virtualenv.virtualenv_version, "Should have version"
@patch('os.path.exists')
def test_resolve_interpreter_with_absolute_path(mock_exists):
"""Should return absolute path if given and exists"""
mock_exists.return_value = True
virtualenv.is_executable = Mock(return_value=True)
test_abs_path = os.path.abspath("/usr/bin/python53")
exe = virtualenv.resolve_interpreter(test_abs_path)
assert exe == test_abs_path, "Absolute path should return as is"
mock_exists.assert_called_with(test_abs_path)
virtualenv.is_executable.assert_called_with(test_abs_path)
@patch('os.path.exists')
def test_resolve_interpreter_with_nonexistent_interpreter(mock_exists):
"""Should SystemExit with an nonexistent python interpreter path"""
mock_exists.return_value = False
with pytest.raises(SystemExit):
virtualenv.resolve_interpreter("/usr/bin/python53")
mock_exists.assert_called_with("/usr/bin/python53")
@patch('os.path.exists')
def test_resolve_interpreter_with_invalid_interpreter(mock_exists):
"""Should exit when with absolute path if not exists"""
mock_exists.return_value = True
virtualenv.is_executable = Mock(return_value=False)
invalid = os.path.abspath("/usr/bin/pyt_hon53")
with pytest.raises(SystemExit):
virtualenv.resolve_interpreter(invalid)
mock_exists.assert_called_with(invalid)
virtualenv.is_executable.assert_called_with(invalid)
def test_activate_after_future_statements():
"""Should insert activation line after last future statement"""
script = [
'#!/usr/bin/env python',
'from __future__ import with_statement',
'from __future__ import print_function',
'print("Hello, world!")'
]
assert virtualenv.relative_script(script) == [
'#!/usr/bin/env python',
'from __future__ import with_statement',
'from __future__ import print_function',
'',
"import os; activate_this=os.path.join(os.path.dirname(os.path.realpath(__file__)), 'activate_this.py'); exec(compile(open(activate_this).read(), activate_this, 'exec'), dict(__file__=activate_this)); del os, activate_this",
'',
'print("Hello, world!")'
]
def test_cop_update_defaults_with_store_false():
"""store_false options need reverted logic"""
class MyConfigOptionParser(virtualenv.ConfigOptionParser):
def __init__(self, *args, **kwargs):
self.config = virtualenv.ConfigParser.RawConfigParser()
self.files = []
optparse.OptionParser.__init__(self, *args, **kwargs)
def get_environ_vars(self, prefix='VIRTUALENV_'):
yield ("no_site_packages", "1")
cop = MyConfigOptionParser()
cop.add_option(
'--no-site-packages',
dest='system_site_packages',
action='store_false',
help="Don't give access to the global site-packages dir to the "
"virtual environment (default)")
defaults = {}
cop.update_defaults(defaults)
assert defaults == {'system_site_packages': 0}
def test_install_python_bin():
"""Should create the right python executables and links"""
tmp_virtualenv = tempfile.mkdtemp()
try:
home_dir, lib_dir, inc_dir, bin_dir = \
virtualenv.path_locations(tmp_virtualenv)
virtualenv.install_python(home_dir, lib_dir, inc_dir, bin_dir, False,
False)
if virtualenv.is_win:
required_executables = [ 'python.exe', 'pythonw.exe']
else:
py_exe_no_version = 'python'
py_exe_version_major = 'python%s' % sys.version_info[0]
py_exe_version_major_minor = 'python%s.%s' % (
sys.version_info[0], sys.version_info[1])
required_executables = [ py_exe_no_version, py_exe_version_major,
py_exe_version_major_minor ]
for pth in required_executables:
assert os.path.exists(os.path.join(bin_dir, pth)), ("%s should "
"exist in bin_dir" % pth)
finally:
shutil.rmtree(tmp_virtualenv)
@pytest.mark.skipif("platform.python_implementation() == 'PyPy'")
def test_always_copy_option():
"""Should be no symlinks in directory tree"""
tmp_virtualenv = tempfile.mkdtemp()
ve_path = os.path.join(tmp_virtualenv, 'venv')
try:
virtualenv.create_environment(ve_path, symlink=False)
for root, dirs, files in os.walk(tmp_virtualenv):
for f in files + dirs:
full_name = os.path.join(root, f)
assert not os.path.islink(full_name), "%s should not be a" \
" symlink (to %s)" % (full_name, os.readlink(full_name))
finally:
shutil.rmtree(tmp_virtualenv)

View File

@ -1,27 +1,40 @@
#!/usr/bin/env python
"""Create a "virtual" Python installation
"""
"""Create a "virtual" Python installation"""
__version__ = "12.0.5"
virtualenv_version = __version__ # legacy
import os
import sys
# If we are running in a new interpreter to create a virtualenv,
# we do NOT want paths from our existing location interfering with anything,
# So we remove this file's directory from sys.path - most likely to be
# the previous interpreter's site-packages. Solves #705, #763, #779
if os.environ.get('VIRTUALENV_INTERPRETER_RUNNING'):
for path in sys.path[:]:
if os.path.realpath(os.path.dirname(__file__)) == os.path.realpath(path):
sys.path.remove(path)
import base64
import sys
import os
import codecs
import optparse
import re
import shutil
import logging
import tempfile
import zlib
import errno
import glob
import distutils.sysconfig
from distutils.util import strtobool
import struct
import subprocess
import tarfile
from distutils.util import strtobool
from os.path import join
try:
import ConfigParser
except ImportError:
import configparser as ConfigParser
__version__ = "14.0.1"
virtualenv_version = __version__ # legacy
if sys.version_info < (2, 6):
print('ERROR: %s' % sys.exc_info()[1])
@ -33,12 +46,6 @@ try:
except NameError:
basestring = str
try:
import ConfigParser
except ImportError:
import configparser as ConfigParser
join = os.path.join
py_version = 'python%s.%s' % (sys.version_info[0], sys.version_info[1])
is_jython = sys.platform.startswith('java')
@ -76,7 +83,7 @@ else:
def get_installed_pythons():
try:
python_core = winreg.CreateKey(winreg.HKEY_LOCAL_MACHINE,
"Software\\Python\\PythonCore")
"Software\\Python\\PythonCore")
except WindowsError:
# No registered Python installations
return {}
@ -123,168 +130,21 @@ if majver == 2:
elif majver == 3:
# Some extra modules are needed for Python 3, but different ones
# for different versions.
REQUIRED_MODULES.extend(['_abcoll', 'warnings', 'linecache', 'abc', 'io',
'_weakrefset', 'copyreg', 'tempfile', 'random',
'__future__', 'collections', 'keyword', 'tarfile',
'shutil', 'struct', 'copy', 'tokenize', 'token',
'functools', 'heapq', 'bisect', 'weakref',
'reprlib'])
REQUIRED_MODULES.extend([
'_abcoll', 'warnings', 'linecache', 'abc', 'io', '_weakrefset',
'copyreg', 'tempfile', 'random', '__future__', 'collections',
'keyword', 'tarfile', 'shutil', 'struct', 'copy', 'tokenize',
'token', 'functools', 'heapq', 'bisect', 'weakref', 'reprlib'
])
if minver >= 2:
REQUIRED_FILES[-1] = 'config-%s' % majver
if minver >= 3:
import sysconfig
platdir = sysconfig.get_config_var('PLATDIR')
REQUIRED_FILES.append(platdir)
# The whole list of 3.3 modules is reproduced below - the current
# uncommented ones are required for 3.3 as of now, but more may be
# added as 3.3 development continues.
REQUIRED_MODULES.extend([
#"aifc",
#"antigravity",
#"argparse",
#"ast",
#"asynchat",
#"asyncore",
"base64",
#"bdb",
#"binhex",
#"bisect",
#"calendar",
#"cgi",
#"cgitb",
#"chunk",
#"cmd",
#"codeop",
#"code",
#"colorsys",
#"_compat_pickle",
#"compileall",
#"concurrent",
#"configparser",
#"contextlib",
#"cProfile",
#"crypt",
#"csv",
#"ctypes",
#"curses",
#"datetime",
#"dbm",
#"decimal",
#"difflib",
#"dis",
#"doctest",
#"dummy_threading",
"_dummy_thread",
#"email",
#"filecmp",
#"fileinput",
#"formatter",
#"fractions",
#"ftplib",
#"functools",
#"getopt",
#"getpass",
#"gettext",
#"glob",
#"gzip",
"hashlib",
#"heapq",
"hmac",
#"html",
#"http",
#"idlelib",
#"imaplib",
#"imghdr",
"imp",
"importlib",
#"inspect",
#"json",
#"lib2to3",
#"logging",
#"macpath",
#"macurl2path",
#"mailbox",
#"mailcap",
#"_markupbase",
#"mimetypes",
#"modulefinder",
#"multiprocessing",
#"netrc",
#"nntplib",
#"nturl2path",
#"numbers",
#"opcode",
#"optparse",
#"os2emxpath",
#"pdb",
#"pickle",
#"pickletools",
#"pipes",
#"pkgutil",
#"platform",
#"plat-linux2",
#"plistlib",
#"poplib",
#"pprint",
#"profile",
#"pstats",
#"pty",
#"pyclbr",
#"py_compile",
#"pydoc_data",
#"pydoc",
#"_pyio",
#"queue",
#"quopri",
#"reprlib",
"rlcompleter",
#"runpy",
#"sched",
#"shelve",
#"shlex",
#"smtpd",
#"smtplib",
#"sndhdr",
#"socket",
#"socketserver",
#"sqlite3",
#"ssl",
#"stringprep",
#"string",
#"_strptime",
#"subprocess",
#"sunau",
#"symbol",
#"symtable",
#"sysconfig",
#"tabnanny",
#"telnetlib",
#"test",
#"textwrap",
#"this",
#"_threading_local",
#"threading",
#"timeit",
#"tkinter",
#"tokenize",
#"token",
#"traceback",
#"trace",
#"tty",
#"turtledemo",
#"turtle",
#"unittest",
#"urllib",
#"uuid",
#"uu",
#"wave",
#"weakref",
#"webbrowser",
#"wsgiref",
#"xdrlib",
#"xml",
#"xmlrpc",
#"zipfile",
'base64', '_dummy_thread', 'hashlib', 'hmac',
'imp', 'importlib', 'rlcompleter'
])
if minver >= 4:
REQUIRED_MODULES.extend([
@ -298,6 +158,7 @@ if is_pypy:
# during the bootstrap
REQUIRED_MODULES.extend(['traceback', 'linecache'])
class Logger(object):
"""
@ -322,16 +183,22 @@ class Logger(object):
def debug(self, msg, *args, **kw):
self.log(self.DEBUG, msg, *args, **kw)
def info(self, msg, *args, **kw):
self.log(self.INFO, msg, *args, **kw)
def notify(self, msg, *args, **kw):
self.log(self.NOTIFY, msg, *args, **kw)
def warn(self, msg, *args, **kw):
self.log(self.WARN, msg, *args, **kw)
def error(self, msg, *args, **kw):
self.log(self.ERROR, msg, *args, **kw)
def fatal(self, msg, *args, **kw):
self.log(self.FATAL, msg, *args, **kw)
def log(self, level, msg, *args, **kw):
if args:
if kw:
@ -526,8 +393,7 @@ def _find_file(filename, dirs):
def file_search_dirs():
here = os.path.dirname(os.path.abspath(__file__))
dirs = ['.', here,
join(here, 'virtualenv_support')]
dirs = [here, join(here, 'virtualenv_support')]
if os.path.splitext(os.path.dirname(__file__))[0] != 'virtualenv':
# Probably some boot script; just in case virtualenv is installed...
try:
@ -535,7 +401,8 @@ def file_search_dirs():
except ImportError:
pass
else:
dirs.append(os.path.join(os.path.dirname(virtualenv.__file__), 'virtualenv_support'))
dirs.append(os.path.join(
os.path.dirname(virtualenv.__file__), 'virtualenv_support'))
return [d for d in dirs if os.path.isdir(d)]
@ -714,7 +581,7 @@ def main():
'--no-setuptools',
dest='no_setuptools',
action='store_true',
help='Do not install setuptools (or pip) in the new virtualenv.')
help='Do not install setuptools in the new virtualenv.')
parser.add_option(
'--no-pip',
@ -722,6 +589,12 @@ def main():
action='store_true',
help='Do not install pip in the new virtualenv.')
parser.add_option(
'--no-wheel',
dest='no_wheel',
action='store_true',
help='Do not install wheel in the new virtualenv.')
default_search_dirs = file_search_dirs()
parser.add_option(
'--extra-search-dir',
@ -733,12 +606,20 @@ def main():
"This option can be used multiple times.")
parser.add_option(
'--never-download',
dest="never_download",
action="store_true",
"--download",
dest="download",
default=True,
help="DEPRECATED. Retained only for backward compatibility. This option has no effect. "
"Virtualenv never downloads pip or setuptools.")
action="store_true",
help="Download preinstalled packages from PyPI.",
)
parser.add_option(
"--no-download",
'--never-download',
dest="download",
action="store_false",
help="Do not download preinstalled packages from PyPI.",
)
parser.add_option(
'--prompt',
@ -809,19 +690,16 @@ def main():
make_environment_relocatable(home_dir)
return
if not options.never_download:
logger.warn('The --never-download option is for backward compatibility only.')
logger.warn('Setting it to false is no longer supported, and will be ignored.')
create_environment(home_dir,
site_packages=options.system_site_packages,
clear=options.clear,
unzip_setuptools=options.unzip_setuptools,
prompt=options.prompt,
search_dirs=options.search_dirs,
never_download=True,
download=options.download,
no_setuptools=options.no_setuptools,
no_pip=options.no_pip,
no_wheel=options.no_wheel,
symlink=options.symlink)
if 'after_install' in globals():
after_install(options, home_dir)
@ -937,13 +815,27 @@ def find_wheels(projects, search_dirs):
return wheels
def install_wheel(project_names, py_executable, search_dirs=None):
def install_wheel(project_names, py_executable, search_dirs=None,
download=False):
if search_dirs is None:
search_dirs = file_search_dirs()
wheels = find_wheels(['setuptools', 'pip'], search_dirs)
pythonpath = os.pathsep.join(wheels)
findlinks = ' '.join(search_dirs)
# PIP_FIND_LINKS uses space as the path separator and thus cannot have paths
# with spaces in them. Convert any of those to local file:// URL form.
try:
from urlparse import urljoin
from urllib import pathname2url
except ImportError:
from urllib.parse import urljoin
from urllib.request import pathname2url
def space_path2url(p):
if ' ' not in p:
return p
return urljoin('file:', pathname2url(os.path.abspath(p)))
findlinks = ' '.join(space_path2url(d) for d in search_dirs)
cmd = [
py_executable, '-c',
@ -951,24 +843,31 @@ def install_wheel(project_names, py_executable, search_dirs=None):
] + project_names
logger.start_progress('Installing %s...' % (', '.join(project_names)))
logger.indent += 2
env = {
"PYTHONPATH": pythonpath,
"JYTHONPATH": pythonpath, # for Jython < 3.x
"PIP_FIND_LINKS": findlinks,
"PIP_USE_WHEEL": "1",
"PIP_ONLY_BINARY": ":all:",
"PIP_PRE": "1",
"PIP_USER": "0",
}
if not download:
env["PIP_NO_INDEX"] = "1"
try:
call_subprocess(cmd, show_stdout=False,
extra_env = {
'PYTHONPATH': pythonpath,
'PIP_FIND_LINKS': findlinks,
'PIP_USE_WHEEL': '1',
'PIP_PRE': '1',
'PIP_NO_INDEX': '1'
}
)
call_subprocess(cmd, show_stdout=False, extra_env=env)
finally:
logger.indent -= 2
logger.end_progress()
def create_environment(home_dir, site_packages=False, clear=False,
unzip_setuptools=False,
prompt=None, search_dirs=None, never_download=False,
no_setuptools=False, no_pip=False, symlink=True):
prompt=None, search_dirs=None, download=False,
no_setuptools=False, no_pip=False, no_wheel=False,
symlink=True):
"""
Creates a new environment in ``home_dir``.
@ -986,20 +885,36 @@ def create_environment(home_dir, site_packages=False, clear=False,
install_distutils(home_dir)
to_install = []
if not no_setuptools:
to_install = ['setuptools']
if not no_pip:
to_install.append('pip')
install_wheel(to_install, py_executable, search_dirs)
to_install.append('setuptools')
if not no_pip:
to_install.append('pip')
if not no_wheel:
to_install.append('wheel')
if to_install:
install_wheel(
to_install,
py_executable,
search_dirs,
download=download,
)
install_activate(home_dir, bin_dir, prompt)
install_python_config(home_dir, bin_dir, prompt)
def is_executable_file(fpath):
return os.path.isfile(fpath) and os.access(fpath, os.X_OK)
def path_locations(home_dir):
"""Return the path locations for the environment (where libraries are,
where scripts go, etc)"""
home_dir = os.path.abspath(home_dir)
# XXX: We'd use distutils.sysconfig.get_python_inc/lib but its
# prefix arg is broken: http://bugs.python.org/issue3386
if is_win:
@ -1036,17 +951,7 @@ def path_locations(home_dir):
bin_dir = join(home_dir, 'bin')
elif not is_win:
lib_dir = join(home_dir, 'lib', py_version)
multiarch_exec = '/usr/bin/multiarch-platform'
if is_executable_file(multiarch_exec):
# In Mageia (2) and Mandriva distros the include dir must be like:
# virtualenv/include/multiarch-x86_64-linux/python2.7
# instead of being virtualenv/include/python2.7
p = subprocess.Popen(multiarch_exec, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
stdout, stderr = p.communicate()
# stdout.strip is needed to remove newline character
inc_dir = join(home_dir, 'include', stdout.strip(), py_version + abiflags)
else:
inc_dir = join(home_dir, 'include', py_version + abiflags)
inc_dir = join(home_dir, 'include', py_version + abiflags)
bin_dir = join(home_dir, 'bin')
return home_dir, lib_dir, inc_dir, bin_dir
@ -1085,45 +990,34 @@ def change_prefix(filename, dst_prefix):
def copy_required_modules(dst_prefix, symlink):
import imp
# If we are running under -p, we need to remove the current
# directory from sys.path temporarily here, so that we
# definitely get the modules from the site directory of
# the interpreter we are running under, not the one
# virtualenv.py is installed under (which might lead to py2/py3
# incompatibility issues)
_prev_sys_path = sys.path
if os.environ.get('VIRTUALENV_INTERPRETER_RUNNING'):
sys.path = sys.path[1:]
try:
for modname in REQUIRED_MODULES:
if modname in sys.builtin_module_names:
logger.info("Ignoring built-in bootstrap module: %s" % modname)
continue
try:
f, filename, _ = imp.find_module(modname)
except ImportError:
logger.info("Cannot import bootstrap module: %s" % modname)
for modname in REQUIRED_MODULES:
if modname in sys.builtin_module_names:
logger.info("Ignoring built-in bootstrap module: %s" % modname)
continue
try:
f, filename, _ = imp.find_module(modname)
except ImportError:
logger.info("Cannot import bootstrap module: %s" % modname)
else:
if f is not None:
f.close()
# special-case custom readline.so on OS X, but not for pypy:
if modname == 'readline' and sys.platform == 'darwin' and not (
is_pypy or filename.endswith(join('lib-dynload', 'readline.so'))):
dst_filename = join(dst_prefix, 'lib', 'python%s' % sys.version[:3], 'readline.so')
elif modname == 'readline' and sys.platform == 'win32':
# special-case for Windows, where readline is not a
# standard module, though it may have been installed in
# site-packages by a third-party package
pass
else:
if f is not None:
f.close()
# special-case custom readline.so on OS X, but not for pypy:
if modname == 'readline' and sys.platform == 'darwin' and not (
is_pypy or filename.endswith(join('lib-dynload', 'readline.so'))):
dst_filename = join(dst_prefix, 'lib', 'python%s' % sys.version[:3], 'readline.so')
elif modname == 'readline' and sys.platform == 'win32':
# special-case for Windows, where readline is not a
# standard module, though it may have been installed in
# site-packages by a third-party package
pass
else:
dst_filename = change_prefix(filename, dst_prefix)
copyfile(filename, dst_filename, symlink)
if filename.endswith('.pyc'):
pyfile = filename[:-1]
if os.path.exists(pyfile):
copyfile(pyfile, dst_filename[:-1], symlink)
finally:
sys.path = _prev_sys_path
dst_filename = change_prefix(filename, dst_prefix)
copyfile(filename, dst_filename, symlink)
if filename.endswith('.pyc'):
pyfile = filename[:-1]
if os.path.exists(pyfile):
copyfile(pyfile, dst_filename[:-1], symlink)
def subst_path(prefix_path, prefix, home_dir):
@ -1184,7 +1078,7 @@ def install_python(home_dir, lib_dir, inc_dir, bin_dir, site_packages, clear, sy
mkdir(join(lib_dir, 'site-packages'))
import site
site_filename = site.__file__
if site_filename.endswith('.pyc'):
if site_filename.endswith('.pyc') or site_filename.endswith('.pyo'):
site_filename = site_filename[:-1]
elif site_filename.endswith('$py.class'):
site_filename = site_filename.replace('$py.class', '.py')
@ -1479,7 +1373,6 @@ def install_python(home_dir, lib_dir, inc_dir, bin_dir, site_packages, clear, sy
def install_activate(home_dir, bin_dir, prompt=None):
home_dir = os.path.abspath(home_dir)
if is_win or is_jython and os._name == 'nt':
files = {
'activate.bat': ACTIVATE_BAT,
@ -1507,6 +1400,10 @@ def install_activate(home_dir, bin_dir, prompt=None):
files['activate.csh'] = ACTIVATE_CSH
files['activate_this.py'] = ACTIVATE_THIS
install_files(home_dir, bin_dir, prompt, files)
def install_files(home_dir, bin_dir, prompt, files):
if hasattr(home_dir, 'decode'):
home_dir = home_dir.decode(sys.getfilesystemencoding())
vname = os.path.basename(home_dir)
@ -1518,6 +1415,15 @@ def install_activate(home_dir, bin_dir, prompt=None):
content = content.replace('__BIN_NAME__', os.path.basename(bin_dir))
writefile(os.path.join(bin_dir, name), content)
def install_python_config(home_dir, bin_dir, prompt=None):
if sys.platform == 'win32' or is_jython and os._name == 'nt':
files = {}
else:
files = {'python-config': PYTHON_CONFIG}
install_files(home_dir, bin_dir, prompt, files)
for name, content in files.items():
make_exe(os.path.join(bin_dir, name))
def install_distutils(home_dir):
distutils_path = change_prefix(distutils.__path__[0], home_dir)
mkdir(distutils_path)
@ -1555,30 +1461,32 @@ def fix_lib64(lib_dir, symlink=True):
instead of lib/pythonX.Y. If this is such a platform we'll just create a
symlink so lib64 points to lib
"""
if [p for p in distutils.sysconfig.get_config_vars().values()
if isinstance(p, basestring) and 'lib64' in p]:
# PyPy's library path scheme is not affected by this.
# Return early or we will die on the following assert.
if is_pypy:
logger.debug('PyPy detected, skipping lib64 symlinking')
return
# PyPy's library path scheme is not affected by this.
# Return early or we will die on the following assert.
if is_pypy:
logger.debug('PyPy detected, skipping lib64 symlinking')
return
# Check we have a lib64 library path
if not [p for p in distutils.sysconfig.get_config_vars().values()
if isinstance(p, basestring) and 'lib64' in p]:
return
logger.debug('This system uses lib64; symlinking lib64 to lib')
logger.debug('This system uses lib64; symlinking lib64 to lib')
assert os.path.basename(lib_dir) == 'python%s' % sys.version[:3], (
"Unexpected python lib dir: %r" % lib_dir)
lib_parent = os.path.dirname(lib_dir)
top_level = os.path.dirname(lib_parent)
lib_dir = os.path.join(top_level, 'lib')
lib64_link = os.path.join(top_level, 'lib64')
assert os.path.basename(lib_parent) == 'lib', (
"Unexpected parent dir: %r" % lib_parent)
if os.path.lexists(lib64_link):
return
if symlink:
os.symlink('lib', lib64_link)
else:
copyfile('lib', lib64_link)
assert os.path.basename(lib_dir) == 'python%s' % sys.version[:3], (
"Unexpected python lib dir: %r" % lib_dir)
lib_parent = os.path.dirname(lib_dir)
top_level = os.path.dirname(lib_parent)
lib_dir = os.path.join(top_level, 'lib')
lib64_link = os.path.join(top_level, 'lib64')
assert os.path.basename(lib_parent) == 'lib', (
"Unexpected parent dir: %r" % lib_parent)
if os.path.lexists(lib64_link):
return
if symlink:
os.symlink('lib', lib64_link)
else:
copyfile('lib', lib64_link)
def resolve_interpreter(exe):
"""
@ -1593,8 +1501,8 @@ def resolve_interpreter(exe):
if os.path.abspath(exe) != exe:
paths = os.environ.get('PATH', '').split(os.pathsep)
for path in paths:
if os.path.exists(os.path.join(path, exe)):
exe = os.path.join(path, exe)
if os.path.exists(join(path, exe)):
exe = join(path, exe)
break
if not os.path.exists(exe):
logger.fatal('The executable %s (from --python=%s) does not exist' % (exe, exe))
@ -2003,71 +1911,70 @@ AVijEPwfucjncQ==
##file activate.sh
ACTIVATE_SH = convert("""
eJytVVFvokAQfudXTLEPtTlLeo9tvMSmJpq02hSvl7u2wRUG2QR2DSxSe7n/frOACEVNLlceRHa+
nfl25pvZDswCnoDPQ4QoTRQsENIEPci4CsBMZBq7CAsuLOYqvmYKTTj3YxnBgiXBudGBjUzBZUJI
BXEqgCvweIyuCjeG4eF2F5x14bcB9KQiQQWrjSddI1/oQIx6SYYeoFjzWIoIhYI1izlbhJjkKO7D
M/QEmKfO9O7WeRo/zr4P7pyHwWxkwitcgwpQ5Ej96OX+PmiFwLeVjFUOrNYKaq1Nud3nR2n8nI2m
k9H0friPTGVsUdptaxGrTEfpNVFEskxpXtUkkCkl1UNF9cgLBkx48J4EXyALuBtAwNYIjF5kcmUU
abMKmMq1ULoiRbgsDEkTSsKSGFCJ6Z8vY/2xYiSacmtyAfCDdCNTVZoVF8vSTQOoEwSnOrngBkws
MYGMBMg8/bMBLSYKS7pYEXP0PqT+ZmBT0Xuy+Pplj5yn4aM9nk72JD8/Wi+Gr98sD9eWSMOwkapD
BbUv91XSvmyVkICt2tmXR4tWmrcUCsjWOpw87YidEC8i0gdTSOFhouJUNxR+4NYBG0MftoCTD9F7
2rTtxG3oPwY1b2HncYwhrlmj6Wq924xtGDWqfdNxap+OYxplEurnMVo9RWks+rH8qKEtx7kZT5zJ
4H7oOFclrN6uFe+d+nW2aIUsSgs/42EIPuOhXq+jEo3S6tX6w2ilNkDnIpHCWdEQhFgwj9pkk7FN
l/y5eQvRSIQ5+TrL05lewxWpt/Lbhes5cJF3mLET1MGhcKCF+40tNWnUulxrpojwDo2sObdje3Bz
N3QeHqf3D7OjEXMVV8LN3ZlvuzoWHqiUcNKHtwNd0IbvPGKYYM31nPKCgkUILw3KL+Y8l7aO1ArS
Ad37nIU0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Qir5pC1YRLz3eA+CD8Z0XpcW8v9
MZWF36ryyXXf3yBIz6nzqz8Muyz0m5Qj7OexfYo/Ph3LqvkHUg7AuA==
""")
MH_MAGIC = 0xfeedface
MH_CIGAM = 0xcefaedfe
MH_MAGIC_64 = 0xfeedfacf
@ -2351,6 +2277,6 @@ def mach_o_change(path, what, value):
if __name__ == '__main__':
main()
## TODO:
## Copy python.exe.manifest
## Monkeypatch distutils.sysconfig
# TODO:
# Copy python.exe.manifest
# Monkeypatch distutils.sysconfig

View File

@ -7,20 +7,24 @@ if defined _OLD_VIRTUAL_PROMPT (
if not defined PROMPT (
set "PROMPT=$P$G"
)
set "_OLD_VIRTUAL_PROMPT=%PROMPT%"
set "_OLD_VIRTUAL_PROMPT=%PROMPT%"
)
set "PROMPT=__VIRTUAL_WINPROMPT__ %PROMPT%"
if not defined _OLD_VIRTUAL_PYTHONHOME (
REM Don't use () to avoid problems with them in %PATH%
if defined _OLD_VIRTUAL_PYTHONHOME goto ENDIFVHOME
set "_OLD_VIRTUAL_PYTHONHOME=%PYTHONHOME%"
)
:ENDIFVHOME
set PYTHONHOME=
if defined _OLD_VIRTUAL_PATH (
REM if defined _OLD_VIRTUAL_PATH (
if not defined _OLD_VIRTUAL_PATH goto ENDIFVPATH1
set "PATH=%_OLD_VIRTUAL_PATH%"
) else (
:ENDIFVPATH1
REM ) else (
if defined _OLD_VIRTUAL_PATH goto ENDIFVPATH2
set "_OLD_VIRTUAL_PATH=%PATH%"
)
set "PATH=%VIRTUAL_ENV%\__BIN_NAME__;%PATH%"
:ENDIFVPATH2
:END
set "PATH=%VIRTUAL_ENV%\__BIN_NAME__;%PATH%"

View File

@ -17,13 +17,7 @@ setenv PATH "$VIRTUAL_ENV/__BIN_NAME__:$PATH"
if ("__VIRTUAL_PROMPT__" != "") then
set env_name = "__VIRTUAL_PROMPT__"
else
if (`basename "$VIRTUAL_ENV"` == "__") then
# special case for Aspen magic directories
# see http://www.zetadev.com/software/aspen/
set env_name = `basename \`dirname "$VIRTUAL_ENV"\``
else
set env_name = `basename "$VIRTUAL_ENV"`
endif
set env_name = `basename "$VIRTUAL_ENV"`
endif
# Could be in a non-interactive environment,

View File

@ -1,35 +1,39 @@
# This file must be used with "source bin/activate.fish" *from fish* (http://fishshell.com)
# you cannot run it directly
# This file must be used using `. bin/activate.fish` *within a running fish ( http://fishshell.com ) session*.
# Do not run it directly.
function deactivate -d "Exit virtualenv and return to normal shell environment"
function deactivate -d 'Exit virtualenv mode and return to the normal environment.'
# reset old environment variables
if test -n "$_OLD_VIRTUAL_PATH"
if test -n "$_OLD_VIRTUAL_PATH"
set -gx PATH $_OLD_VIRTUAL_PATH
set -e _OLD_VIRTUAL_PATH
end
if test -n "$_OLD_VIRTUAL_PYTHONHOME"
set -gx PYTHONHOME $_OLD_VIRTUAL_PYTHONHOME
set -e _OLD_VIRTUAL_PYTHONHOME
end
if test -n "$_OLD_FISH_PROMPT_OVERRIDE"
# set an empty local fish_function_path, so fish_prompt doesn't automatically reload
# Set an empty local `$fish_function_path` to allow the removal of `fish_prompt` using `functions -e`.
set -l fish_function_path
# erase the virtualenv's fish_prompt function, and restore the original
# Erase virtualenv's `fish_prompt` and restore the original.
functions -e fish_prompt
functions -c _old_fish_prompt fish_prompt
functions -e _old_fish_prompt
set -e _OLD_FISH_PROMPT_OVERRIDE
end
set -e VIRTUAL_ENV
if test "$argv[1]" != "nondestructive"
# Self destruct!
if test "$argv[1]" != 'nondestructive'
# Self-destruct!
functions -e pydoc
functions -e deactivate
end
end
# unset irrelevant variables
# Unset irrelevant variables.
deactivate nondestructive
set -gx VIRTUAL_ENV "__VIRTUAL_ENV__"
@ -37,38 +41,36 @@ set -gx VIRTUAL_ENV "__VIRTUAL_ENV__"
set -gx _OLD_VIRTUAL_PATH $PATH
set -gx PATH "$VIRTUAL_ENV/__BIN_NAME__" $PATH
# unset PYTHONHOME if set
# Unset `$PYTHONHOME` if set.
if set -q PYTHONHOME
set -gx _OLD_VIRTUAL_PYTHONHOME $PYTHONHOME
set -e PYTHONHOME
end
function pydoc
python -m pydoc $argv
end
if test -z "$VIRTUAL_ENV_DISABLE_PROMPT"
# fish uses a function instead of an env var to generate the prompt.
# copy the current fish_prompt function as the function _old_fish_prompt
# Copy the current `fish_prompt` function as `_old_fish_prompt`.
functions -c fish_prompt _old_fish_prompt
# with the original prompt function copied, we can override with our own.
function fish_prompt
# Prompt override?
# Save the current $status, for fish_prompts that display it.
set -l old_status $status
# Prompt override provided?
# If not, just prepend the environment name.
if test -n "__VIRTUAL_PROMPT__"
printf "%s%s" "__VIRTUAL_PROMPT__" (set_color normal)
_old_fish_prompt
return
end
# ...Otherwise, prepend env
set -l _checkbase (basename "$VIRTUAL_ENV")
if test $_checkbase = "__"
# special case for Aspen magic directories
# see http://www.zetadev.com/software/aspen/
printf "%s[%s]%s " (set_color -b blue white) (basename (dirname "$VIRTUAL_ENV")) (set_color normal)
_old_fish_prompt
printf '%s%s' "__VIRTUAL_PROMPT__" (set_color normal)
else
printf "%s(%s)%s" (set_color -b blue white) (basename "$VIRTUAL_ENV") (set_color normal)
_old_fish_prompt
printf '%s(%s%s%s) ' (set_color normal) (set_color -o white) (basename "$VIRTUAL_ENV") (set_color normal)
end
end
# Restore the original $status
echo "exit $old_status" | source
_old_fish_prompt
end
set -gx _OLD_FISH_PROMPT_OVERRIDE "$VIRTUAL_ENV"
end

View File

@ -2,15 +2,16 @@
# you cannot run it directly
deactivate () {
unset pydoc
unset -f pydoc
# reset old environment variables
if [ -n "$_OLD_VIRTUAL_PATH" ] ; then
# ! [ -z ${VAR+_} ] returns true if VAR is declared at all
if ! [ -z "${_OLD_VIRTUAL_PATH+_}" ] ; then
PATH="$_OLD_VIRTUAL_PATH"
export PATH
unset _OLD_VIRTUAL_PATH
fi
if [ -n "$_OLD_VIRTUAL_PYTHONHOME" ] ; then
if ! [ -z "${_OLD_VIRTUAL_PYTHONHOME+_}" ] ; then
PYTHONHOME="$_OLD_VIRTUAL_PYTHONHOME"
export PYTHONHOME
unset _OLD_VIRTUAL_PYTHONHOME
@ -19,18 +20,18 @@ deactivate () {
# This should detect bash and zsh, which have a hash command that must
# be called to get it to forget past commands. Without forgetting
# past commands the $PATH changes we made may not be respected
if [ -n "$BASH" -o -n "$ZSH_VERSION" ] ; then
if [ -n "${BASH-}" ] || [ -n "${ZSH_VERSION-}" ] ; then
hash -r 2>/dev/null
fi
if [ -n "$_OLD_VIRTUAL_PS1" ] ; then
if ! [ -z "${_OLD_VIRTUAL_PS1+_}" ] ; then
PS1="$_OLD_VIRTUAL_PS1"
export PS1
unset _OLD_VIRTUAL_PS1
fi
unset VIRTUAL_ENV
if [ ! "$1" = "nondestructive" ] ; then
if [ ! "${1-}" = "nondestructive" ] ; then
# Self destruct!
unset -f deactivate
fi
@ -47,34 +48,31 @@ PATH="$VIRTUAL_ENV/__BIN_NAME__:$PATH"
export PATH
# unset PYTHONHOME if set
# this will fail if PYTHONHOME is set to the empty string (which is bad anyway)
# could use `if (set -u; : $PYTHONHOME) ;` in bash
if [ -n "$PYTHONHOME" ] ; then
if ! [ -z "${PYTHONHOME+_}" ] ; then
_OLD_VIRTUAL_PYTHONHOME="$PYTHONHOME"
unset PYTHONHOME
fi
if [ -z "$VIRTUAL_ENV_DISABLE_PROMPT" ] ; then
if [ -z "${VIRTUAL_ENV_DISABLE_PROMPT-}" ] ; then
_OLD_VIRTUAL_PS1="$PS1"
if [ "x__VIRTUAL_PROMPT__" != x ] ; then
PS1="__VIRTUAL_PROMPT__$PS1"
else
if [ "`basename \"$VIRTUAL_ENV\"`" = "__" ] ; then
# special case for Aspen magic directories
# see http://www.zetadev.com/software/aspen/
PS1="[`basename \`dirname \"$VIRTUAL_ENV\"\``] $PS1"
else
PS1="(`basename \"$VIRTUAL_ENV\"`)$PS1"
fi
PS1="(`basename \"$VIRTUAL_ENV\"`) $PS1"
fi
export PS1
fi
alias pydoc="python -m pydoc"
# Make sure to unalias pydoc if it's already there
alias pydoc 2>/dev/null >/dev/null && unalias pydoc
pydoc () {
python -m pydoc "$@"
}
# This should detect bash and zsh, which have a hash command that must
# be called to get it to forget past commands. Without forgetting
# past commands the $PATH changes we made may not be respected
if [ -n "$BASH" -o -n "$ZSH_VERSION" ] ; then
if [ -n "${BASH-}" ] || [ -n "${ZSH_VERSION-}" ] ; then
hash -r 2>/dev/null
fi

View File

@ -1,20 +1,19 @@
@echo off
set VIRTUAL_ENV=
if defined _OLD_VIRTUAL_PROMPT (
set "PROMPT=%_OLD_VIRTUAL_PROMPT%"
set _OLD_VIRTUAL_PROMPT=
)
if defined _OLD_VIRTUAL_PYTHONHOME (
set "PYTHONHOME=%_OLD_VIRTUAL_PYTHONHOME%"
set _OLD_VIRTUAL_PYTHONHOME=
)
if defined _OLD_VIRTUAL_PATH (
set "PATH=%_OLD_VIRTUAL_PATH%"
set _OLD_VIRTUAL_PATH=
)
:END
@echo off
set VIRTUAL_ENV=
REM Don't use () to avoid problems with them in %PATH%
if not defined _OLD_VIRTUAL_PROMPT goto ENDIFVPROMPT
set "PROMPT=%_OLD_VIRTUAL_PROMPT%"
set _OLD_VIRTUAL_PROMPT=
:ENDIFVPROMPT
if not defined _OLD_VIRTUAL_PYTHONHOME goto ENDIFVHOME
set "PYTHONHOME=%_OLD_VIRTUAL_PYTHONHOME%"
set _OLD_VIRTUAL_PYTHONHOME=
:ENDIFVHOME
if not defined _OLD_VIRTUAL_PATH goto ENDIFVPATH
set "PATH=%_OLD_VIRTUAL_PATH%"
set _OLD_VIRTUAL_PATH=
:ENDIFVPATH

View File

@ -0,0 +1,78 @@
#!__VIRTUAL_ENV__/__BIN_NAME__/python
import sys
import getopt
import sysconfig
valid_opts = ['prefix', 'exec-prefix', 'includes', 'libs', 'cflags',
'ldflags', 'help']
if sys.version_info >= (3, 2):
valid_opts.insert(-1, 'extension-suffix')
valid_opts.append('abiflags')
if sys.version_info >= (3, 3):
valid_opts.append('configdir')
def exit_with_usage(code=1):
sys.stderr.write("Usage: {0} [{1}]\n".format(
sys.argv[0], '|'.join('--'+opt for opt in valid_opts)))
sys.exit(code)
try:
opts, args = getopt.getopt(sys.argv[1:], '', valid_opts)
except getopt.error:
exit_with_usage()
if not opts:
exit_with_usage()
pyver = sysconfig.get_config_var('VERSION')
getvar = sysconfig.get_config_var
opt_flags = [flag for (flag, val) in opts]
if '--help' in opt_flags:
exit_with_usage(code=0)
for opt in opt_flags:
if opt == '--prefix':
print(sysconfig.get_config_var('prefix'))
elif opt == '--exec-prefix':
print(sysconfig.get_config_var('exec_prefix'))
elif opt in ('--includes', '--cflags'):
flags = ['-I' + sysconfig.get_path('include'),
'-I' + sysconfig.get_path('platinclude')]
if opt == '--cflags':
flags.extend(getvar('CFLAGS').split())
print(' '.join(flags))
elif opt in ('--libs', '--ldflags'):
abiflags = getattr(sys, 'abiflags', '')
libs = ['-lpython' + pyver + abiflags]
libs += getvar('LIBS').split()
libs += getvar('SYSLIBS').split()
# add the prefix/lib/pythonX.Y/config dir, but only if there is no
# shared library in prefix/lib/.
if opt == '--ldflags':
if not getvar('Py_ENABLE_SHARED'):
libs.insert(0, '-L' + getvar('LIBPL'))
if not getvar('PYTHONFRAMEWORK'):
libs.extend(getvar('LINKFORSHARED').split())
print(' '.join(libs))
elif opt == '--extension-suffix':
ext_suffix = sysconfig.get_config_var('EXT_SUFFIX')
if ext_suffix is None:
ext_suffix = sysconfig.get_config_var('SO')
print(ext_suffix)
elif opt == '--abiflags':
if not getattr(sys, 'abiflags', None):
exit_with_usage()
print(sys.abiflags)
elif opt == '--configdir':
print(sysconfig.get_config_var('LIBPL'))