Bug 837631 - Upgrade Virtualenv to 1.8.4 and backport upstream fixes. r=glandium, a=leo+

python/virtualenv from mozilla-central at feccfce43b59 replaces the
existing virtualenv.
This commit is contained in:
Gregory Szorc 2013-05-16 12:28:00 -07:00
Родитель 252373add5
Коммит a08c557c14
30 изменённых файлов: 2078 добавлений и 677 удалений

Просмотреть файл

@ -9,6 +9,7 @@ Maintainers
Brian Rosner
Carl Meyer
Jannis Leidel
Paul Nasrat
Contributors
------------
@ -17,7 +18,9 @@ Alex Grönholm
Anatoly Techtonik
Antonio Cuni
Armin Ronacher
Benjamin Root
Bradley Ayers
Branden Rolston
Cap Petschulat
CBWhiz
Chris McDonough
@ -25,15 +28,18 @@ Christian Stefanescu
Christopher Nilsson
Cliff Xuan
Curt Micol
Damien Nozay
David Schoonover
Doug Hellmann
Doug Napoleone
Douglas Creager
Ethan Jucovy
Gabriel de Perthuis
Gunnlaugur Thor Briem
Greg Haskins
Jason R. Coombs
Jeff Hammel
Jeremy Orem
Jonathan Griffin
Jorge Vargas
Josh Bronson
@ -43,6 +49,7 @@ Lars Francke
Marc Abramowitz
Mike Hommey
Miki Tebeka
Paul Moore
Philip Jenvey
Raul Leal
Ronny Pfannschmidt

Просмотреть файл

@ -1,6 +1,6 @@
Metadata-Version: 1.0
Metadata-Version: 1.1
Name: virtualenv
Version: 1.7.1.2
Version: 1.8.4
Summary: Virtual Python Environment builder
Home-page: http://www.virtualenv.org
Author: Jannis Leidel, Carl Meyer and Brian Rosner
@ -12,8 +12,8 @@ Description:
------------
You can install virtualenv with ``pip install virtualenv``, or the `latest
development version <https://github.com/pypa/virtualenv/tarball/develop#egg=virtualenv-dev>`_
with ``pip install virtualenv==dev``.
development version <https://github.com/pypa/virtualenv/tarball/develop>`_
with ``pip install https://github.com/pypa/virtualenv/tarball/develop``.
You can also use ``easy_install``, or if you have no Python package manager
available at all, you can just grab the single file `virtualenv.py`_ and run
@ -47,6 +47,9 @@ Description:
share libraries with other virtualenv environments (and optionally
doesn't access the globally installed libraries either).
Usage
-----
The basic usage is::
$ python virtualenv.py ENV
@ -66,12 +69,116 @@ Description:
$ python virtualenv.py --distribute ENV
You can also set the environment variable VIRTUALENV_USE_DISTRIBUTE.
You can also set the environment variable VIRTUALENV_DISTRIBUTE.
A new virtualenv also includes the `pip <http://pypy.python.org/pypi/pip>`_
A new virtualenv also includes the `pip <http://pypi.python.org/pypi/pip>`_
installer, so you can use ``ENV/bin/pip`` to install additional packages into
the environment.
activate script
~~~~~~~~~~~~~~~
In a newly created virtualenv there will be a ``bin/activate`` shell
script. For Windows systems, activation scripts are provided for CMD.exe
and Powershell.
On Posix systems you can do::
$ source bin/activate
This will change your ``$PATH`` so its first entry is the virtualenv's
``bin/`` directory. (You have to use ``source`` because it changes your
shell environment in-place.) This is all it does; it's purely a
convenience. If you directly run a script or the python interpreter
from the virtualenv's ``bin/`` directory (e.g. ``path/to/env/bin/pip``
or ``/path/to/env/bin/python script.py``) there's no need for
activation.
After activating an environment you can use the function ``deactivate`` to
undo the changes to your ``$PATH``.
The ``activate`` script will also modify your shell prompt to indicate
which environment is currently active. You can disable this behavior,
which can be useful if you have your own custom prompt that already
displays the active environment name. To do so, set the
``VIRTUAL_ENV_DISABLE_PROMPT`` environment variable to any non-empty
value before running the ``activate`` script.
On Windows you just do::
> \path\to\env\Scripts\activate
And type `deactivate` to undo the changes.
Based on your active shell (CMD.exe or Powershell.exe), Windows will use
either activate.bat or activate.ps1 (as appropriate) to activate the
virtual environment. If using Powershell, see the notes about code signing
below.
.. note::
If using Powershell, the ``activate`` script is subject to the
`execution policies`_ on the system. By default on Windows 7, the system's
excution policy is set to ``Restricted``, meaning no scripts like the
``activate`` script are allowed to be executed. But that can't stop us
from changing that slightly to allow it to be executed.
In order to use the script, you have to relax your system's execution
policy to ``AllSigned``, meaning all scripts on the system must be
digitally signed to be executed. Since the virtualenv activation
script is signed by one of the authors (Jannis Leidel) this level of
the execution policy suffices. As an administrator run::
PS C:\> Set-ExecutionPolicy AllSigned
Then you'll be asked to trust the signer, when executing the script.
You will be prompted with the following::
PS C:\> virtualenv .\foo
New python executable in C:\foo\Scripts\python.exe
Installing setuptools................done.
Installing pip...................done.
PS C:\> .\foo\scripts\activate
Do you want to run software from this untrusted publisher?
File C:\foo\scripts\activate.ps1 is published by E=jannis@leidel.info,
CN=Jannis Leidel, L=Berlin, S=Berlin, C=DE, Description=581796-Gh7xfJxkxQSIO4E0
and is not trusted on your system. Only run scripts from trusted publishers.
[V] Never run [D] Do not run [R] Run once [A] Always run [?] Help
(default is "D"):A
(foo) PS C:\>
If you select ``[A] Always Run``, the certificate will be added to the
Trusted Publishers of your user account, and will be trusted in this
user's context henceforth. If you select ``[R] Run Once``, the script will
be run, but you will be prometed on a subsequent invocation. Advanced users
can add the signer's certificate to the Trusted Publishers of the Computer
account to apply to all users (though this technique is out of scope of this
document).
Alternatively, you may relax the system execution policy to allow running
of local scripts without verifying the code signature using the following::
PS C:\> Set-ExecutionPolicy RemoteSigned
Since the ``activate.ps1`` script is generated locally for each virtualenv,
it is not considered a remote script and can then be executed.
.. _`execution policies`: http://technet.microsoft.com/en-us/library/dd347641.aspx
The ``--system-site-packages`` Option
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
If you build with ``virtualenv --system-site-packages ENV``, your virtual
environment will inherit packages from ``/usr/lib/python2.7/site-packages``
(or wherever your global site-packages directory is).
This can be used if you have control over the global site-packages directory,
and you want to depend on the packages there. If you want isolation from the
global system, do not use this flag.
Environment variables and configuration files
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@ -88,7 +195,7 @@ Description:
For example, to automatically install Distribute instead of setuptools
you can also set an environment variable::
$ export VIRTUALENV_USE_DISTRIBUTE=true
$ export VIRTUALENV_DISTRIBUTE=true
$ python virtualenv.py ENV
It's the same as passing the option to virtualenv directly::
@ -109,7 +216,7 @@ Description:
virtualenv also looks for a standard ini config file. On Unix and Mac OS X
that's ``$HOME/.virtualenv/virtualenv.ini`` and on Windows, it's
``%HOME%\\virtualenv\\virtualenv.ini``.
``%APPDATA%\virtualenv\virtualenv.ini``.
The names of the settings are derived from the long command line option,
e.g. the option ``--distribute`` would look like this::
@ -220,109 +327,9 @@ Description:
Another example is available `here
<https://github.com/socialplanning/fassembler/blob/master/fassembler/create-venv-script.py>`_.
activate script
~~~~~~~~~~~~~~~
In a newly created virtualenv there will be a ``bin/activate`` shell
script. For Windows systems, activation scripts are provided for CMD.exe
and Powershell.
On Posix systems you can do::
$ source bin/activate
This will change your ``$PATH`` to point to the virtualenv's ``bin/``
directory. (You have to use ``source`` because it changes your shell
environment in-place.) This is all it does; it's purely a convenience. If
you directly run a script or the python interpreter from the virtualenv's
``bin/`` directory (e.g. ``path/to/env/bin/pip`` or
``/path/to/env/bin/python script.py``) there's no need for activation.
After activating an environment you can use the function ``deactivate`` to
undo the changes to your ``$PATH``.
The ``activate`` script will also modify your shell prompt to indicate
which environment is currently active. You can disable this behavior,
which can be useful if you have your own custom prompt that already
displays the active environment name. To do so, set the
``VIRTUAL_ENV_DISABLE_PROMPT`` environment variable to any non-empty
value before running the ``activate`` script.
On Windows you just do::
> \path\to\env\Scripts\activate
And type `deactivate` to undo the changes.
Based on your active shell (CMD.exe or Powershell.exe), Windows will use
either activate.bat or activate.ps1 (as appropriate) to activate the
virtual environment. If using Powershell, see the notes about code signing
below.
.. note::
If using Powershell, the ``activate`` script is subject to the
`execution policies`_ on the system. By default on Windows 7, the system's
excution policy is set to ``Restricted``, meaning no scripts like the
``activate`` script are allowed to be executed. But that can't stop us
from changing that slightly to allow it to be executed.
In order to use the script, you have to relax your system's execution
policy to ``AllSigned``, meaning all scripts on the system must be
digitally signed to be executed. Since the virtualenv activation
script is signed by one of the authors (Jannis Leidel) this level of
the execution policy suffices. As an adminstrator run::
PS C:\> Set-ExecutionPolicy AllSigned
Then you'll be asked to trust the signer, when executing the script.
You will be prompted with the following::
PS C:\> virtualenv .\foo
New python executable in C:\foo\Scripts\python.exe
Installing setuptools................done.
Installing pip...................done.
PS C:\> .\foo\scripts\activate
Do you want to run software from this untrusted publisher?
File C:\foo\scripts\activate.ps1 is published by E=jannis@leidel.info,
CN=Jannis Leidel, L=Berlin, S=Berlin, C=DE, Description=581796-Gh7xfJxkxQSIO4E0
and is not trusted on your system. Only run scripts from trusted publishers.
[V] Never run [D] Do not run [R] Run once [A] Always run [?] Help
(default is "D"):A
(foo) PS C:\>
If you select ``[A] Always Run``, the certificate will be added to the
Trusted Publishers of your user account, and will be trusted in this
user's context henceforth. If you select ``[R] Run Once``, the script will
be run, but you will be prometed on a subsequent invocation. Advanced users
can add the signer's certificate to the Trusted Publishers of the Computer
account to apply to all users (though this technique is out of scope of this
document).
Alternatively, you may relax the system execution policy to allow running
of local scripts without verifying the code signature using the following::
PS C:\> Set-ExecutionPolicy RemoteSigned
Since the ``activate.ps1`` script is generated locally for each virtualenv,
it is not considered a remote script and can then be executed.
.. _`execution policies`: http://technet.microsoft.com/en-us/library/dd347641.aspx
The ``--system-site-packages`` Option
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
If you build with ``virtualenv --system-site-packages ENV``, your virtual
environment will inherit packages from ``/usr/lib/python2.7/site-packages``
(or wherever your global site-packages directory is).
This can be used if you have control over the global site-packages directory,
and you want to depend on the packages there. If you want isolation from the
global system, do not use this flag.
Using Virtualenv without ``bin/python``
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
---------------------------------------
Sometimes you can't or don't want to use the Python interpreter
created by the virtualenv. For instance, in a `mod_python
@ -348,7 +355,7 @@ Description:
do it again in that process.
Making Environments Relocatable
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-------------------------------
Note: this option is somewhat experimental, and there are probably
caveats that have not yet been identified. Also this does not
@ -385,16 +392,16 @@ Description:
If you use this flag to create an environment, currently, the
``--system-site-packages`` option will be implied.
The ``--extra-search-dir`` Option
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The ``--extra-search-dir`` option
---------------------------------
When it creates a new environment, virtualenv installs either
setuptools or distribute, and pip. In normal operation, the latest
When it creates a new environment, virtualenv installs either setuptools
or distribute, and pip. In normal operation when virtualenv is
installed, the bundled version of these packages included in the
``virtualenv_support`` directory is used. When ``virtualenv.py`` is run
standalone and ``virtualenv_support`` is not available, the latest
releases of these packages are fetched from the `Python Package Index
<http://pypi.python.org>`_ (PyPI). In some circumstances, this
behavior may not be wanted, for example if you are using virtualenv
during a deployment and do not want to depend on Internet access and
PyPI availability.
<http://pypi.python.org>`_ (PyPI).
As an alternative, you can provide your own versions of setuptools,
distribute and/or pip on the filesystem, and tell virtualenv to use
@ -406,8 +413,9 @@ Description:
The ``/path/to/distributions`` path should point to a directory that
contains setuptools, distribute and/or pip distributions. Setuptools
distributions must be ``.egg`` files; distribute and pip distributions
should be `.tar.gz` source distributions.
distributions must be ``.egg`` files; pip distributions should be
`.tar.gz` source distributions, and distribute distributions may be
either (if found an egg will be used preferentially).
Virtualenv will still download these packages if no satisfactory local
distributions are found.
@ -421,8 +429,8 @@ Description:
If this option is provided, virtualenv will never try to download
setuptools/distribute or pip. Instead, it will exit with status code 1
if it fails to find local distributions for any of these required
packages. The local distribution lookup is done in this order and the
following locations:
packages. The local distribution lookup is done in the following
locations, with the most recent version found used:
#. The current directory.
#. The directory where virtualenv.py is located.
@ -432,6 +440,7 @@ Description:
script), a ``virtualenv_support`` directory relative to wherever
virtualenv.py is actually installed.
Compare & Contrast with Alternatives
------------------------------------
@ -474,13 +483,22 @@ Description:
------------
Refer to the `contributing to pip`_ documentation - it applies equally to
virtualenv.
virtualenv, except that virtualenv issues should filed on the `virtualenv
repo`_ at GitHub.
Virtualenv's release schedule is tied to pip's -- each time there's a new pip
release, there will be a new virtualenv release that bundles the new version of
pip.
Files in the `virtualenv_embedded/` subdirectory are embedded into
`virtualenv.py` itself as base64-encoded strings (in order to support
single-file use of `virtualenv.py` without installing it). If your patch
changes any file in `virtualenv_embedded/`, run `bin/rebuild-script.py` to
update the embedded version of that file in `virtualenv.py`; commit that and
submit it as part of your patch / pull request.
.. _contributing to pip: http://www.pip-installer.org/en/latest/contributing.html
.. _virtualenv repo: https://github.com/pypa/virtualenv/
Running the tests
~~~~~~~~~~~~~~~~~
@ -532,7 +550,7 @@ Description:
<http://code.google.com/p/modwsgi/wiki/VirtualEnvironments>`_.
* `virtualenv commands
<http://thisismedium.com/tech/extending-virtualenv/>`_ for some more
<https://github.com/thisismedium/virtualenv-commands>`_ for some more
workflow-related tools around virtualenv.
Status and License
@ -552,11 +570,144 @@ Description:
Changes & News
--------------
.. warning::
Python bugfix releases 2.6.8, 2.7.3, 3.1.5 and 3.2.3 include a change that
will cause "import random" to fail with "cannot import name urandom" on any
virtualenv created on a Unix host with an earlier release of Python
2.6/2.7/3.1/3.2, if the underlying system Python is upgraded. This is due to
the fact that a virtualenv uses the system Python's standard library but
contains its own copy of the Python interpreter, so an upgrade to the system
Python results in a mismatch between the version of the Python interpreter
and the version of the standard library. It can be fixed by removing
``$ENV/bin/python`` and re-running virtualenv on the same target directory
with the upgraded Python.
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.
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 environemnt 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)
~~~~~~~~~~~~~~~~~~~~
@ -564,6 +715,7 @@ Description:
* Fixed rST rendering bug of long description.
1.7.1 (2012-02-16)
~~~~~~~~~~~~~~~~~~
@ -596,6 +748,7 @@ Description:
* Added activation script for Powershell (signed by Jannis Leidel). Many
thanks to Jason R. Coombs.
1.7 (2011-11-30)
~~~~~~~~~~~~~~~~
@ -619,16 +772,19 @@ Description:
* 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)
~~~~~~~~~~~~~~~~~~
@ -663,6 +819,7 @@ Description:
* Added --never-download and --search-dir options. Thanks Ethan Jucovy.
1.6
~~~
@ -673,6 +830,7 @@ Description:
* Updated bundled pip to 1.0.
1.5.2
~~~~~
@ -688,6 +846,7 @@ Description:
* Moved virtualenv to Github at https://github.com/pypa/virtualenv
1.5.1
~~~~~
@ -695,6 +854,7 @@ Description:
* Fixed Windows regression in 1.5
1.5
~~~
@ -712,11 +872,13 @@ Description:
* Add fish and csh activate scripts.
1.4.9
~~~~~
* Include pip 0.7.2
1.4.8
~~~~~
@ -731,17 +893,20 @@ Description:
* 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
~~~~~
@ -750,6 +915,7 @@ Description:
* Fix ``activate.bat`` and ``deactivate.bat`` under Windows when
``PATH`` contained a parenthesis
1.4.4
~~~~~
@ -761,15 +927,17 @@ Description:
* Fix problem with ``virtualenv --relocate`` when ``bin/`` has
subdirectories (e.g., ``bin/.svn/``); from Alan Franzoni.
* If you set ``$VIRTUALENV_USE_DISTRIBUTE`` then virtualenv will use
* 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
~~~~~
@ -780,11 +948,13 @@ Description:
* Exclude ~/.local (user site-packages) from environments when using
``--no-site-packages``
1.4.1
~~~~~
* Include pip 0.6
1.4
~~~
@ -794,6 +964,7 @@ Description:
* Fixed packaging problem of support-files
1.3.4
~~~~~
@ -823,6 +994,7 @@ Description:
* Fixes for ``--python``: make it work with ``--relocatable`` and the
symlink created to the exact Python version.
1.3.3
~~~~~
@ -845,6 +1017,7 @@ Description:
<https://bugs.launchpad.net/virtualenv/+bug/340050>`_ picking up
some ``.so`` libraries in ``/usr/local``.
1.3.2
~~~~~
@ -852,11 +1025,12 @@ Description:
``distutils.cfg`` -- this has been causing problems for a lot of
people, in rather obscure ways.
* If you use a `boot script <./index.html#boot-script>`_ it will attempt to import ``virtualenv``
* 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
~~~~~
@ -879,6 +1053,7 @@ Description:
* Fixed handling of Jython environments that use a
jython-complete.jar.
1.3
~~~
@ -905,6 +1080,7 @@ Description:
* Fixed the ``__classpath__`` entry in Jython's ``sys.path`` taking
precedent over virtualenv's libs.
1.2
~~~
@ -913,11 +1089,13 @@ Description:
* 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
~~~
@ -932,6 +1110,7 @@ Description:
* Copy or symlink over the ``include`` directory so that packages will
more consistently compile.
1.0
~~~
@ -941,6 +1120,7 @@ Description:
* Fixed typos in ``deactivate.bat``.
* Preserve ``$PYTHONPATH`` when calling subprocesses.
0.9.2
~~~~~
@ -955,6 +1135,7 @@ Description:
* Fixed an issue with Mac Framework Python builds, and absolute paths
(from Ronald Oussoren).
0.9.1
~~~~~
@ -962,6 +1143,7 @@ Description:
* Fix a little bug in ``bin/activate``.
* Actually get ``distutils.cfg`` to work reliably.
0.9
~~~
@ -977,6 +1159,7 @@ Description:
* Should work on MacOSX Framework builds (the default Python
installations on Mac). Thanks to Ronald Oussoren.
0.8.4
~~~~~
@ -984,11 +1167,13 @@ Description:
were inaccurate.
* Slightly prettier output.
0.8.3
~~~~~
* Added support for Windows.
0.8.2
~~~~~
@ -997,11 +1182,13 @@ Description:
* 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
~~~
@ -1013,7 +1200,6 @@ Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 2
Classifier: Programming Language :: Python :: 2.4
Classifier: Programming Language :: Python :: 2.5
Classifier: Programming Language :: Python :: 2.6
Classifier: Programming Language :: Python :: 2.7

Просмотреть файл

@ -0,0 +1,7 @@
virtualenv
==========
.. image:: https://secure.travis-ci.org/pypa/virtualenv.png?branch=develop
:target: http://travis-ci.org/pypa/virtualenv
For documentation, see http://www.virtualenv.org/

Просмотреть файл

@ -0,0 +1,71 @@
#!/usr/bin/env python
"""
Helper script to rebuild virtualenv.py from virtualenv_support
"""
import re
import os
import sys
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""")'
def rebuild():
f = open(script, 'rb')
content = f.read()
f.close()
parts = []
last_pos = 0
match = None
for match in file_regex.finditer(content):
parts.append(content[last_pos:match.start()])
last_pos = match.end()
filename = match.group(1)
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')
if new_data == data:
print(' Reference up to date (%s bytes)' % len(c))
parts.append(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()
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()

Просмотреть файл

@ -0,0 +1,59 @@
#!/usr/bin/env python
"""
Refresh any files in ../virtualenv_support/ that come from elsewhere
"""
import os
try:
from urllib.request import urlopen
except ImportError:
from urllib2 import urlopen
import sys
here = os.path.dirname(__file__)
support_location = os.path.join(here, '..', 'virtualenv_support')
embedded_location = os.path.join(here, '..', 'virtualenv_embedded')
embedded_files = [
('http://peak.telecommunity.com/dist/ez_setup.py', 'ez_setup.py'),
('http://python-distribute.org/distribute_setup.py', 'distribute_setup.py'),
]
support_files = [
('http://pypi.python.org/packages/2.6/s/setuptools/setuptools-0.6c11-py2.6.egg', 'setuptools-0.6c11-py2.6.egg'),
('http://pypi.python.org/packages/2.5/s/setuptools/setuptools-0.6c11-py2.5.egg', 'setuptools-0.6c11-py2.5.egg'),
('http://pypi.python.org/packages/source/d/distribute/distribute-0.6.31.tar.gz', 'distribute-0.6.31.tar.gz'),
('http://pypi.python.org/packages/source/p/pip/pip-1.2.1.tar.gz', 'pip-1.2.1.tar.gz'),
]
def refresh_files(files, location):
for url, filename in files:
sys.stdout.write('fetching %s ... ' % url)
sys.stdout.flush()
f = urlopen(url)
content = f.read()
f.close()
print('done.')
filename = os.path.join(location, filename)
if os.path.exists(filename):
f = open(filename, 'rb')
cur_content = f.read()
f.close()
else:
cur_content = ''
if cur_content == content:
print(' %s up-to-date' % filename)
else:
print(' overwriting %s' % filename)
f = open(filename, 'wb')
f.write(content)
f.close()
def main():
refresh_files(embedded_files, embedded_location)
refresh_files(support_files, support_location)
if __name__ == '__main__':
main()

Просмотреть файл

@ -0,0 +1,130 @@
# Makefile for Sphinx documentation
#
# You can set these variables from the command line.
SPHINXOPTS =
SPHINXBUILD = sphinx-build
PAPER =
BUILDDIR = _build
# Internal variables.
PAPEROPT_a4 = -D latex_paper_size=a4
PAPEROPT_letter = -D latex_paper_size=letter
ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest
help:
@echo "Please use \`make <target>' where <target> is one of"
@echo " html to make standalone HTML files"
@echo " dirhtml to make HTML files named index.html in directories"
@echo " singlehtml to make a single large HTML file"
@echo " pickle to make pickle files"
@echo " json to make JSON files"
@echo " htmlhelp to make HTML files and a HTML help project"
@echo " qthelp to make HTML files and a qthelp project"
@echo " devhelp to make HTML files and a Devhelp project"
@echo " epub to make an epub"
@echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
@echo " latexpdf to make LaTeX files and run them through pdflatex"
@echo " text to make text files"
@echo " man to make manual pages"
@echo " changes to make an overview of all changed/added/deprecated items"
@echo " linkcheck to check all external links for integrity"
@echo " doctest to run all doctests embedded in the documentation (if enabled)"
clean:
-rm -rf $(BUILDDIR)/*
html:
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
@echo
@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
dirhtml:
$(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
@echo
@echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
singlehtml:
$(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
@echo
@echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."
pickle:
$(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
@echo
@echo "Build finished; now you can process the pickle files."
json:
$(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
@echo
@echo "Build finished; now you can process the JSON files."
htmlhelp:
$(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
@echo
@echo "Build finished; now you can run HTML Help Workshop with the" \
".hhp project file in $(BUILDDIR)/htmlhelp."
qthelp:
$(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
@echo
@echo "Build finished; now you can run "qcollectiongenerator" with the" \
".qhcp project file in $(BUILDDIR)/qthelp, like this:"
@echo "# qcollectiongenerator $(BUILDDIR)/qthelp/django-compressor.qhcp"
@echo "To view the help file:"
@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/django-compressor.qhc"
devhelp:
$(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
@echo
@echo "Build finished."
@echo "To view the help file:"
@echo "# mkdir -p $$HOME/.local/share/devhelp/django-compressor"
@echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/django-compressor"
@echo "# devhelp"
epub:
$(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
@echo
@echo "Build finished. The epub file is in $(BUILDDIR)/epub."
latex:
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
@echo
@echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
@echo "Run \`make' in that directory to run these through (pdf)latex" \
"(use \`make latexpdf' here to do that automatically)."
latexpdf:
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
@echo "Running LaTeX files through pdflatex..."
make -C $(BUILDDIR)/latex all-pdf
@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
text:
$(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text
@echo
@echo "Build finished. The text files are in $(BUILDDIR)/text."
man:
$(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man
@echo
@echo "Build finished. The manual pages are in $(BUILDDIR)/man."
changes:
$(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
@echo
@echo "The overview file is in $(BUILDDIR)/changes."
linkcheck:
$(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
@echo
@echo "Link check complete; look for any errors in the above output " \
"or in $(BUILDDIR)/linkcheck/output.txt."
doctest:
$(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
@echo "Testing of doctests in the sources finished, look at the " \
"results in $(BUILDDIR)/doctest/output.txt."

229
python/virtualenv/docs/_theme/nature/static/nature.css_t поставляемый Normal file
Просмотреть файл

@ -0,0 +1,229 @@
/**
* Sphinx stylesheet -- default theme
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/
@import url("basic.css");
/* -- page layout ----------------------------------------------------------- */
body {
font-family: Arial, sans-serif;
font-size: 100%;
background-color: #111;
color: #555;
margin: 0;
padding: 0;
}
div.documentwrapper {
float: left;
width: 100%;
}
div.bodywrapper {
margin: 0 0 0 230px;
}
hr{
border: 1px solid #B1B4B6;
}
div.document {
background-color: #eee;
}
div.body {
background-color: #ffffff;
color: #3E4349;
padding: 0 30px 30px 30px;
font-size: 0.8em;
}
div.footer {
color: #555;
width: 100%;
padding: 13px 0;
text-align: center;
font-size: 75%;
}
div.footer a {
color: #444;
text-decoration: underline;
}
div.related {
background-color: #6BA81E;
line-height: 32px;
color: #fff;
text-shadow: 0px 1px 0 #444;
font-size: 0.80em;
}
div.related a {
color: #E2F3CC;
}
div.sphinxsidebar {
font-size: 0.75em;
line-height: 1.5em;
}
div.sphinxsidebarwrapper{
padding: 20px 0;
}
div.sphinxsidebar h3,
div.sphinxsidebar h4 {
font-family: Arial, sans-serif;
color: #222;
font-size: 1.2em;
font-weight: normal;
margin: 0;
padding: 5px 10px;
background-color: #ddd;
text-shadow: 1px 1px 0 white
}
div.sphinxsidebar h4{
font-size: 1.1em;
}
div.sphinxsidebar h3 a {
color: #444;
}
div.sphinxsidebar p {
color: #888;
padding: 5px 20px;
}
div.sphinxsidebar p.topless {
}
div.sphinxsidebar ul {
margin: 10px 20px;
padding: 0;
color: #000;
}
div.sphinxsidebar a {
color: #444;
}
div.sphinxsidebar input {
border: 1px solid #ccc;
font-family: sans-serif;
font-size: 1em;
}
div.sphinxsidebar input[type=text]{
margin-left: 20px;
}
/* -- body styles ----------------------------------------------------------- */
a {
color: #005B81;
text-decoration: none;
}
a:hover {
color: #E32E00;
text-decoration: underline;
}
div.body h1,
div.body h2,
div.body h3,
div.body h4,
div.body h5,
div.body h6 {
font-family: Arial, sans-serif;
background-color: #BED4EB;
font-weight: normal;
color: #212224;
margin: 30px 0px 10px 0px;
padding: 5px 0 5px 10px;
text-shadow: 0px 1px 0 white
}
div.body h1 { border-top: 20px solid white; margin-top: 0; font-size: 200%; }
div.body h2 { font-size: 150%; background-color: #C8D5E3; }
div.body h3 { font-size: 120%; background-color: #D8DEE3; }
div.body h4 { font-size: 110%; background-color: #D8DEE3; }
div.body h5 { font-size: 100%; background-color: #D8DEE3; }
div.body h6 { font-size: 100%; background-color: #D8DEE3; }
a.headerlink {
color: #c60f0f;
font-size: 0.8em;
padding: 0 4px 0 4px;
text-decoration: none;
}
a.headerlink:hover {
background-color: #c60f0f;
color: white;
}
div.body p, div.body dd, div.body li {
line-height: 1.5em;
}
div.admonition p.admonition-title + p {
display: inline;
}
div.highlight{
background-color: white;
}
div.note {
background-color: #eee;
border: 1px solid #ccc;
}
div.seealso {
background-color: #ffc;
border: 1px solid #ff6;
}
div.topic {
background-color: #eee;
}
div.warning {
background-color: #ffe4e4;
border: 1px solid #f66;
}
p.admonition-title {
display: inline;
}
p.admonition-title:after {
content: ":";
}
pre {
padding: 10px;
background-color: White;
color: #222;
line-height: 1.2em;
border: 1px solid #C6C9CB;
font-size: 1.2em;
margin: 1.5em 0 1.5em 0;
-webkit-box-shadow: 1px 1px 1px #d8d8d8;
-moz-box-shadow: 1px 1px 1px #d8d8d8;
}
tt {
background-color: #ecf0f3;
color: #222;
padding: 1px 2px;
font-size: 1.2em;
font-family: monospace;
}

54
python/virtualenv/docs/_theme/nature/static/pygments.css поставляемый Normal file
Просмотреть файл

@ -0,0 +1,54 @@
.c { color: #999988; font-style: italic } /* Comment */
.k { font-weight: bold } /* Keyword */
.o { font-weight: bold } /* Operator */
.cm { color: #999988; font-style: italic } /* Comment.Multiline */
.cp { color: #999999; font-weight: bold } /* Comment.preproc */
.c1 { color: #999988; font-style: italic } /* Comment.Single */
.gd { color: #000000; background-color: #ffdddd } /* Generic.Deleted */
.ge { font-style: italic } /* Generic.Emph */
.gr { color: #aa0000 } /* Generic.Error */
.gh { color: #999999 } /* Generic.Heading */
.gi { color: #000000; background-color: #ddffdd } /* Generic.Inserted */
.go { color: #111 } /* Generic.Output */
.gp { color: #555555 } /* Generic.Prompt */
.gs { font-weight: bold } /* Generic.Strong */
.gu { color: #aaaaaa } /* Generic.Subheading */
.gt { color: #aa0000 } /* Generic.Traceback */
.kc { font-weight: bold } /* Keyword.Constant */
.kd { font-weight: bold } /* Keyword.Declaration */
.kp { font-weight: bold } /* Keyword.Pseudo */
.kr { font-weight: bold } /* Keyword.Reserved */
.kt { color: #445588; font-weight: bold } /* Keyword.Type */
.m { color: #009999 } /* Literal.Number */
.s { color: #bb8844 } /* Literal.String */
.na { color: #008080 } /* Name.Attribute */
.nb { color: #999999 } /* Name.Builtin */
.nc { color: #445588; font-weight: bold } /* Name.Class */
.no { color: #ff99ff } /* Name.Constant */
.ni { color: #800080 } /* Name.Entity */
.ne { color: #990000; font-weight: bold } /* Name.Exception */
.nf { color: #990000; font-weight: bold } /* Name.Function */
.nn { color: #555555 } /* Name.Namespace */
.nt { color: #000080 } /* Name.Tag */
.nv { color: purple } /* Name.Variable */
.ow { font-weight: bold } /* Operator.Word */
.mf { color: #009999 } /* Literal.Number.Float */
.mh { color: #009999 } /* Literal.Number.Hex */
.mi { color: #009999 } /* Literal.Number.Integer */
.mo { color: #009999 } /* Literal.Number.Oct */
.sb { color: #bb8844 } /* Literal.String.Backtick */
.sc { color: #bb8844 } /* Literal.String.Char */
.sd { color: #bb8844 } /* Literal.String.Doc */
.s2 { color: #bb8844 } /* Literal.String.Double */
.se { color: #bb8844 } /* Literal.String.Escape */
.sh { color: #bb8844 } /* Literal.String.Heredoc */
.si { color: #bb8844 } /* Literal.String.Interpol */
.sx { color: #bb8844 } /* Literal.String.Other */
.sr { color: #808000 } /* Literal.String.Regex */
.s1 { color: #bb8844 } /* Literal.String.Single */
.ss { color: #bb8844 } /* Literal.String.Symbol */
.bp { color: #999999 } /* Name.Builtin.Pseudo */
.vc { color: #ff99ff } /* Name.Variable.Class */
.vg { color: #ff99ff } /* Name.Variable.Global */
.vi { color: #ff99ff } /* Name.Variable.Instance */
.il { color: #009999 } /* Literal.Number.Integer.Long */

4
python/virtualenv/docs/_theme/nature/theme.conf поставляемый Normal file
Просмотреть файл

@ -0,0 +1,4 @@
[theme]
inherit = basic
stylesheet = nature.css
pygments_style = tango

Просмотреть файл

@ -0,0 +1,139 @@
# -*- coding: utf-8 -*-
#
# Paste documentation build configuration file, created by
# sphinx-quickstart on Tue Apr 22 22:08:49 2008.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# The contents of this file are pickled, so don't put values in the namespace
# that aren't pickleable (module imports are okay, they're removed automatically).
#
# All configuration values have a default value; values that are commented out
# serve to show the default value.
import sys
# If your extensions are in another directory, add it here.
#sys.path.append('some/directory')
# General configuration
# ---------------------
# 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']
# 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.
source_suffix = '.txt'
# The master toctree document.
master_doc = 'index'
# General substitutions.
project = 'virtualenv'
copyright = '2007-2012, Ian Bicking, The Open Planning Project, The virtualenv developers'
# The default replacements for |version| and |release|, also used in various
# other places throughout the built documents.
try:
from virtualenv import __version__
# The short X.Y version.
version = '.'.join(__version__.split('.')[:2])
# The full version, including alpha/beta/rc tags.
release = __version__
except ImportError:
version = release = 'dev'
# There are two options for replacing |today|: either, you set today to some
# non-false value, then it is used:
#today = ''
# Else, today_fmt is used as the format for a strftime call.
today_fmt = '%B %d, %Y'
# List of documents that shouldn't be included in the build.
unused_docs = []
# If true, '()' will be appended to :func: etc. cross-reference text.
#add_function_parentheses = True
# If true, the current module name will be prepended to all description
# unit titles (such as .. function::).
#add_module_names = True
# If true, sectionauthor and moduleauthor directives will be shown in the
# output. They are ignored by default.
#show_authors = False
# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx'
# Options for HTML output
# -----------------------
# The style sheet to use for HTML and HTML Help pages. A file of that name
# must exist either in Sphinx' static/ path, or in one of the custom paths
# given in html_static_path.
#html_style = 'default.css'
html_theme = 'nature'
html_theme_path = ['_theme']
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
# html_static_path = ['_static']
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
# using the given strftime format.
html_last_updated_fmt = '%b %d, %Y'
# If true, SmartyPants will be used to convert quotes and dashes to
# typographically correct entities.
#html_use_smartypants = True
# Content template for the index page.
#html_index = ''
# Custom sidebar templates, maps document names to template names.
#html_sidebars = {}
# Additional templates that should be rendered to pages, maps page names to
# template names.
#html_additional_pages = {}
# If false, no module index is generated.
#html_use_modindex = True
# If true, the reST sources are included in the HTML build as _sources/<name>.
#html_copy_source = True
# Output file base name for HTML help builder.
htmlhelp_basename = 'Pastedoc'
# Options for LaTeX output
# ------------------------
# The paper size ('letter' or 'a4').
#latex_paper_size = 'letter'
# The font size ('10pt', '11pt' or '12pt').
#latex_font_size = '10pt'
# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title, author, document class [howto/manual]).
#latex_documents = []
# Additional stuff for the LaTeX preamble.
#latex_preamble = ''
# Documents to append as an appendix to all manuals.
#latex_appendices = []
# If false, no module index is generated.
#latex_use_modindex = True

Просмотреть файл

@ -400,13 +400,13 @@ If you use this flag to create an environment, currently, the
The ``--extra-search-dir`` option
---------------------------------
When it creates a new environment, virtualenv installs either
setuptools or distribute, and pip. In normal operation, the latest
When it creates a new environment, virtualenv installs either setuptools
or distribute, and pip. In normal operation when virtualenv is
installed, the bundled version of these packages included in the
``virtualenv_support`` directory is used. When ``virtualenv.py`` is run
standalone and ``virtualenv_support`` is not available, the latest
releases of these packages are fetched from the `Python Package Index
<http://pypi.python.org>`_ (PyPI). In some circumstances, this
behavior may not be wanted, for example if you are using virtualenv
during a deployment and do not want to depend on Internet access and
PyPI availability.
<http://pypi.python.org>`_ (PyPI).
As an alternative, you can provide your own versions of setuptools,
distribute and/or pip on the filesystem, and tell virtualenv to use
@ -418,8 +418,9 @@ virtualenv like this::
The ``/path/to/distributions`` path should point to a directory that
contains setuptools, distribute and/or pip distributions. Setuptools
distributions must be ``.egg`` files; distribute and pip distributions
should be `.tar.gz` source distributions.
distributions must be ``.egg`` files; pip distributions should be
`.tar.gz` source distributions, and distribute distributions may be
either (if found an egg will be used preferentially).
Virtualenv will still download these packages if no satisfactory local
distributions are found.
@ -433,8 +434,8 @@ provide an option ``--never-download`` like so::
If this option is provided, virtualenv will never try to download
setuptools/distribute or pip. Instead, it will exit with status code 1
if it fails to find local distributions for any of these required
packages. The local distribution lookup is done in this order and the
following locations:
packages. The local distribution lookup is done in the following
locations, with the most recent version found used:
#. The current directory.
#. The directory where virtualenv.py is located.
@ -444,6 +445,7 @@ following locations:
script), a ``virtualenv_support`` directory relative to wherever
virtualenv.py is actually installed.
Compare & Contrast with Alternatives
------------------------------------
@ -493,6 +495,13 @@ Virtualenv's release schedule is tied to pip's -- each time there's a new pip
release, there will be a new virtualenv release that bundles the new version of
pip.
Files in the `virtualenv_embedded/` subdirectory are embedded into
`virtualenv.py` itself as base64-encoded strings (in order to support
single-file use of `virtualenv.py` without installing it). If your patch
changes any file in `virtualenv_embedded/`, run `bin/rebuild-script.py` to
update the embedded version of that file in `virtualenv.py`; commit that and
submit it as part of your patch / pull request.
.. _contributing to pip: http://www.pip-installer.org/en/latest/contributing.html
.. _virtualenv repo: https://github.com/pypa/virtualenv/

Просмотреть файл

@ -0,0 +1,170 @@
@ECHO OFF
REM Command file for Sphinx documentation
if "%SPHINXBUILD%" == "" (
set SPHINXBUILD=sphinx-build
)
set BUILDDIR=_build
set ALLSPHINXOPTS=-d %BUILDDIR%/doctrees %SPHINXOPTS% .
if NOT "%PAPER%" == "" (
set ALLSPHINXOPTS=-D latex_paper_size=%PAPER% %ALLSPHINXOPTS%
)
if "%1" == "" goto help
if "%1" == "help" (
:help
echo.Please use `make ^<target^>` where ^<target^> is one of
echo. html to make standalone HTML files
echo. dirhtml to make HTML files named index.html in directories
echo. singlehtml to make a single large HTML file
echo. pickle to make pickle files
echo. json to make JSON files
echo. htmlhelp to make HTML files and a HTML help project
echo. qthelp to make HTML files and a qthelp project
echo. devhelp to make HTML files and a Devhelp project
echo. epub to make an epub
echo. latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter
echo. text to make text files
echo. man to make manual pages
echo. changes to make an overview over all changed/added/deprecated items
echo. linkcheck to check all external links for integrity
echo. doctest to run all doctests embedded in the documentation if enabled
goto end
)
if "%1" == "clean" (
for /d %%i in (%BUILDDIR%\*) do rmdir /q /s %%i
del /q /s %BUILDDIR%\*
goto end
)
if "%1" == "html" (
%SPHINXBUILD% -b html %ALLSPHINXOPTS% %BUILDDIR%/html
if errorlevel 1 exit /b 1
echo.
echo.Build finished. The HTML pages are in %BUILDDIR%/html.
goto end
)
if "%1" == "dirhtml" (
%SPHINXBUILD% -b dirhtml %ALLSPHINXOPTS% %BUILDDIR%/dirhtml
if errorlevel 1 exit /b 1
echo.
echo.Build finished. The HTML pages are in %BUILDDIR%/dirhtml.
goto end
)
if "%1" == "singlehtml" (
%SPHINXBUILD% -b singlehtml %ALLSPHINXOPTS% %BUILDDIR%/singlehtml
if errorlevel 1 exit /b 1
echo.
echo.Build finished. The HTML pages are in %BUILDDIR%/singlehtml.
goto end
)
if "%1" == "pickle" (
%SPHINXBUILD% -b pickle %ALLSPHINXOPTS% %BUILDDIR%/pickle
if errorlevel 1 exit /b 1
echo.
echo.Build finished; now you can process the pickle files.
goto end
)
if "%1" == "json" (
%SPHINXBUILD% -b json %ALLSPHINXOPTS% %BUILDDIR%/json
if errorlevel 1 exit /b 1
echo.
echo.Build finished; now you can process the JSON files.
goto end
)
if "%1" == "htmlhelp" (
%SPHINXBUILD% -b htmlhelp %ALLSPHINXOPTS% %BUILDDIR%/htmlhelp
if errorlevel 1 exit /b 1
echo.
echo.Build finished; now you can run HTML Help Workshop with the ^
.hhp project file in %BUILDDIR%/htmlhelp.
goto end
)
if "%1" == "qthelp" (
%SPHINXBUILD% -b qthelp %ALLSPHINXOPTS% %BUILDDIR%/qthelp
if errorlevel 1 exit /b 1
echo.
echo.Build finished; now you can run "qcollectiongenerator" with the ^
.qhcp project file in %BUILDDIR%/qthelp, like this:
echo.^> qcollectiongenerator %BUILDDIR%\qthelp\django-compressor.qhcp
echo.To view the help file:
echo.^> assistant -collectionFile %BUILDDIR%\qthelp\django-compressor.ghc
goto end
)
if "%1" == "devhelp" (
%SPHINXBUILD% -b devhelp %ALLSPHINXOPTS% %BUILDDIR%/devhelp
if errorlevel 1 exit /b 1
echo.
echo.Build finished.
goto end
)
if "%1" == "epub" (
%SPHINXBUILD% -b epub %ALLSPHINXOPTS% %BUILDDIR%/epub
if errorlevel 1 exit /b 1
echo.
echo.Build finished. The epub file is in %BUILDDIR%/epub.
goto end
)
if "%1" == "latex" (
%SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex
if errorlevel 1 exit /b 1
echo.
echo.Build finished; the LaTeX files are in %BUILDDIR%/latex.
goto end
)
if "%1" == "text" (
%SPHINXBUILD% -b text %ALLSPHINXOPTS% %BUILDDIR%/text
if errorlevel 1 exit /b 1
echo.
echo.Build finished. The text files are in %BUILDDIR%/text.
goto end
)
if "%1" == "man" (
%SPHINXBUILD% -b man %ALLSPHINXOPTS% %BUILDDIR%/man
if errorlevel 1 exit /b 1
echo.
echo.Build finished. The manual pages are in %BUILDDIR%/man.
goto end
)
if "%1" == "changes" (
%SPHINXBUILD% -b changes %ALLSPHINXOPTS% %BUILDDIR%/changes
if errorlevel 1 exit /b 1
echo.
echo.The overview file is in %BUILDDIR%/changes.
goto end
)
if "%1" == "linkcheck" (
%SPHINXBUILD% -b linkcheck %ALLSPHINXOPTS% %BUILDDIR%/linkcheck
if errorlevel 1 exit /b 1
echo.
echo.Link check complete; look for any errors in the above output ^
or in %BUILDDIR%/linkcheck/output.txt.
goto end
)
if "%1" == "doctest" (
%SPHINXBUILD% -b doctest %ALLSPHINXOPTS% %BUILDDIR%/doctest
if errorlevel 1 exit /b 1
echo.
echo.Testing of doctests in the sources finished, look at the ^
results in %BUILDDIR%/doctest/output.txt.
goto end
)
:end

Просмотреть файл

@ -14,6 +14,94 @@ Changes & News
``$ENV/bin/python`` and re-running virtualenv on the same target directory
with the upgraded Python.
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.
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 environemnt 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)
~~~~~~~~~~~~~~~~~~
@ -44,11 +132,13 @@ Changes & News
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)
~~~~~~~~~~~~~~~~~~~~
@ -56,6 +146,7 @@ Changes & News
* Fixed rST rendering bug of long description.
1.7.1 (2012-02-16)
~~~~~~~~~~~~~~~~~~
@ -88,6 +179,7 @@ Changes & News
* Added activation script for Powershell (signed by Jannis Leidel). Many
thanks to Jason R. Coombs.
1.7 (2011-11-30)
~~~~~~~~~~~~~~~~
@ -111,16 +203,19 @@ Changes & News
* 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)
~~~~~~~~~~~~~~~~~~
@ -155,6 +250,7 @@ Changes & News
* Added --never-download and --search-dir options. Thanks Ethan Jucovy.
1.6
~~~
@ -165,6 +261,7 @@ Changes & News
* Updated bundled pip to 1.0.
1.5.2
~~~~~
@ -180,6 +277,7 @@ Changes & News
* Moved virtualenv to Github at https://github.com/pypa/virtualenv
1.5.1
~~~~~
@ -187,6 +285,7 @@ Changes & News
* Fixed Windows regression in 1.5
1.5
~~~
@ -204,11 +303,13 @@ Changes & News
* Add fish and csh activate scripts.
1.4.9
~~~~~
* Include pip 0.7.2
1.4.8
~~~~~
@ -223,17 +324,20 @@ Changes & News
* 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
~~~~~
@ -242,6 +346,7 @@ Changes & News
* Fix ``activate.bat`` and ``deactivate.bat`` under Windows when
``PATH`` contained a parenthesis
1.4.4
~~~~~
@ -257,11 +362,13 @@ Changes & News
Distribute by default (so you don't have to remember to use
``--distribute``).
1.4.3
~~~~~
* Include pip 0.6.1
1.4.2
~~~~~
@ -272,11 +379,13 @@ Changes & News
* Exclude ~/.local (user site-packages) from environments when using
``--no-site-packages``
1.4.1
~~~~~
* Include pip 0.6
1.4
~~~
@ -286,6 +395,7 @@ Changes & News
* Fixed packaging problem of support-files
1.3.4
~~~~~
@ -315,6 +425,7 @@ Changes & News
* Fixes for ``--python``: make it work with ``--relocatable`` and the
symlink created to the exact Python version.
1.3.3
~~~~~
@ -337,6 +448,7 @@ Changes & News
<https://bugs.launchpad.net/virtualenv/+bug/340050>`_ picking up
some ``.so`` libraries in ``/usr/local``.
1.3.2
~~~~~
@ -349,6 +461,7 @@ Changes & News
* Added platform-specific paths, like ``/usr/lib/pythonX.Y/plat-linux2``
1.3.1
~~~~~
@ -371,6 +484,7 @@ Changes & News
* Fixed handling of Jython environments that use a
jython-complete.jar.
1.3
~~~
@ -397,6 +511,7 @@ Changes & News
* Fixed the ``__classpath__`` entry in Jython's ``sys.path`` taking
precedent over virtualenv's libs.
1.2
~~~
@ -405,11 +520,13 @@ Changes & News
* 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
~~~
@ -424,6 +541,7 @@ Changes & News
* Copy or symlink over the ``include`` directory so that packages will
more consistently compile.
1.0
~~~
@ -433,6 +551,7 @@ Changes & News
* Fixed typos in ``deactivate.bat``.
* Preserve ``$PYTHONPATH`` when calling subprocesses.
0.9.2
~~~~~
@ -447,6 +566,7 @@ Changes & News
* Fixed an issue with Mac Framework Python builds, and absolute paths
(from Ronald Oussoren).
0.9.1
~~~~~
@ -454,6 +574,7 @@ Changes & News
* Fix a little bug in ``bin/activate``.
* Actually get ``distutils.cfg`` to work reliably.
0.9
~~~
@ -469,6 +590,7 @@ Changes & News
* Should work on MacOSX Framework builds (the default Python
installations on Mac). Thanks to Ronald Oussoren.
0.8.4
~~~~~
@ -476,11 +598,13 @@ Changes & News
were inaccurate.
* Slightly prettier output.
0.8.3
~~~~~
* Added support for Windows.
0.8.2
~~~~~
@ -489,11 +613,13 @@ Changes & News
* 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
~~~

Просмотреть файл

@ -71,7 +71,6 @@ setup(
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.4',
'Programming Language :: Python :: 2.5',
'Programming Language :: Python :: 2.6',
'Programming Language :: Python :: 2.7',

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -1,31 +1,26 @@
@echo off
set VIRTUAL_ENV=__VIRTUAL_ENV__
if not defined PROMPT (
set PROMPT=$P$G
)
set "VIRTUAL_ENV=__VIRTUAL_ENV__"
if defined _OLD_VIRTUAL_PROMPT (
set PROMPT=%_OLD_VIRTUAL_PROMPT%
set "PROMPT=%_OLD_VIRTUAL_PROMPT%"
) else (
if not defined PROMPT (
set "PROMPT=$P$G"
)
set "_OLD_VIRTUAL_PROMPT=%PROMPT%"
)
set "PROMPT=__VIRTUAL_WINPROMPT__ %PROMPT%"
if defined _OLD_VIRTUAL_PYTHONHOME (
set PYTHONHOME=%_OLD_VIRTUAL_PYTHONHOME%
if not defined _OLD_VIRTUAL_PYTHONHOME (
set "_OLD_VIRTUAL_PYTHONHOME=%PYTHONHOME%"
)
set PYTHONHOME=
set _OLD_VIRTUAL_PROMPT=%PROMPT%
set PROMPT=__VIRTUAL_WINPROMPT__ %PROMPT%
if defined PYTHONHOME (
set _OLD_VIRTUAL_PYTHONHOME=%PYTHONHOME%
set PYTHONHOME=
if defined _OLD_VIRTUAL_PATH (
set "PATH=%_OLD_VIRTUAL_PATH%"
) else (
set "_OLD_VIRTUAL_PATH=%PATH%"
)
if defined _OLD_VIRTUAL_PATH set PATH=%_OLD_VIRTUAL_PATH%; goto SKIPPATH
set _OLD_VIRTUAL_PATH=%PATH%
:SKIPPATH
set PATH=%VIRTUAL_ENV%\__BIN_NAME__;%PATH%
set "PATH=%VIRTUAL_ENV%\__BIN_NAME__;%PATH%"
:END

Просмотреть файл

@ -4,7 +4,7 @@
alias deactivate 'test $?_OLD_VIRTUAL_PATH != 0 && setenv PATH "$_OLD_VIRTUAL_PATH" && unset _OLD_VIRTUAL_PATH; rehash; test $?_OLD_VIRTUAL_PROMPT != 0 && set prompt="$_OLD_VIRTUAL_PROMPT" && unset _OLD_VIRTUAL_PROMPT; unsetenv VIRTUAL_ENV; test "\!:*" != "nondestructive" && unalias deactivate && unalias pydoc'
# Unset irrelavent variables.
# Unset irrelevant variables.
deactivate nondestructive
setenv VIRTUAL_ENV "__VIRTUAL_ENV__"
@ -12,7 +12,7 @@ setenv VIRTUAL_ENV "__VIRTUAL_ENV__"
set _OLD_VIRTUAL_PATH="$PATH"
setenv PATH "$VIRTUAL_ENV/__BIN_NAME__:$PATH"
set _OLD_VIRTUAL_PROMPT="$prompt"
if ("__VIRTUAL_PROMPT__" != "") then
set env_name = "__VIRTUAL_PROMPT__"
@ -25,7 +25,15 @@ else
set env_name = `basename "$VIRTUAL_ENV"`
endif
endif
set prompt = "[$env_name] $prompt"
# Could be in a non-interactive environment,
# in which case, $prompt is undefined and we wouldn't
# care about the prompt anyway.
if ( $?prompt ) then
set _OLD_VIRTUAL_PROMPT="$prompt"
set prompt = "[$env_name] $prompt"
endif
unset env_name
alias pydoc python -m pydoc

Просмотреть файл

@ -29,7 +29,7 @@ function deactivate -d "Exit virtualenv and return to normal shell environment"
end
end
# unset irrelavent variables
# unset irrelevant variables
deactivate nondestructive
set -gx VIRTUAL_ENV "__VIRTUAL_ENV__"

Просмотреть файл

@ -36,7 +36,7 @@ deactivate () {
fi
}
# unset irrelavent variables
# unset irrelevant variables
deactivate nondestructive
VIRTUAL_ENV="__VIRTUAL_ENV__"

Просмотреть файл

@ -1,17 +1,18 @@
@echo off
if defined _OLD_VIRTUAL_PROMPT (
set PROMPT=%_OLD_VIRTUAL_PROMPT%
set "PROMPT=%_OLD_VIRTUAL_PROMPT%"
set _OLD_VIRTUAL_PROMPT=
)
set _OLD_VIRTUAL_PROMPT=
if defined _OLD_VIRTUAL_PYTHONHOME (
set PYTHONHOME=%_OLD_VIRTUAL_PYTHONHOME%
set _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=
if defined _OLD_VIRTUAL_PATH (
set "PATH=%_OLD_VIRTUAL_PATH%"
set _OLD_VIRTUAL_PATH=
)
:END

Просмотреть файл

@ -0,0 +1,8 @@
# Called from virtualenv with parameters:
# [--always-unzip] [-v] egg_name
# So, the distribute egg is always the last argument.
import sys
eggname = sys.argv[-1]
sys.path.insert(0, eggname)
from setuptools.command.easy_install import main
main(sys.argv[1:])

Просмотреть файл

@ -20,6 +20,8 @@ import time
import fnmatch
import tempfile
import tarfile
import optparse
from distutils import log
try:
@ -47,7 +49,7 @@ except ImportError:
args = [quote(arg) for arg in args]
return os.spawnl(os.P_WAIT, sys.executable, *args) == 0
DEFAULT_VERSION = "0.6.27"
DEFAULT_VERSION = "0.6.31"
DEFAULT_URL = "http://pypi.python.org/packages/source/d/distribute/"
SETUPTOOLS_FAKED_VERSION = "0.6c11"
@ -85,6 +87,8 @@ def _install(tarball, install_args=()):
if not _python_cmd('setup.py', 'install', *install_args):
log.warn('Something went wrong during the installation.')
log.warn('See the error message above.')
# exitcode will be 2
return 2
finally:
os.chdir(old_wd)
shutil.rmtree(tmpdir)
@ -147,7 +151,7 @@ def use_setuptools(version=DEFAULT_VERSION, download_base=DEFAULT_URL,
except ImportError:
return _do_download(version, download_base, to_dir, download_delay)
try:
pkg_resources.require("distribute>="+version)
pkg_resources.require("distribute>=" + version)
return
except pkg_resources.VersionConflict:
e = sys.exc_info()[1]
@ -170,6 +174,7 @@ def use_setuptools(version=DEFAULT_VERSION, download_base=DEFAULT_URL,
if not no_fake:
_create_fake_setuptools_pkg_info(to_dir)
def download_setuptools(version=DEFAULT_VERSION, download_base=DEFAULT_URL,
to_dir=os.curdir, delay=15):
"""Download distribute from a specified location and return its filename
@ -206,6 +211,7 @@ def download_setuptools(version=DEFAULT_VERSION, download_base=DEFAULT_URL,
dst.close()
return os.path.realpath(saveto)
def _no_sandbox(function):
def __no_sandbox(*args, **kw):
try:
@ -230,6 +236,7 @@ def _no_sandbox(function):
return __no_sandbox
def _patch_file(path, content):
"""Will backup the file then patch it"""
existing_content = open(path).read()
@ -248,15 +255,18 @@ def _patch_file(path, content):
_patch_file = _no_sandbox(_patch_file)
def _same_content(path, content):
return open(path).read() == content
def _rename_path(path):
new_name = path + '.OLD.%s' % time.time()
log.warn('Renaming %s into %s', path, new_name)
log.warn('Renaming %s to %s', path, new_name)
os.rename(path, new_name)
return new_name
def _remove_flat_installation(placeholder):
if not os.path.isdir(placeholder):
log.warn('Unkown installation at %s', placeholder)
@ -270,7 +280,7 @@ def _remove_flat_installation(placeholder):
log.warn('Could not locate setuptools*.egg-info')
return
log.warn('Removing elements out of the way...')
log.warn('Moving elements out of the way...')
pkg_info = os.path.join(placeholder, file)
if os.path.isdir(pkg_info):
patched = _patch_egg_dir(pkg_info)
@ -292,11 +302,13 @@ def _remove_flat_installation(placeholder):
_remove_flat_installation = _no_sandbox(_remove_flat_installation)
def _after_install(dist):
log.warn('After install bootstrap.')
placeholder = dist.get_command_obj('install').install_purelib
_create_fake_setuptools_pkg_info(placeholder)
def _create_fake_setuptools_pkg_info(placeholder):
if not placeholder or not os.path.exists(placeholder):
log.warn('Could not find the install location')
@ -309,11 +321,12 @@ def _create_fake_setuptools_pkg_info(placeholder):
log.warn('%s already exists', pkg_info)
return
if not os.access(pkg_info, os.W_OK):
log.warn("Don't have permissions to write %s, skipping", pkg_info)
log.warn('Creating %s', pkg_info)
f = open(pkg_info, 'w')
try:
f = open(pkg_info, 'w')
except EnvironmentError:
log.warn("Don't have permissions to write %s, skipping", pkg_info)
return
try:
f.write(SETUPTOOLS_PKG_INFO)
finally:
@ -327,7 +340,10 @@ def _create_fake_setuptools_pkg_info(placeholder):
finally:
f.close()
_create_fake_setuptools_pkg_info = _no_sandbox(_create_fake_setuptools_pkg_info)
_create_fake_setuptools_pkg_info = _no_sandbox(
_create_fake_setuptools_pkg_info
)
def _patch_egg_dir(path):
# let's check if it's already patched
@ -349,6 +365,7 @@ def _patch_egg_dir(path):
_patch_egg_dir = _no_sandbox(_patch_egg_dir)
def _before_install():
log.warn('Before install bootstrap.')
_fake_setuptools()
@ -357,7 +374,7 @@ def _before_install():
def _under_prefix(location):
if 'install' not in sys.argv:
return True
args = sys.argv[sys.argv.index('install')+1:]
args = sys.argv[sys.argv.index('install') + 1:]
for index, arg in enumerate(args):
for option in ('--root', '--prefix'):
if arg.startswith('%s=' % option):
@ -365,7 +382,7 @@ def _under_prefix(location):
return location.startswith(top_dir)
elif arg == option:
if len(args) > index:
top_dir = args[index+1]
top_dir = args[index + 1]
return location.startswith(top_dir)
if arg == '--user' and USER_SITE is not None:
return location.startswith(USER_SITE)
@ -382,11 +399,14 @@ def _fake_setuptools():
return
ws = pkg_resources.working_set
try:
setuptools_dist = ws.find(pkg_resources.Requirement.parse('setuptools',
replacement=False))
setuptools_dist = ws.find(
pkg_resources.Requirement.parse('setuptools', replacement=False)
)
except TypeError:
# old distribute API
setuptools_dist = ws.find(pkg_resources.Requirement.parse('setuptools'))
setuptools_dist = ws.find(
pkg_resources.Requirement.parse('setuptools')
)
if setuptools_dist is None:
log.warn('No setuptools distribution found')
@ -420,7 +440,7 @@ def _fake_setuptools():
res = _patch_egg_dir(setuptools_location)
if not res:
return
log.warn('Patched done.')
log.warn('Patching complete.')
_relaunch()
@ -428,7 +448,9 @@ def _relaunch():
log.warn('Relaunching...')
# we have to relaunch the process
# pip marker to avoid a relaunch bug
if sys.argv[:3] == ['-c', 'install', '--single-version-externally-managed']:
_cmd1 = ['-c', 'install', '--single-version-externally-managed']
_cmd2 = ['-c', 'install', '--record']
if sys.argv[:3] == _cmd1 or sys.argv[:3] == _cmd2:
sys.argv[0] = 'setup.py'
args = [sys.executable] + sys.argv
sys.exit(subprocess.call(args))
@ -454,7 +476,7 @@ def _extractall(self, path=".", members=None):
# Extract directories with a safe mode.
directories.append(tarinfo)
tarinfo = copy.copy(tarinfo)
tarinfo.mode = 448 # decimal for oct 0700
tarinfo.mode = 448 # decimal for oct 0700
self.extract(tarinfo, path)
# Reverse sort directories.
@ -480,21 +502,40 @@ def _extractall(self, path=".", members=None):
else:
self._dbg(1, "tarfile: %s" % e)
def _build_install_args(argv):
def _build_install_args(options):
"""
Build the arguments to 'python setup.py install' on the distribute package
"""
install_args = []
user_install = '--user' in argv
if user_install and sys.version_info < (2,6):
log.warn("--user requires Python 2.6 or later")
raise SystemExit(1)
if user_install:
if options.user_install:
if sys.version_info < (2, 6):
log.warn("--user requires Python 2.6 or later")
raise SystemExit(1)
install_args.append('--user')
return install_args
def main(argv, version=DEFAULT_VERSION):
"""Install or upgrade setuptools and EasyInstall"""
tarball = download_setuptools()
_install(tarball, _build_install_args(argv))
def _parse_args():
"""
Parse the command line for options
"""
parser = optparse.OptionParser()
parser.add_option(
'--user', dest='user_install', action='store_true', default=False,
help='install in user site package (requires Python 2.6 or later)')
parser.add_option(
'--download-base', dest='download_base', metavar="URL",
default=DEFAULT_URL,
help='alternative URL from where to download the distribute package')
options, args = parser.parse_args()
# positional arguments are ignored
return options
def main(version=DEFAULT_VERSION):
"""Install or upgrade setuptools and EasyInstall"""
options = _parse_args()
tarball = download_setuptools(download_base=options.download_base)
return _install(tarball, _build_install_args(options))
if __name__ == '__main__':
main(sys.argv[1:])
sys.exit(main())

Просмотреть файл

@ -1,6 +1,7 @@
import os
import sys
import warnings
import imp
import opcode # opcode is not a virtualenv module, so we can use it to find the stdlib
# Important! To work on pypy, this must be a module that resides in the
# lib-python/modified-x.y.z directory
@ -13,7 +14,13 @@ if os.path.normpath(distutils_path) == os.path.dirname(os.path.normpath(__file__
"The virtualenv distutils package at %s appears to be in the same location as the system distutils?")
else:
__path__.insert(0, distutils_path)
exec(open(os.path.join(distutils_path, '__init__.py')).read())
real_distutils = imp.load_module("_virtualenv_distutils", None, distutils_path, ('', '', imp.PKG_DIRECTORY))
# Copy the relevant attributes
try:
__revision__ = real_distutils.__revision__
except AttributeError:
pass
__version__ = real_distutils.__version__
from distutils import dist, sysconfig

Просмотреть файл

@ -103,8 +103,7 @@ def use_setuptools(
return do_download()
try:
pkg_resources.require("setuptools>="+version); return
except pkg_resources.VersionConflict:
e = sys.exc_info()[1]
except pkg_resources.VersionConflict, e:
if was_imported:
print >>sys.stderr, (
"The required version of setuptools (>=%s) is not available, and\n"
@ -239,8 +238,8 @@ def main(argv, version=DEFAULT_VERSION):
from setuptools.command.easy_install import main
main(argv)
else:
print("Setuptools version",version,"or greater has been installed.")
print('(Run "ez_setup.py -U setuptools" to reinstall or upgrade.)')
print "Setuptools version",version,"or greater has been installed."
print '(Run "ez_setup.py -U setuptools" to reinstall or upgrade.)'
def update_md5(filenames):
"""Update our built-in md5 registry"""

Просмотреть файл

@ -238,7 +238,10 @@ def addsitepackages(known_paths, sys_prefix=sys.prefix, exec_prefix=sys.exec_pre
lib64_dir = os.path.join(prefix, "lib64", "python" + sys.version[:3], "site-packages")
if (os.path.exists(lib64_dir) and
os.path.realpath(lib64_dir) not in [os.path.realpath(p) for p in sitedirs]):
sitedirs.append(lib64_dir)
if sys.maxsize > 2**32:
sitedirs.insert(0, lib64_dir)
else:
sitedirs.append(lib64_dir)
try:
# sys.getobjects only available in --with-pydebug build
sys.getobjects
@ -577,10 +580,23 @@ def virtual_install_main_packages():
hardcoded_relative_dirs = paths[:] # for the special 'darwin' case below
lib64_path = os.path.join(sys.real_prefix, 'lib64', 'python'+sys.version[:3])
if os.path.exists(lib64_path):
paths.append(lib64_path)
# This is hardcoded in the Python executable, but relative to sys.prefix:
plat_path = os.path.join(sys.real_prefix, 'lib', 'python'+sys.version[:3],
'plat-%s' % sys.platform)
if sys.maxsize > 2**32:
paths.insert(0, lib64_path)
else:
paths.append(lib64_path)
# This is hardcoded in the Python executable, but relative to
# sys.prefix. Debian change: we need to add the multiarch triplet
# here, which is where the real stuff lives. As per PEP 421, in
# Python 3.3+, this lives in sys.implementation, while in Python 2.7
# it lives in sys.
try:
arch = getattr(sys, 'implementation', sys)._multiarch
except AttributeError:
# This is a non-multiarch aware Python. Fallback to the old way.
arch = sys.platform
plat_path = os.path.join(sys.real_prefix, 'lib',
'python'+sys.version[:3],
'plat-%s' % arch)
if os.path.exists(plat_path):
paths.append(plat_path)
# This is hardcoded in the Python executable, but

Двоичный файл не отображается.

Двоичные данные
python/virtualenv/virtualenv_support/distribute-0.6.31.tar.gz Normal file

Двоичный файл не отображается.

Двоичный файл не отображается.

Двоичные данные
python/virtualenv/virtualenv_support/pip-1.2.1.tar.gz Normal file

Двоичный файл не отображается.

Двоичный файл не отображается.