Ticket 718: Update to use newer version of virtualenv
authorAnders Henja <anders@henjab.se>
Thu, 8 Feb 2018 19:57:41 +0000 (20:57 +0100)
committerAnders Henja <anders@henjab.se>
Thu, 8 Feb 2018 19:57:41 +0000 (20:57 +0100)
45 files changed:
misc/virtualenv/AUTHORS.txt
misc/virtualenv/HACKING [deleted file]
misc/virtualenv/LICENSE.txt
misc/virtualenv/MANIFEST.in
misc/virtualenv/PKG-INFO
misc/virtualenv/README.rst [new file with mode: 0644]
misc/virtualenv/bin/rebuild-script.py
misc/virtualenv/bin/refresh-support-files.py [deleted file]
misc/virtualenv/docs/_theme/nature/static/nature.css_t [deleted file]
misc/virtualenv/docs/_theme/nature/static/pygments.css [deleted file]
misc/virtualenv/docs/_theme/nature/theme.conf [deleted file]
misc/virtualenv/docs/changes.rst [new file with mode: 0644]
misc/virtualenv/docs/conf.py
misc/virtualenv/docs/development.rst [new file with mode: 0644]
misc/virtualenv/docs/index.rst [new file with mode: 0644]
misc/virtualenv/docs/index.txt [deleted file]
misc/virtualenv/docs/installation.rst [new file with mode: 0644]
misc/virtualenv/docs/news.txt [deleted file]
misc/virtualenv/docs/reference.rst [new file with mode: 0644]
misc/virtualenv/docs/userguide.rst [new file with mode: 0644]
misc/virtualenv/setup.cfg
misc/virtualenv/setup.py
misc/virtualenv/tests/test_activate.sh [new file with mode: 0755]
misc/virtualenv/tests/test_activate_output.expected [new file with mode: 0644]
misc/virtualenv/tests/test_cmdline.py [new file with mode: 0644]
misc/virtualenv/tests/test_virtualenv.py
misc/virtualenv/virtualenv.py
misc/virtualenv/virtualenv_support/activate.bat [deleted file]
misc/virtualenv/virtualenv_support/activate.csh [deleted file]
misc/virtualenv/virtualenv_support/activate.fish [deleted file]
misc/virtualenv/virtualenv_support/activate.sh [deleted file]
misc/virtualenv/virtualenv_support/argparse-1.4.0-py2.py3-none-any.whl [new file with mode: 0644]
misc/virtualenv/virtualenv_support/deactivate.bat [deleted file]
misc/virtualenv/virtualenv_support/distribute-0.6.24.tar.gz [deleted file]
misc/virtualenv/virtualenv_support/distutils.cfg [deleted file]
misc/virtualenv/virtualenv_support/pip-1.0.2.tar.gz [deleted file]
misc/virtualenv/virtualenv_support/pip-9.0.1-py2.py3-none-any.whl [new file with mode: 0644]
misc/virtualenv/virtualenv_support/setuptools-0.6c11-py2.4.egg [deleted file]
misc/virtualenv/virtualenv_support/setuptools-0.6c11-py2.5.egg [deleted file]
misc/virtualenv/virtualenv_support/setuptools-0.6c11-py2.6.egg [deleted file]
misc/virtualenv/virtualenv_support/setuptools-0.6c11-py2.7.egg [deleted file]
misc/virtualenv/virtualenv_support/setuptools-28.8.0-py2.py3-none-any.whl [new file with mode: 0644]
misc/virtualenv/virtualenv_support/wheel-0.29.0-py2.py3-none-any.whl [new file with mode: 0644]
server/setup.py
server/src/baltrad/bdbserver/web/util.py

index 093a83b..2724941 100644 (file)
@@ -9,25 +9,83 @@ Maintainers
 Brian Rosner
 Carl Meyer
 Jannis Leidel
+Paul Moore
+Paul Nasrat
+Marcus Smith
 
 Contributors
 ------------
 
 Alex Grönholm
+Anatoly Techtonik
 Antonio Cuni
+Antonio Valentino
 Armin Ronacher
+Barry Warsaw
+Benjamin Root
+Bradley Ayers
+Branden Rolston
+Brandon Carl
+Brian Kearns
+Cap Petschulat
+CBWhiz
+Chris Adams
 Chris McDonough
+Christos Kontas
+Christian Hudon
 Christian Stefanescu
 Christopher Nilsson
+Cliff Xuan
 Curt Micol
+Damien Nozay
+Dan Sully
+Daniel Hahler
+Daniel Holth
+David Schoonover
+Denis Costa
+Doug Hellmann
+Doug Napoleone
 Douglas Creager
+Eduard-Cristian Stefan
+Erik M. Bray
+Ethan Jucovy
+Gabriel de Perthuis
 Gunnlaugur Thor Briem
+Graham Dennis
+Greg Haskins
+Jason Penney
+Jason R. Coombs
 Jeff Hammel
+Jeremy Orem
+Jason Penney
+Jason R. Coombs
+John Kleint
+Jonathan Griffin
+Jonathan Hitchcock
 Jorge Vargas
 Josh Bronson
+Kamil Kisiel
+Kyle Gibson
+Konstantin Zemlyak
 Kumar McMillan
 Lars Francke
+Marc Abramowitz
+Mika Laitio
+Mike Hommey
+Miki Tebeka
 Philip Jenvey
+Philippe Ombredanne
+Piotr Dobrogost
+Preston Holmes
+Ralf Schmitt
+Raul Leal
 Ronny Pfannschmidt
+Satrajit Ghosh
+Sergio de Carvalho
+Stefano Rivera
 Tarek Ziadé
+Thomas Aglassinger
 Vinay Sajip
+Vitaly Babiy
+Vladimir Rutsky
+Wang Xuerui
\ No newline at end of file
diff --git a/misc/virtualenv/HACKING b/misc/virtualenv/HACKING
deleted file mode 100644 (file)
index 4eb6da7..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-virtualenv
-==========
-
-See docs/index.txt for user documentation.
-
-Contributor notes
------------------
-
-* virtualenv is designed to work on python 2 and 3 with a single code base. 
-  Use Python 3 print-function syntax, and always use sys.exc_info()[1]
-  inside the `except` block to get at exception objects.
-
-* virtualenv uses git-flow_ to `coordinate development`_.
-
-.. _git-flow: https://github.com/nvie/gitflow
-.. _coordinate development: http://nvie.com/posts/a-successful-git-branching-model/
index 2628d93..ab14500 100644 (file)
@@ -1,6 +1,6 @@
 Copyright (c) 2007 Ian Bicking and Contributors
 Copyright (c) 2009 Ian Bicking, The Open Planning Project
-Copyright (c) 2011 The virtualenv developers
+Copyright (c) 2011-2016 The virtualenv developers
 
 Permission is hereby granted, free of charge, to any person obtaining
 a copy of this software and associated documentation files (the
index cce54a6..49037ad 100644 (file)
@@ -1,9 +1,12 @@
-recursive-include docs *.txt
-recursive-include scripts *
-recursive-include virtualenv_support *.egg *.tar.gz
-recursive-exclude virtualenv_support *.py
-recursive-exclude docs/_templates *.*
+recursive-include docs *
+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
\ No newline at end of file
+include LICENSE.txt
index cd83aa0..11f5c75 100644 (file)
@@ -1,47 +1,30 @@
-Metadata-Version: 1.0
+Metadata-Version: 1.1
 Name: virtualenv
-Version: 1.7
+Version: 15.1.0
 Summary: Virtual Python Environment builder
-Home-page: http://www.virtualenv.org
+Home-page: https://virtualenv.pypa.io/
 Author: Jannis Leidel, Carl Meyer and Brian Rosner
 Author-email: python-virtualenv@groups.google.com
 License: MIT
-Description: 
+Description: Virtualenv
+        ==========
         
-        Status and License
-        ------------------
+        `Mailing list <http://groups.google.com/group/python-virtualenv>`_ |
+        `Issues <https://github.com/pypa/virtualenv/issues>`_ |
+        `Github <https://github.com/pypa/virtualenv>`_ |
+        `PyPI <https://pypi.python.org/pypi/virtualenv/>`_ |
+        User IRC: #pypa
+        Dev IRC: #pypa-dev
         
-        ``virtualenv`` is a successor to `workingenv
-        <http://cheeseshop.python.org/pypi/workingenv.py>`_, and an extension
-        of `virtual-python
-        <http://peak.telecommunity.com/DevCenter/EasyInstall#creating-a-virtual-python>`_.
-        
-        It was written by Ian Bicking, sponsored by the `Open Planning
-        Project <http://openplans.org>`_ and is now maintained by a
-        `group of developers <https://github.com/pypa/virtualenv/raw/master/AUTHORS.txt>`_.
-        It is licensed under an
-        `MIT-style permissive license <https://github.com/pypa/virtualenv/raw/master/LICENSE.txt>`_.
-        
-        You can install it with ``pip install virtualenv``, or the `latest
-        development version <https://github.com/pypa/virtualenv/tarball/develop#egg=virtualenv-dev>`_
-        with ``pip install virtualenv==dev``.
-        
-        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
-        it with ``python virtualenv.py``.
-        
-        .. _virtualenv.py: https://raw.github.com/pypa/virtualenv/master/virtualenv.py
-        
-        
-        What It Does
+        Introduction
         ------------
         
         ``virtualenv`` is a tool to create isolated Python environments.
         
         The basic problem being addressed is one of dependencies and versions,
-        and indirectly permissions.  Imagine you have an application that
+        and indirectly permissions. Imagine you have an application that
         needs version 1 of LibFoo, but another application requires version
-        2.  How can you use both these applications?  If you install
+        2. How can you use both these applications?  If you install
         everything into ``/usr/lib/python2.7/site-packages`` (or whatever your
         platform's standard location is), it's easy to end up in a situation
         where you unintentionally upgrade an application that shouldn't be
@@ -54,853 +37,49 @@ Description:
         Also, what if you can't install packages into the global
         ``site-packages`` directory?  For instance, on a shared host.
         
-        In all these cases, ``virtualenv`` can help you.  It creates an
+        In all these cases, ``virtualenv`` can help you. It creates an
         environment that has its own installation directories, that doesn't
         share libraries with other virtualenv environments (and optionally
         doesn't access the globally installed libraries either).
         
-        The basic usage is::
-        
-            $ python virtualenv.py ENV
-        
-        If you install it you can also just do ``virtualenv ENV``.
-        
-        This creates ``ENV/lib/pythonX.X/site-packages``, where any libraries you
-        install will go.  It also creates ``ENV/bin/python``, which is a Python
-        interpreter that uses this environment.  Anytime you use that interpreter
-        (including when a script has ``#!/path/to/ENV/bin/python`` in it) the libraries
-        in that environment will be used.
-        
-        It also installs either `Setuptools
-        <http://peak.telecommunity.com/DevCenter/setuptools>`_ or `distribute
-        <http://pypi.python.org/pypi/distribute>`_ into the environment. To use
-        Distribute instead of setuptools, just call virtualenv like this::
-        
-            $ python virtualenv.py --distribute ENV
-        
-        You can also set the environment variable VIRTUALENV_USE_DISTRIBUTE.
-        
-        A new virtualenv also includes the `pip <http://pypy.python.org/pypi/pip>`_
-        installer, so you can use ``ENV/bin/pip`` to install additional packages into
-        the environment.
-        
-        Environment variables and configuration files
-        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-        
-        virtualenv can not only be configured by passing command line options such as
-        ``--distribute`` but also by two other means:
-        
-        - Environment variables
-        
-          Each command line option is automatically used to look for environment
-          variables with the name format ``VIRTUALENV_<UPPER_NAME>``. That means
-          the name of the command line options are capitalized and have dashes
-          (``'-'``) replaced with underscores (``'_'``).
-        
-          For example, to automatically install Distribute instead of setuptools
-          you can also set an environment variable::
-        
-              $ export VIRTUALENV_USE_DISTRIBUTE=true
-              $ python virtualenv.py ENV
-        
-          It's the same as passing the option to virtualenv directly::
-        
-              $ python virtualenv.py --distribute ENV
-        
-          This also works for appending command line options, like ``--find-links``.
-          Just leave an empty space between the passsed values, e.g.::
-        
-              $ export VIRTUALENV_EXTRA_SEARCH_DIR="/path/to/dists /path/to/other/dists"
-              $ virtualenv ENV
-        
-          is the same as calling::
-        
-              $ python virtualenv.py --extra-search-dir=/path/to/dists --extra-search-dir=/path/to/other/dists ENV
-        
-        - Config files
-        
-          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``.
-        
-          The names of the settings are derived from the long command line option,
-          e.g. the option ``--distribute`` would look like this::
-        
-              [virtualenv]
-              distribute = true
-        
-          Appending options like ``--extra-search-dir`` can be written on multiple
-          lines::
-        
-              [virtualenv]
-              extra-search-dir =
-                  /path/to/dists
-                  /path/to/other/dists
-        
-        Please have a look at the output of ``virtualenv --help`` for a full list
-        of supported options.
-        
-        Windows Notes
-        ~~~~~~~~~~~~~
-        
-        Some paths within the virtualenv are slightly different on Windows: scripts and
-        executables on Windows go in ``ENV\Scripts\`` instead of ``ENV/bin/`` and
-        libraries go in ``ENV\Lib\`` rather than ``ENV/lib/``.
-        
-        To create a virtualenv under a path with spaces in it on Windows, you'll need
-        the `win32api <http://sourceforge.net/projects/pywin32/>`_ library installed.
-        
-        PyPy Support
-        ~~~~~~~~~~~~
-        
-        Beginning with virtualenv version 1.5 `PyPy <http://pypy.org>`_ is
-        supported. To use PyPy 1.4 or 1.4.1, you need a version of virtualenv >= 1.5.
-        To use PyPy 1.5, you need a version of virtualenv >= 1.6.1.
-        
-        Creating Your Own Bootstrap Scripts
-        -----------------------------------
-        
-        While this creates an environment, it doesn't put anything into the
-        environment.  Developers may find it useful to distribute a script
-        that sets up a particular environment, for example a script that
-        installs a particular web application.
-        
-        To create a script like this, call
-        ``virtualenv.create_bootstrap_script(extra_text)``, and write the
-        result to your new bootstrapping script.  Here's the documentation
-        from the docstring:
-        
-        Creates a bootstrap script, which is like this script but with
-        extend_parser, adjust_options, and after_install hooks.
-        
-        This returns a string that (written to disk of course) can be used
-        as a bootstrap script with your own customizations.  The script
-        will be the standard virtualenv.py script, with your extra text
-        added (your extra text should be Python code).
-        
-        If you include these functions, they will be called:
-        
-        ``extend_parser(optparse_parser)``:
-            You can add or remove options from the parser here.
-        
-        ``adjust_options(options, args)``:
-            You can change options here, or change the args (if you accept
-            different kinds of arguments, be sure you modify ``args`` so it is
-            only ``[DEST_DIR]``).
-        
-        ``after_install(options, home_dir)``:
-        
-            After everything is installed, this function is called.  This
-            is probably the function you are most likely to use.  An
-            example would be::
-        
-                def after_install(options, home_dir):
-                    if sys.platform == 'win32':
-                        bin = 'Scripts'
-                    else:
-                        bin = 'bin'
-                    subprocess.call([join(home_dir, bin, 'easy_install'),
-                                     'MyPackage'])
-                    subprocess.call([join(home_dir, bin, 'my-package-script'),
-                                     'setup', home_dir])
-        
-            This example immediately installs a package, and runs a setup
-            script from that package.
-        
-        Bootstrap Example
-        ~~~~~~~~~~~~~~~~~
-        
-        Here's a more concrete example of how you could use this::
-        
-            import virtualenv, textwrap
-            output = virtualenv.create_bootstrap_script(textwrap.dedent("""
-            import os, subprocess
-            def after_install(options, home_dir):
-                etc = join(home_dir, 'etc')
-                if not os.path.exists(etc):
-                    os.makedirs(etc)
-                subprocess.call([join(home_dir, 'bin', 'easy_install'),
-                                 'BlogApplication'])
-                subprocess.call([join(home_dir, 'bin', 'paster'),
-                                 'make-config', 'BlogApplication',
-                                 join(etc, 'blog.ini')])
-                subprocess.call([join(home_dir, 'bin', 'paster'),
-                                 'setup-app', join(etc, 'blog.ini')])
-            """))
-            f = open('blog-bootstrap.py', 'w').write(output)
-        
-        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, or a ``Scripts/activate.bat`` batch file on Windows.
-        
-        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.bat
-        
-        And use ``deactivate.bat`` to undo the changes.
-        
-        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
-        <http://www.modpython.org/>`_ or `mod_wsgi <http://www.modwsgi.org/>`_
-        environment, there is only one interpreter.
-        
-        Luckily, it's easy.  You must use the custom Python interpreter to
-        *install* libraries.  But to *use* libraries, you just have to be sure
-        the path is correct.  A script is available to correct the path.  You
-        can setup the environment like::
-        
-            activate_this = '/path/to/env/bin/activate_this.py'
-            execfile(activate_this, dict(__file__=activate_this))
-        
-        This will change ``sys.path`` and even change ``sys.prefix``, but also allow
-        you to use an existing interpreter.  Items in your environment will show up
-        first on ``sys.path``, before global items.  However, global items will
-        always be accessible (as if the ``--system-site-packages`` flag had been used
-        in creating the environment, whether it was or not).  Also, this cannot undo
-        the activation of other environments, or modules that have been imported.
-        You shouldn't try to, for instance, activate an environment before a web
-        request; you should activate *one* environment as early as possible, and not
-        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
-        currently work on Windows.
-        
-        Normally environments are tied to a specific path.  That means that
-        you cannot move an environment around or copy it to another computer.
-        You can fix up an environment to make it relocatable with the
-        command::
-        
-            $ virtualenv --relocatable ENV
-        
-        This will make some of the files created by setuptools or distribute
-        use relative paths, and will change all the scripts to use ``activate_this.py``
-        instead of using the location of the Python interpreter to select the
-        environment.
-        
-        **Note:** you must run this after you've installed *any* packages into
-        the environment.  If you make an environment relocatable, then
-        install a new package, you must run ``virtualenv --relocatable``
-        again.
-        
-        Also, this **does not make your packages cross-platform**.  You can
-        move the directory around, but it can only be used on other similar
-        computers.  Some known environmental differences that can cause
-        incompatibilities: a different version of Python, when one platform
-        uses UCS2 for its internal unicode representation and another uses
-        UCS4 (a compile-time option), obvious platform changes like Windows
-        vs. Linux, or Intel vs. ARM, and if you have libraries that bind to C
-        libraries on the system, if those C libraries are located somewhere
-        different (either different versions, or a different filesystem
-        layout).
-        
-        If you use this flag to create an environment, currently, the
-        ``--system-site-packages`` option will be implied.
-        
-        The ``--extra-search-dir`` Option
-        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-        
-        When it creates a new environment, virtualenv installs either
-        setuptools or distribute, and pip.  In normal operation, 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.
-        
-        As an alternative, you can provide your own versions of setuptools,
-        distribute and/or pip on the filesystem, and tell virtualenv to use
-        those distributions instead of downloading them from the Internet.  To
-        use this feature, pass one or more ``--extra-search-dir`` options to
-        virtualenv like this::
-        
-            $ virtualenv --extra-search-dir=/path/to/distributions ENV
-        
-        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.
-        
-        Virtualenv will still download these packages if no satisfactory local
-        distributions are found.
-        
-        If you are really concerned about virtualenv fetching these packages
-        from the Internet and want to ensure that it never will, you can also
-        provide an option ``--never-download`` like so::
-        
-            $ virtualenv --extra-search-dir=/path/to/distributions --never-download ENV
-        
-        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.
-        
-        Compare & Contrast with Alternatives
-        ------------------------------------
-        
-        There are several alternatives that create isolated environments:
-        
-        * ``workingenv`` (which I do not suggest you use anymore) is the
-          predecessor to this library.  It used the main Python interpreter,
-          but relied on setting ``$PYTHONPATH`` to activate the environment.
-          This causes problems when running Python scripts that aren't part of
-          the environment (e.g., a globally installed ``hg`` or ``bzr``).  It
-          also conflicted a lot with Setuptools.
-        
-        * `virtual-python
-          <http://peak.telecommunity.com/DevCenter/EasyInstall#creating-a-virtual-python>`_
-          is also a predecessor to this library.  It uses only symlinks, so it
-          couldn't work on Windows.  It also symlinks over the *entire*
-          standard library and global ``site-packages``.  As a result, it
-          won't see new additions to the global ``site-packages``.
-        
-          This script only symlinks a small portion of the standard library
-          into the environment, and so on Windows it is feasible to simply
-          copy these files over.  Also, it creates a new/empty
-          ``site-packages`` and also adds the global ``site-packages`` to the
-          path, so updates are tracked separately.  This script also installs
-          Setuptools automatically, saving a step and avoiding the need for
-          network access.
-        
-        * `zc.buildout <http://pypi.python.org/pypi/zc.buildout>`_ doesn't
-          create an isolated Python environment in the same style, but
-          achieves similar results through a declarative config file that sets
-          up scripts with very particular packages.  As a declarative system,
-          it is somewhat easier to repeat and manage, but more difficult to
-          experiment with.  ``zc.buildout`` includes the ability to setup
-          non-Python systems (e.g., a database server or an Apache instance).
-        
-        I *strongly* recommend anyone doing application development or
-        deployment use one of these tools.
-        
-        Contributing
-        ------------
-        
-        Refer to the `contributing to pip`_ documentation - it applies equally to
-        virtualenv.
-        
-        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.
-        
-        .. _contributing to pip: http://www.pip-installer.org/en/latest/how-to-contribute.html
-        
-        Running the tests
-        ~~~~~~~~~~~~~~~~~
-        
-        Virtualenv's test suite is small and not yet at all comprehensive, but we aim
-        to grow it.
-        
-        The easy way to run tests (handles test dependencies automatically)::
-        
-            $ python setup.py test
-        
-        If you want to run only a selection of the tests, you'll need to run them
-        directly with nose instead. Create a virtualenv, and install required
-        packages::
-        
-            $ pip install nose mock
-        
-        Run nosetests::
-        
-            $ nosetests
-        
-        Or select just a single test file to run::
-        
-            $ nosetests tests.test_virtualenv
-        
-        
-        Other Documentation and Links
-        -----------------------------
-        
-        * James Gardner has written a tutorial on using `virtualenv with
-          Pylons
-          <http://wiki.pylonshq.com/display/pylonscookbook/Using+a+Virtualenv+Sandbox>`_.
-        
-        * `Blog announcement
-          <http://blog.ianbicking.org/2007/10/10/workingenv-is-dead-long-live-virtualenv/>`_.
-        
-        * Doug Hellmann wrote a description of his `command-line work flow
-          using virtualenv (virtualenvwrapper)
-          <http://www.doughellmann.com/articles/CompletelyDifferent-2008-05-virtualenvwrapper/index.html>`_
-          including some handy scripts to make working with multiple
-          environments easier.  He also wrote `an example of using virtualenv
-          to try IPython
-          <http://www.doughellmann.com/articles/CompletelyDifferent-2008-02-ipython-and-virtualenv/index.html>`_.
-        
-        * Chris Perkins created a `showmedo video including virtualenv
-          <http://showmedo.com/videos/video?name=2910000&fromSeriesID=291>`_.
-        
-        * `Using virtualenv with mod_wsgi
-          <http://code.google.com/p/modwsgi/wiki/VirtualEnvironments>`_.
-        
-        * `virtualenv commands
-          <http://thisismedium.com/tech/extending-virtualenv/>`_ for some more
-          workflow-related tools around virtualenv.
-        
-        Changes & News
-        --------------
-        
-        1.7 (2011-11-30)
-        ~~~~~~~~~~~~~~~~
-        
-        * Updated embedded Distribute release to 0.6.24. Thanks Alex Grönholm.
-        
-        * 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 intepreter (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_USE_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 <./index.html#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.
+        .. comment: 
         
-        0.9
-        ~~~
+        Release History
+        ===============
         
-        * 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.
+        15.1.0 (2016-11-15)
+        -------------------
         
-        0.8.4
-        ~~~~~
+        * Support Python 3.6.
         
-        * Windows installs would sometimes give errors about ``sys.prefix`` that
-          were inaccurate.
-        * Slightly prettier output.
+        * Upgrade setuptools to 28.0.0.
         
-        0.8.3
-        ~~~~~
+        * Upgrade pip to 9.0.1.
         
-        * Added support for Windows.
+        * Don't install pre-release versions of pip, setuptools, or wheel from PyPI.
         
-        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.
+        15.0.3 (2016-08-05)
+        -------------------
         
-        0.8.1
-        ~~~~~
+        * Test for given python path actually being an executable *file*, #939
         
-        Fixed packaging of the library.
+        * Only search for copy actual existing Tcl/Tk directories (PR #937)
         
-        0.8
-        ~~~
+        * Generically search for correct Tcl/Tk version (PR #926, PR #933)
         
-        Initial release.  Everything is changed and new!
+        * Upgrade setuptools to 22.0.5
         
+        `Full Changelog <https://virtualenv.pypa.io/en/latest/changes.html>`_.
 Keywords: setuptools deployment installation distutils
 Platform: UNKNOWN
-Classifier: Development Status :: 4 - Beta
+Classifier: Development Status :: 5 - Production/Stable
 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
 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
+Classifier: Programming Language :: Python :: 3.5
diff --git a/misc/virtualenv/README.rst b/misc/virtualenv/README.rst
new file mode 100644 (file)
index 0000000..0d5984d
--- /dev/null
@@ -0,0 +1,31 @@
+virtualenv
+==========
+
+A tool for creating isolated 'virtual' python environments.
+
+.. image:: https://img.shields.io/pypi/v/virtualenv.svg
+        :target: https://pypi.python.org/pypi/virtualenv
+
+.. image:: https://img.shields.io/travis/pypa/virtualenv/develop.svg
+   :target: http://travis-ci.org/pypa/virtualenv
+
+* `Installation <https://virtualenv.pypa.io/en/latest/installation.html>`_
+* `Documentation <https://virtualenv.pypa.io/>`_
+* `Changelog <https://virtualenv.pypa.io/en/latest/changes.html>`_
+* `Issues <https://github.com/pypa/virtualenv/issues>`_
+* `PyPI <https://pypi.python.org/pypi/virtualenv/>`_
+* `Github <https://github.com/pypa/virtualenv>`_
+* `User mailing list <http://groups.google.com/group/python-virtualenv>`_
+* `Dev mailing list <http://groups.google.com/group/pypa-dev>`_
+* User IRC: #pypa on Freenode.
+* Dev IRC: #pypa-dev on Freenode.
+
+
+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/
index a6163e3..d0bc93e 100755 (executable)
@@ -2,69 +2,79 @@
 """
 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 as _crc32
+
+
+def crc32(data):
+    """Python version idempotent"""
+    return _crc32(data) & 0xffffffff
+
 
 here = os.path.dirname(__file__)
 script = os.path.join(here, '..', 'virtualenv.py')
 
+gzip = codecs.lookup('zlib')
+b64 = codecs.lookup('base64')
+
 file_regex = re.compile(
-    r'##file (.*?)\n([a-zA-Z][a-zA-Z0-9_]+)\s*=\s*convert\("""(.*?)"""\)',
+    br'##file (.*?)\n([a-zA-Z][a-zA-Z0-9_]+)\s*=\s*convert\("""\n(.*?)"""\)',
     re.S)
-file_template = '##file %(filename)s\n%(varname)s = convert("""\n%(data)s""")'
+file_template = b'##file %(filename)s\n%(varname)s = convert("""\n%(data)s""")'
+
 
-def rebuild():
-    f = open(script, 'rb')
-    content = f.read()
-    f.close()
+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)
-        f = open(os.path.join(here, '..', 'virtualenv_support', filename), '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: %08x)' % 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: %08x -> %08x)' %
+              (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)
diff --git a/misc/virtualenv/bin/refresh-support-files.py b/misc/virtualenv/bin/refresh-support-files.py
deleted file mode 100755 (executable)
index 866b9d5..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-#!/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_files = os.path.join(here, '..', 'virtualenv_support')
-
-files = [
-    ('http://peak.telecommunity.com/dist/ez_setup.py', 'ez_setup.py'),
-    ('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/2.4/s/setuptools/setuptools-0.6c11-py2.4.egg', 'setuptools-0.6c11-py2.4.egg'),
-    ('http://python-distribute.org/distribute_setup.py', 'distribute_setup.py'),
-    ('http://pypi.python.org/packages/source/d/distribute/distribute-0.6.24.tar.gz', 'distribute-0.6.24.tar.gz'),
-    ('http://pypi.python.org/packages/source/p/pip/pip-1.0.2.tar.gz', 'pip-1.0.2.tar.gz'),
-]
-
-def main():
-    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(support_files, 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()
-
-if __name__ == '__main__':
-    main()
-
-
diff --git a/misc/virtualenv/docs/_theme/nature/static/nature.css_t b/misc/virtualenv/docs/_theme/nature/static/nature.css_t
deleted file mode 100644 (file)
index 03b0379..0000000
+++ /dev/null
@@ -1,229 +0,0 @@
-/**
- * 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;
-}
diff --git a/misc/virtualenv/docs/_theme/nature/static/pygments.css b/misc/virtualenv/docs/_theme/nature/static/pygments.css
deleted file mode 100644 (file)
index 652b761..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-.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 */
\ No newline at end of file
diff --git a/misc/virtualenv/docs/_theme/nature/theme.conf b/misc/virtualenv/docs/_theme/nature/theme.conf
deleted file mode 100644 (file)
index 1cc4004..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-[theme]
-inherit = basic
-stylesheet = nature.css
-pygments_style = tango
diff --git a/misc/virtualenv/docs/changes.rst b/misc/virtualenv/docs/changes.rst
new file mode 100644 (file)
index 0000000..63833cc
--- /dev/null
@@ -0,0 +1,1019 @@
+Release History
+===============
+
+15.1.0 (2016-11-15)
+-------------------
+
+* Support Python 3.6.
+
+* Upgrade setuptools to 28.0.0.
+
+* Upgrade pip to 9.0.1.
+
+* Don't install pre-release versions of pip, setuptools, or wheel from PyPI.
+
+
+15.0.3 (2016-08-05)
+-------------------
+
+* Test for given python path actually being an executable *file*, :issue:`939`
+
+* Only search for copy actual existing Tcl/Tk directories (:pull:`937`)
+
+* Generically search for correct Tcl/Tk version (:pull:`926`, :pull:`933`)
+
+* Upgrade setuptools to 22.0.5
+
+15.0.2 (2016-05-28)
+-------------------
+
+* Copy Tcl/Tk libs on Windows to allow them to run,
+  fixes :issue:`93` (:pull:`888`)
+
+* Upgrade setuptools to 21.2.1.
+
+* Upgrade pip to 8.1.2.
+
+
+15.0.1 (2016-03-17)
+-------------------
+
+* Print error message when DEST_DIR exists and is a file
+
+* Upgrade setuptools to 20.3
+
+* Upgrade pip to 8.1.1.
+
+
+15.0.0 (2016-03-05)
+-------------------
+
+* Remove the `virtualenv-N.N` script from the package; this can no longer be
+  correctly created from a wheel installation.
+  Resolves :issue:`851`, :issue:`692`
+
+* Remove accidental runtime dependency on pip by extracting certificate in the
+  subprocess.
+
+* Upgrade setuptools 20.2.2.
+
+* Upgrade pip to 8.1.0.
+
+
+14.0.6 (2016-02-07)
+-------------------
+
+* Upgrade setuptools to 20.0
+
+* Upgrade wheel to 0.29.0
+
+* Fix an error where virtualenv didn't pass in a working ssl certificate for
+  pip, causing "weird" errors related to ssl.
+
+
+14.0.5 (2016-02-01)
+-------------------
+
+* Homogenize drive letter casing for both prefixes and filenames. :issue:`858`
+
+
+14.0.4 (2016-01-31)
+-------------------
+
+* Upgrade setuptools to 19.6.2
+
+* Revert ac4ea65; only correct drive letter case.
+  Fixes :issue:`856`, :issue:`815`
+
+
+14.0.3 (2016-01-28)
+-------------------
+
+* Upgrade setuptools to 19.6.1
+
+
+14.0.2 (2016-01-28)
+-------------------
+
+* Upgrade setuptools to 19.6
+
+* Supress any errors from `unset` on different shells (:pull:`843`)
+
+* Normalize letter case for prefix path checking. Fixes :issue:`837`
+
+
+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.py's path from sys.path 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-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-12-23)
+-------------------
+
+* Fix an issue where Debian based Pythons would fail when using -p with the
+  host Python.
+
+* 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.
+* 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
+
+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.
+* 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!
index 39203f1..9332aa1 100644 (file)
 # All configuration values have a default value; values that are commented out
 # serve to show the default value.
 
+import os
 import sys
 
+on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
+
 # If your extensions are in another directory, add it here.
-#sys.path.append('some/directory')
+sys.path.insert(0, os.path.abspath(os.pardir))
 
 # 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']
+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.
-source_suffix = '.txt'
+source_suffix = '.rst'
 
 # The master toctree document.
 master_doc = 'index'
 
 # General substitutions.
 project = 'virtualenv'
-copyright = '2007-2011, Ian Bicking, The Open Planning Project, The virtualenv developers'
+copyright = '2007-2014, Ian Bicking, The Open Planning Project, PyPA'
 
 # The default replacements for |version| and |release|, also used in various
 # other places throughout the built documents.
-#
-# The short X.Y version.
-
-release = "1.7"
-version = ".".join(release.split(".")[:2])
+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:
@@ -68,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
 # -----------------------
@@ -77,13 +87,20 @@ pygments_style = 'sphinx'
 # given in html_static_path.
 #html_style = 'default.css'
 
-html_theme = 'nature'
-html_theme_path = ['_theme']
+html_theme = 'default'
+if not on_rtd:
+    try:
+        import sphinx_rtd_theme
+        html_theme = 'sphinx_rtd_theme'
+        html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
+    except ImportError:
+        pass
+
 
 # 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']
+# html_static_path = ['_static']
 
 # If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
 # using the given strftime format.
diff --git a/misc/virtualenv/docs/development.rst b/misc/virtualenv/docs/development.rst
new file mode 100644 (file)
index 0000000..aba2785
--- /dev/null
@@ -0,0 +1,61 @@
+Development
+===========
+
+Contributing
+------------
+
+Refer to the `pip development`_ documentation - it applies equally to
+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.
+
+.. _pip development: http://www.pip-installer.org/en/latest/development.html
+.. _virtualenv repo: https://github.com/pypa/virtualenv/
+
+Running the tests
+-----------------
+
+Virtualenv's test suite is small and not yet at all comprehensive, but we aim
+to grow it.
+
+The easy way to run tests (handles test dependencies automatically)::
+
+    $ python setup.py test
+
+If you want to run only a selection of the tests, you'll need to run them
+directly with pytest instead. Create a virtualenv, and install required
+packages::
+
+    $ pip install pytest mock
+
+Run pytest::
+
+    $ pytest
+
+Or select just a single test file to run::
+
+    $ pytest tests/test_virtualenv
+
+Status and License
+------------------
+
+``virtualenv`` is a successor to `workingenv
+<http://cheeseshop.python.org/pypi/workingenv.py>`_, and an extension
+of `virtual-python
+<http://peak.telecommunity.com/DevCenter/EasyInstall#creating-a-virtual-python>`_.
+
+It was written by Ian Bicking, sponsored by the `Open Planning
+Project <http://openplans.org>`_ and is now maintained by a
+`group of developers <https://github.com/pypa/virtualenv/raw/master/AUTHORS.txt>`_.
+It is licensed under an
+`MIT-style permissive license <https://github.com/pypa/virtualenv/raw/master/LICENSE.txt>`_.
diff --git a/misc/virtualenv/docs/index.rst b/misc/virtualenv/docs/index.rst
new file mode 100644 (file)
index 0000000..e745a87
--- /dev/null
@@ -0,0 +1,137 @@
+Virtualenv
+==========
+
+`Mailing list <http://groups.google.com/group/python-virtualenv>`_ |
+`Issues <https://github.com/pypa/virtualenv/issues>`_ |
+`Github <https://github.com/pypa/virtualenv>`_ |
+`PyPI <https://pypi.python.org/pypi/virtualenv/>`_ |
+User IRC: #pypa
+Dev IRC: #pypa-dev
+
+Introduction
+------------
+
+``virtualenv`` is a tool to create isolated Python environments.
+
+The basic problem being addressed is one of dependencies and versions,
+and indirectly permissions. Imagine you have an application that
+needs version 1 of LibFoo, but another application requires version
+2. How can you use both these applications?  If you install
+everything into ``/usr/lib/python2.7/site-packages`` (or whatever your
+platform's standard location is), it's easy to end up in a situation
+where you unintentionally upgrade an application that shouldn't be
+upgraded.
+
+Or more generally, what if you want to install an application *and
+leave it be*?  If an application works, any change in its libraries or
+the versions of those libraries can break the application.
+
+Also, what if you can't install packages into the global
+``site-packages`` directory?  For instance, on a shared host.
+
+In all these cases, ``virtualenv`` can help you. It creates an
+environment that has its own installation directories, that doesn't
+share libraries with other virtualenv environments (and optionally
+doesn't access the globally installed libraries either).
+
+.. comment: split here
+
+.. toctree::
+   :maxdepth: 2
+
+   installation
+   userguide
+   reference
+   development
+   changes
+
+.. 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.
+
+Other Documentation and Links
+-----------------------------
+
+* `Blog announcement of virtualenv`__.
+
+  .. __: http://blog.ianbicking.org/2007/10/10/workingenv-is-dead-long-live-virtualenv/
+
+* James Gardner has written a tutorial on using `virtualenv with
+  Pylons
+  <http://wiki.pylonshq.com/display/pylonscookbook/Using+a+Virtualenv+Sandbox>`_.
+
+* Chris Perkins created a `showmedo video including virtualenv
+  <http://showmedo.com/videos/video?name=2910000&fromSeriesID=291>`_.
+
+* Doug Hellmann's `virtualenvwrapper`_ is a useful set of scripts to make
+  your workflow with many virtualenvs even easier. `His initial blog post on it`__.
+  He also wrote `an example of using virtualenv to try IPython`__.
+
+  .. _virtualenvwrapper: https://pypi.python.org/pypi/virtualenvwrapper/
+  .. __: 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.
+
+  .. _Pew: https://pypi.python.org/pypi/pew/
+
+* `Using virtualenv with mod_wsgi
+  <http://code.google.com/p/modwsgi/wiki/VirtualEnvironments>`_.
+
+* `virtualenv commands
+  <https://github.com/thisismedium/virtualenv-commands>`_ for some more
+  workflow-related tools around virtualenv.
+
+* PyCon US 2011 talk: `Reverse-engineering Ian Bicking's brain: inside pip and virtualenv
+  <http://pyvideo.org/video/568/reverse-engineering-ian-bicking--39-s-brain--insi>`_.
+  By the end of the talk, you'll have a good idea exactly how pip
+  and virtualenv do their magic, and where to go looking in the source
+  for particular behaviors or bug fixes.
+
+Compare & Contrast with Alternatives
+------------------------------------
+
+There are several alternatives that create isolated environments:
+
+* ``workingenv`` (which I do not suggest you use anymore) is the
+  predecessor to this library. It used the main Python interpreter,
+  but relied on setting ``$PYTHONPATH`` to activate the environment.
+  This causes problems when running Python scripts that aren't part of
+  the environment (e.g., a globally installed ``hg`` or ``bzr``). It
+  also conflicted a lot with Setuptools.
+
+* `virtual-python
+  <http://peak.telecommunity.com/DevCenter/EasyInstall#creating-a-virtual-python>`_
+  is also a predecessor to this library. It uses only symlinks, so it
+  couldn't work on Windows. It also symlinks over the *entire*
+  standard library and global ``site-packages``. As a result, it
+  won't see new additions to the global ``site-packages``.
+
+  This script only symlinks a small portion of the standard library
+  into the environment, and so on Windows it is feasible to simply
+  copy these files over. Also, it creates a new/empty
+  ``site-packages`` and also adds the global ``site-packages`` to the
+  path, so updates are tracked separately. This script also installs
+  Setuptools automatically, saving a step and avoiding the need for
+  network access.
+
+* `zc.buildout <http://pypi.python.org/pypi/zc.buildout>`_ doesn't
+  create an isolated Python environment in the same style, but
+  achieves similar results through a declarative config file that sets
+  up scripts with very particular packages. As a declarative system,
+  it is somewhat easier to repeat and manage, but more difficult to
+  experiment with. ``zc.buildout`` includes the ability to setup
+  non-Python systems (e.g., a database server or an Apache instance).
+
+I *strongly* recommend anyone doing application development or
+deployment use one of these tools.
diff --git a/misc/virtualenv/docs/index.txt b/misc/virtualenv/docs/index.txt
deleted file mode 100644 (file)
index 9f81adf..0000000
+++ /dev/null
@@ -1,487 +0,0 @@
-virtualenv
-==========
-
-* `Discussion list <http://groups.google.com/group/python-virtualenv/>`_
-* `Bugs <https://github.com/pypa/virtualenv/issues/>`_
-
-.. contents::
-
-.. toctree::
-   :maxdepth: 1
-
-   news
-
-.. comment: split here
-
-Status and License
-------------------
-
-``virtualenv`` is a successor to `workingenv
-<http://cheeseshop.python.org/pypi/workingenv.py>`_, and an extension
-of `virtual-python
-<http://peak.telecommunity.com/DevCenter/EasyInstall#creating-a-virtual-python>`_.
-
-It was written by Ian Bicking, sponsored by the `Open Planning
-Project <http://openplans.org>`_ and is now maintained by a
-`group of developers <https://github.com/pypa/virtualenv/raw/master/AUTHORS.txt>`_.
-It is licensed under an
-`MIT-style permissive license <https://github.com/pypa/virtualenv/raw/master/LICENSE.txt>`_.
-
-You can install it with ``pip install virtualenv``, or the `latest
-development version <https://github.com/pypa/virtualenv/tarball/develop#egg=virtualenv-dev>`_
-with ``pip install virtualenv==dev``.
-
-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
-it with ``python virtualenv.py``.
-
-.. _virtualenv.py: https://raw.github.com/pypa/virtualenv/master/virtualenv.py
-
-
-What It Does
-------------
-
-``virtualenv`` is a tool to create isolated Python environments.
-
-The basic problem being addressed is one of dependencies and versions,
-and indirectly permissions.  Imagine you have an application that
-needs version 1 of LibFoo, but another application requires version
-2.  How can you use both these applications?  If you install
-everything into ``/usr/lib/python2.7/site-packages`` (or whatever your
-platform's standard location is), it's easy to end up in a situation
-where you unintentionally upgrade an application that shouldn't be
-upgraded.
-
-Or more generally, what if you want to install an application *and
-leave it be*?  If an application works, any change in its libraries or
-the versions of those libraries can break the application.
-
-Also, what if you can't install packages into the global
-``site-packages`` directory?  For instance, on a shared host.
-
-In all these cases, ``virtualenv`` can help you.  It creates an
-environment that has its own installation directories, that doesn't
-share libraries with other virtualenv environments (and optionally
-doesn't access the globally installed libraries either).
-
-The basic usage is::
-
-    $ python virtualenv.py ENV
-
-If you install it you can also just do ``virtualenv ENV``.
-
-This creates ``ENV/lib/pythonX.X/site-packages``, where any libraries you
-install will go.  It also creates ``ENV/bin/python``, which is a Python
-interpreter that uses this environment.  Anytime you use that interpreter
-(including when a script has ``#!/path/to/ENV/bin/python`` in it) the libraries
-in that environment will be used.
-
-It also installs either `Setuptools
-<http://peak.telecommunity.com/DevCenter/setuptools>`_ or `distribute
-<http://pypi.python.org/pypi/distribute>`_ into the environment. To use
-Distribute instead of setuptools, just call virtualenv like this::
-
-    $ python virtualenv.py --distribute ENV
-
-You can also set the environment variable VIRTUALENV_USE_DISTRIBUTE.
-
-A new virtualenv also includes the `pip <http://pypy.python.org/pypi/pip>`_
-installer, so you can use ``ENV/bin/pip`` to install additional packages into
-the environment.
-
-Environment variables and configuration files
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-virtualenv can not only be configured by passing command line options such as
-``--distribute`` but also by two other means:
-
-- Environment variables
-
-  Each command line option is automatically used to look for environment
-  variables with the name format ``VIRTUALENV_<UPPER_NAME>``. That means
-  the name of the command line options are capitalized and have dashes
-  (``'-'``) replaced with underscores (``'_'``).
-
-  For example, to automatically install Distribute instead of setuptools
-  you can also set an environment variable::
-
-      $ export VIRTUALENV_USE_DISTRIBUTE=true
-      $ python virtualenv.py ENV
-
-  It's the same as passing the option to virtualenv directly::
-
-      $ python virtualenv.py --distribute ENV
-
-  This also works for appending command line options, like ``--find-links``.
-  Just leave an empty space between the passsed values, e.g.::
-
-      $ export VIRTUALENV_EXTRA_SEARCH_DIR="/path/to/dists /path/to/other/dists"
-      $ virtualenv ENV
-
-  is the same as calling::
-
-      $ python virtualenv.py --extra-search-dir=/path/to/dists --extra-search-dir=/path/to/other/dists ENV
-
-- Config files
-
-  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``.
-
-  The names of the settings are derived from the long command line option,
-  e.g. the option ``--distribute`` would look like this::
-
-      [virtualenv]
-      distribute = true
-
-  Appending options like ``--extra-search-dir`` can be written on multiple
-  lines::
-
-      [virtualenv]
-      extra-search-dir =
-          /path/to/dists
-          /path/to/other/dists
-
-Please have a look at the output of ``virtualenv --help`` for a full list
-of supported options.
-
-Windows Notes
-~~~~~~~~~~~~~
-
-Some paths within the virtualenv are slightly different on Windows: scripts and
-executables on Windows go in ``ENV\Scripts\`` instead of ``ENV/bin/`` and
-libraries go in ``ENV\Lib\`` rather than ``ENV/lib/``.
-
-To create a virtualenv under a path with spaces in it on Windows, you'll need
-the `win32api <http://sourceforge.net/projects/pywin32/>`_ library installed.
-
-PyPy Support
-~~~~~~~~~~~~
-
-Beginning with virtualenv version 1.5 `PyPy <http://pypy.org>`_ is
-supported. To use PyPy 1.4 or 1.4.1, you need a version of virtualenv >= 1.5.
-To use PyPy 1.5, you need a version of virtualenv >= 1.6.1.
-
-Creating Your Own Bootstrap Scripts
------------------------------------
-
-While this creates an environment, it doesn't put anything into the
-environment.  Developers may find it useful to distribute a script
-that sets up a particular environment, for example a script that
-installs a particular web application.
-
-To create a script like this, call
-``virtualenv.create_bootstrap_script(extra_text)``, and write the
-result to your new bootstrapping script.  Here's the documentation
-from the docstring:
-
-Creates a bootstrap script, which is like this script but with
-extend_parser, adjust_options, and after_install hooks.
-
-This returns a string that (written to disk of course) can be used
-as a bootstrap script with your own customizations.  The script
-will be the standard virtualenv.py script, with your extra text
-added (your extra text should be Python code).
-
-If you include these functions, they will be called:
-
-``extend_parser(optparse_parser)``:
-    You can add or remove options from the parser here.
-
-``adjust_options(options, args)``:
-    You can change options here, or change the args (if you accept
-    different kinds of arguments, be sure you modify ``args`` so it is
-    only ``[DEST_DIR]``).
-
-``after_install(options, home_dir)``:
-
-    After everything is installed, this function is called.  This
-    is probably the function you are most likely to use.  An
-    example would be::
-
-        def after_install(options, home_dir):
-            if sys.platform == 'win32':
-                bin = 'Scripts'
-            else:
-                bin = 'bin'
-            subprocess.call([join(home_dir, bin, 'easy_install'),
-                             'MyPackage'])
-            subprocess.call([join(home_dir, bin, 'my-package-script'),
-                             'setup', home_dir])
-
-    This example immediately installs a package, and runs a setup
-    script from that package.
-
-Bootstrap Example
-~~~~~~~~~~~~~~~~~
-
-Here's a more concrete example of how you could use this::
-
-    import virtualenv, textwrap
-    output = virtualenv.create_bootstrap_script(textwrap.dedent("""
-    import os, subprocess
-    def after_install(options, home_dir):
-        etc = join(home_dir, 'etc')
-        if not os.path.exists(etc):
-            os.makedirs(etc)
-        subprocess.call([join(home_dir, 'bin', 'easy_install'),
-                         'BlogApplication'])
-        subprocess.call([join(home_dir, 'bin', 'paster'),
-                         'make-config', 'BlogApplication',
-                         join(etc, 'blog.ini')])
-        subprocess.call([join(home_dir, 'bin', 'paster'),
-                         'setup-app', join(etc, 'blog.ini')])
-    """))
-    f = open('blog-bootstrap.py', 'w').write(output)
-
-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, or a ``Scripts/activate.bat`` batch file on Windows.
-
-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.bat
-
-And use ``deactivate.bat`` to undo the changes.
-
-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
-<http://www.modpython.org/>`_ or `mod_wsgi <http://www.modwsgi.org/>`_
-environment, there is only one interpreter.
-
-Luckily, it's easy.  You must use the custom Python interpreter to
-*install* libraries.  But to *use* libraries, you just have to be sure
-the path is correct.  A script is available to correct the path.  You
-can setup the environment like::
-
-    activate_this = '/path/to/env/bin/activate_this.py'
-    execfile(activate_this, dict(__file__=activate_this))
-
-This will change ``sys.path`` and even change ``sys.prefix``, but also allow
-you to use an existing interpreter.  Items in your environment will show up
-first on ``sys.path``, before global items.  However, global items will
-always be accessible (as if the ``--system-site-packages`` flag had been used
-in creating the environment, whether it was or not).  Also, this cannot undo
-the activation of other environments, or modules that have been imported.
-You shouldn't try to, for instance, activate an environment before a web
-request; you should activate *one* environment as early as possible, and not
-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
-currently work on Windows.
-
-Normally environments are tied to a specific path.  That means that
-you cannot move an environment around or copy it to another computer.
-You can fix up an environment to make it relocatable with the
-command::
-
-    $ virtualenv --relocatable ENV
-
-This will make some of the files created by setuptools or distribute
-use relative paths, and will change all the scripts to use ``activate_this.py``
-instead of using the location of the Python interpreter to select the
-environment.
-
-**Note:** you must run this after you've installed *any* packages into
-the environment.  If you make an environment relocatable, then
-install a new package, you must run ``virtualenv --relocatable``
-again.
-
-Also, this **does not make your packages cross-platform**.  You can
-move the directory around, but it can only be used on other similar
-computers.  Some known environmental differences that can cause
-incompatibilities: a different version of Python, when one platform
-uses UCS2 for its internal unicode representation and another uses
-UCS4 (a compile-time option), obvious platform changes like Windows
-vs. Linux, or Intel vs. ARM, and if you have libraries that bind to C
-libraries on the system, if those C libraries are located somewhere
-different (either different versions, or a different filesystem
-layout).
-
-If you use this flag to create an environment, currently, the
-``--system-site-packages`` option will be implied.
-
-The ``--extra-search-dir`` Option
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-When it creates a new environment, virtualenv installs either
-setuptools or distribute, and pip.  In normal operation, 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.
-
-As an alternative, you can provide your own versions of setuptools,
-distribute and/or pip on the filesystem, and tell virtualenv to use
-those distributions instead of downloading them from the Internet.  To
-use this feature, pass one or more ``--extra-search-dir`` options to
-virtualenv like this::
-
-    $ virtualenv --extra-search-dir=/path/to/distributions ENV
-
-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.
-
-Virtualenv will still download these packages if no satisfactory local
-distributions are found.
-
-If you are really concerned about virtualenv fetching these packages
-from the Internet and want to ensure that it never will, you can also
-provide an option ``--never-download`` like so::
-
-    $ virtualenv --extra-search-dir=/path/to/distributions --never-download ENV
-
-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.
-
-Compare & Contrast with Alternatives
-------------------------------------
-
-There are several alternatives that create isolated environments:
-
-* ``workingenv`` (which I do not suggest you use anymore) is the
-  predecessor to this library.  It used the main Python interpreter,
-  but relied on setting ``$PYTHONPATH`` to activate the environment.
-  This causes problems when running Python scripts that aren't part of
-  the environment (e.g., a globally installed ``hg`` or ``bzr``).  It
-  also conflicted a lot with Setuptools.
-
-* `virtual-python
-  <http://peak.telecommunity.com/DevCenter/EasyInstall#creating-a-virtual-python>`_
-  is also a predecessor to this library.  It uses only symlinks, so it
-  couldn't work on Windows.  It also symlinks over the *entire*
-  standard library and global ``site-packages``.  As a result, it
-  won't see new additions to the global ``site-packages``.
-
-  This script only symlinks a small portion of the standard library
-  into the environment, and so on Windows it is feasible to simply
-  copy these files over.  Also, it creates a new/empty
-  ``site-packages`` and also adds the global ``site-packages`` to the
-  path, so updates are tracked separately.  This script also installs
-  Setuptools automatically, saving a step and avoiding the need for
-  network access.
-
-* `zc.buildout <http://pypi.python.org/pypi/zc.buildout>`_ doesn't
-  create an isolated Python environment in the same style, but
-  achieves similar results through a declarative config file that sets
-  up scripts with very particular packages.  As a declarative system,
-  it is somewhat easier to repeat and manage, but more difficult to
-  experiment with.  ``zc.buildout`` includes the ability to setup
-  non-Python systems (e.g., a database server or an Apache instance).
-
-I *strongly* recommend anyone doing application development or
-deployment use one of these tools.
-
-Contributing
-------------
-
-Refer to the `contributing to pip`_ documentation - it applies equally to
-virtualenv.
-
-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.
-
-.. _contributing to pip: http://www.pip-installer.org/en/latest/how-to-contribute.html
-
-Running the tests
-~~~~~~~~~~~~~~~~~
-
-Virtualenv's test suite is small and not yet at all comprehensive, but we aim
-to grow it.
-
-The easy way to run tests (handles test dependencies automatically)::
-
-    $ python setup.py test
-
-If you want to run only a selection of the tests, you'll need to run them
-directly with nose instead. Create a virtualenv, and install required
-packages::
-
-    $ pip install nose mock
-
-Run nosetests::
-
-    $ nosetests
-
-Or select just a single test file to run::
-
-    $ nosetests tests.test_virtualenv
-
-
-Other Documentation and Links
------------------------------
-
-* James Gardner has written a tutorial on using `virtualenv with
-  Pylons
-  <http://wiki.pylonshq.com/display/pylonscookbook/Using+a+Virtualenv+Sandbox>`_.
-
-* `Blog announcement
-  <http://blog.ianbicking.org/2007/10/10/workingenv-is-dead-long-live-virtualenv/>`_.
-
-* Doug Hellmann wrote a description of his `command-line work flow
-  using virtualenv (virtualenvwrapper)
-  <http://www.doughellmann.com/articles/CompletelyDifferent-2008-05-virtualenvwrapper/index.html>`_
-  including some handy scripts to make working with multiple
-  environments easier.  He also wrote `an example of using virtualenv
-  to try IPython
-  <http://www.doughellmann.com/articles/CompletelyDifferent-2008-02-ipython-and-virtualenv/index.html>`_.
-
-* Chris Perkins created a `showmedo video including virtualenv
-  <http://showmedo.com/videos/video?name=2910000&fromSeriesID=291>`_.
-
-* `Using virtualenv with mod_wsgi
-  <http://code.google.com/p/modwsgi/wiki/VirtualEnvironments>`_.
-
-* `virtualenv commands
-  <http://thisismedium.com/tech/extending-virtualenv/>`_ for some more
-  workflow-related tools around virtualenv.
diff --git a/misc/virtualenv/docs/installation.rst b/misc/virtualenv/docs/installation.rst
new file mode 100644 (file)
index 0000000..3006d76
--- /dev/null
@@ -0,0 +1,58 @@
+Installation
+============
+
+.. warning::
+
+    We advise installing virtualenv-1.9 or greater. Prior to version 1.9, the
+    pip included in virtualenv did not download from PyPI over SSL.
+
+.. warning::
+
+    When using pip to install virtualenv, we advise using pip 1.3 or greater.
+    Prior to version 1.3, pip did not download from PyPI over SSL.
+
+.. warning::
+
+    We advise against using easy_install to install virtualenv when using
+    setuptools < 0.9.7, because easy_install didn't download from PyPI over SSL
+    and was broken in some subtle ways.
+
+To install globally with `pip` (if you have pip 1.3 or greater installed globally):
+
+::
+
+ $ [sudo] pip install virtualenv
+
+Or to get the latest unreleased dev version:
+
+::
+
+ $ [sudo] pip install https://github.com/pypa/virtualenv/tarball/develop
+
+
+To install version X.X globally from source:
+
+::
+
+ $ curl -O https://pypi.python.org/packages/source/v/virtualenv/virtualenv-X.X.tar.gz
+ $ tar xvfz virtualenv-X.X.tar.gz
+ $ cd virtualenv-X.X
+ $ [sudo] python setup.py install
+
+
+To *use* locally from source:
+
+::
+
+ $ curl -O https://pypi.python.org/packages/source/v/virtualenv/virtualenv-X.X.tar.gz
+ $ tar xvfz virtualenv-X.X.tar.gz
+ $ cd virtualenv-X.X
+ $ python virtualenv.py myVE
+
+.. note::
+
+    The ``virtualenv.py`` script is *not* supported if run without the
+    necessary pip/setuptools/virtualenv distributions available locally. All
+    of the installation methods above include a ``virtualenv_support``
+    directory alongside ``virtualenv.py`` which contains a complete set of
+    pip and setuptools distributions, and so are fully supported.
diff --git a/misc/virtualenv/docs/news.txt b/misc/virtualenv/docs/news.txt
deleted file mode 100644 (file)
index 254229c..0000000
+++ /dev/null
@@ -1,409 +0,0 @@
-Changes & News
---------------
-
-1.7 (2011-11-30)
-~~~~~~~~~~~~~~~~
-
-* Updated embedded Distribute release to 0.6.24. Thanks Alex Grönholm.
-
-* 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 intepreter (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_USE_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 <./index.html#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!
diff --git a/misc/virtualenv/docs/reference.rst b/misc/virtualenv/docs/reference.rst
new file mode 100644 (file)
index 0000000..9249473
--- /dev/null
@@ -0,0 +1,261 @@
+Reference Guide
+===============
+
+``virtualenv`` Command
+----------------------
+
+.. _usage:
+
+Usage
+~~~~~
+
+:command:`virtualenv [OPTIONS] ENV_DIR`
+
+    Where ``ENV_DIR`` is an absolute or relative path to a directory to create
+    the virtual environment in.
+
+.. _options:
+
+Options
+~~~~~~~
+
+.. program: virtualenv
+
+.. option:: --version
+
+   show program's version number and exit
+
+.. option:: -h, --help
+
+   show this help message and exit
+
+.. option:: -v, --verbose
+
+   Increase verbosity.
+
+.. option:: -q, --quiet
+
+   Decrease verbosity.
+
+.. option:: -p PYTHON_EXE, --python=PYTHON_EXE
+
+   The Python interpreter to use, e.g.,
+   --python=python2.5 will use the python2.5 interpreter
+   to create the new environment.  The default is the
+   interpreter that virtualenv was installed with
+   (like ``/usr/bin/python``)
+
+.. option:: --clear
+
+   Clear out the non-root install and start from scratch.
+
+.. option:: --system-site-packages
+
+   Give the virtual environment access to the global
+   site-packages.
+
+.. option:: --always-copy
+
+   Always copy files rather than symlinking.
+
+.. option:: --relocatable
+
+   Make an EXISTING virtualenv environment relocatable.
+   This fixes up scripts and makes all .pth files relative.
+
+.. option:: --unzip-setuptools
+
+   Unzip Setuptools when installing it.
+
+.. option:: --no-setuptools
+
+   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.
+   This option can be specified multiple times.
+
+.. option:: --prompt=PROMPT
+
+   Provides an alternative prompt prefix for this
+   environment.
+
+.. option:: --download
+
+   Download preinstalled packages from PyPI.
+
+.. option:: --no-download
+
+   Do not download preinstalled packages from PyPI.
+
+.. option:: --no-site-packages
+
+   DEPRECATED. Retained only for backward compatibility.
+   Not having access to global site-packages is now the
+   default behavior.
+
+.. option:: --distribute
+.. option:: --setuptools
+
+   Legacy; now have no effect.  Before version 1.10 these could be used
+   to choose whether to install Distribute_ or Setuptools_ into the created
+   virtualenv. Distribute has now been merged into Setuptools, and the
+   latter is always installed.
+
+.. _Distribute: https://pypi.python.org/pypi/distribute
+.. _Setuptools: https://pypi.python.org/pypi/setuptools
+
+
+Configuration
+-------------
+
+Environment Variables
+~~~~~~~~~~~~~~~~~~~~~
+
+Each command line option is automatically used to look for environment
+variables with the name format ``VIRTUALENV_<UPPER_NAME>``. That means
+the name of the command line options are capitalized and have dashes
+(``'-'``) replaced with underscores (``'_'``).
+
+For example, to automatically use a custom Python binary instead of the
+one virtualenv is run with you can also set an environment variable::
+
+  $ export VIRTUALENV_PYTHON=/opt/python-3.3/bin/python
+  $ virtualenv ENV
+
+It's the same as passing the option to virtualenv directly::
+
+  $ virtualenv --python=/opt/python-3.3/bin/python ENV
+
+This also works for appending command line options, like ``--find-links``.
+Just leave an empty space between the passed values, e.g.::
+
+  $ export VIRTUALENV_EXTRA_SEARCH_DIR="/path/to/dists /path/to/other/dists"
+  $ virtualenv ENV
+
+is the same as calling::
+
+  $ virtualenv --extra-search-dir=/path/to/dists --extra-search-dir=/path/to/other/dists ENV
+
+.. envvar:: VIRTUAL_ENV_DISABLE_PROMPT
+
+   Any virtualenv created when this is set to a non-empty value will not have
+   it's :ref:`activate` modify the shell prompt.
+
+
+Configuration File
+~~~~~~~~~~~~~~~~~~
+
+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
+``%APPDATA%\virtualenv\virtualenv.ini``.
+
+The names of the settings are derived from the long command line option,
+e.g. the option :option:`--python <-p>` would look like this::
+
+  [virtualenv]
+  python = /opt/python-3.3/bin/python
+
+Appending options like :option:`--extra-search-dir` can be written on multiple
+lines::
+
+  [virtualenv]
+  extra-search-dir =
+      /path/to/dists
+      /path/to/other/dists
+
+Please have a look at the output of :option:`--help <-h>` for a full list
+of supported options.
+
+
+Extending Virtualenv
+--------------------
+
+
+Creating Your Own Bootstrap Scripts
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+While this creates an environment, it doesn't put anything into the
+environment. Developers may find it useful to distribute a script
+that sets up a particular environment, for example a script that
+installs a particular web application.
+
+To create a script like this, call
+:py:func:`virtualenv.create_bootstrap_script`, and write the
+result to your new bootstrapping script.
+
+.. py:function:: create_bootstrap_script(extra_text)
+
+   Creates a bootstrap script from ``extra_text``, which is like
+   this script but with extend_parser, adjust_options, and after_install hooks.
+
+This returns a string that (written to disk of course) can be used
+as a bootstrap script with your own customizations. The script
+will be the standard virtualenv.py script, with your extra text
+added (your extra text should be Python code).
+
+If you include these functions, they will be called:
+
+.. py:function:: extend_parser(optparse_parser)
+
+   You can add or remove options from the parser here.
+
+.. py:function:: adjust_options(options, args)
+
+   You can change options here, or change the args (if you accept
+   different kinds of arguments, be sure you modify ``args`` so it is
+   only ``[DEST_DIR]``).
+
+.. py:function:: after_install(options, home_dir)
+
+   After everything is installed, this function is called. This
+   is probably the function you are most likely to use. An
+   example would be::
+
+       def after_install(options, home_dir):
+           if sys.platform == 'win32':
+               bin = 'Scripts'
+           else:
+               bin = 'bin'
+           subprocess.call([join(home_dir, bin, 'easy_install'),
+                            'MyPackage'])
+           subprocess.call([join(home_dir, bin, 'my-package-script'),
+                            'setup', home_dir])
+
+   This example immediately installs a package, and runs a setup
+   script from that package.
+
+Bootstrap Example
+~~~~~~~~~~~~~~~~~
+
+Here's a more concrete example of how you could use this::
+
+    import virtualenv, textwrap
+    output = virtualenv.create_bootstrap_script(textwrap.dedent("""
+    import os, subprocess
+    def after_install(options, home_dir):
+        etc = join(home_dir, 'etc')
+        if not os.path.exists(etc):
+            os.makedirs(etc)
+        subprocess.call([join(home_dir, 'bin', 'easy_install'),
+                         'BlogApplication'])
+        subprocess.call([join(home_dir, 'bin', 'paster'),
+                         'make-config', 'BlogApplication',
+                         join(etc, 'blog.ini')])
+        subprocess.call([join(home_dir, 'bin', 'paster'),
+                         'setup-app', join(etc, 'blog.ini')])
+    """))
+    f = open('blog-bootstrap.py', 'w').write(output)
+
+Another example is available `here`__.
+
+.. __: https://github.com/socialplanning/fassembler/blob/master/fassembler/create-venv-script.py
diff --git a/misc/virtualenv/docs/userguide.rst b/misc/virtualenv/docs/userguide.rst
new file mode 100644 (file)
index 0000000..c3eb031
--- /dev/null
@@ -0,0 +1,258 @@
+User Guide
+==========
+
+
+Usage
+-----
+
+Virtualenv has one basic command::
+
+    $ virtualenv ENV
+
+Where ``ENV`` is a directory to place the new virtual environment. It has
+a number of usual effects (modifiable by many :ref:`options`):
+
+ - :file:`ENV/lib/` and :file:`ENV/include/` are created, containing supporting
+   library files for a new virtualenv python. Packages installed in this
+   environment will live under :file:`ENV/lib/pythonX.X/site-packages/`.
+
+ - :file:`ENV/bin` is created, where executables live - noticeably a new
+   :command:`python`. Thus running a script with ``#! /path/to/ENV/bin/python``
+   would run that script under this virtualenv's python.
+
+ - The crucial packages pip_ and setuptools_ are installed, which allow other
+   packages to be easily installed to the environment. This associated pip
+   can be run from :file:`ENV/bin/pip`.
+
+The python in your new virtualenv is effectively isolated from the python that
+was used to create it.
+
+.. _pip: https://pypi.python.org/pypi/pip
+.. _setuptools: https://pypi.python.org/pypi/setuptools
+
+
+.. _activate:
+
+activate script
+~~~~~~~~~~~~~~~
+
+In a newly created virtualenv there will also be a :command:`activate` shell
+script. For Windows systems, activation scripts are provided for
+the Command Prompt and Powershell.
+
+On Posix systems, this resides in :file:`/ENV/bin/`, so you can run::
+
+    $ source bin/activate
+
+For some shells (e.g. the original Bourne Shell) you may need to use the
+:command:`.` command, when :command:`source` does not exist. There are also
+separate activate files for some other shells, like csh and fish.
+:file:`bin/activate` should work for bash/zsh/dash.
+
+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.
+
+The ``activate`` script will also modify your shell prompt to indicate
+which environment is currently active. To disable this behaviour, see
+:envvar:`VIRTUAL_ENV_DISABLE_PROMPT`.
+
+To undo these changes to your path (and prompt), just run::
+
+    $ deactivate
+
+On Windows, the equivalent `activate` script is in the ``Scripts`` folder::
+
+    > \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 can 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 prompted 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
+
+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
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+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.
+
+Windows Notes
+~~~~~~~~~~~~~
+
+Some paths within the virtualenv are slightly different on Windows: scripts and
+executables on Windows go in ``ENV\Scripts\`` instead of ``ENV/bin/`` and
+libraries go in ``ENV\Lib\`` rather than ``ENV/lib/``.
+
+To create a virtualenv under a path with spaces in it on Windows, you'll need
+the `win32api <http://sourceforge.net/projects/pywin32/>`_ library installed.
+
+
+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
+<http://www.modpython.org/>`_ or `mod_wsgi <http://www.modwsgi.org/>`_
+environment, there is only one interpreter.
+
+Luckily, it's easy. You must use the custom Python interpreter to
+*install* libraries. But to *use* libraries, you just have to be sure
+the path is correct. A script is available to correct the path. You
+can setup the environment like::
+
+    activate_this = '/path/to/env/bin/activate_this.py'
+    execfile(activate_this, dict(__file__=activate_this))
+
+This will change ``sys.path`` and even change ``sys.prefix``, but also allow
+you to use an existing interpreter. Items in your environment will show up
+first on ``sys.path``, before global items. However, global items will
+always be accessible (as if the :option:`--system-site-packages` flag had been
+used in creating the environment, whether it was or not). Also, this cannot undo
+the activation of other environments, or modules that have been imported.
+You shouldn't try to, for instance, activate an environment before a web
+request; you should activate *one* environment as early as possible, and not
+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.
+
+.. warning::
+
+    The ``--relocatable`` option currently has a number of issues,
+    and is not guaranteed to work in all circumstances. It is possible
+    that the option will be deprecated in a future version of ``virtualenv``.
+
+Normally environments are tied to a specific path. That means that
+you cannot move an environment around or copy it to another computer.
+You can fix up an environment to make it relocatable with the
+command::
+
+    $ virtualenv --relocatable ENV
+
+This will make some of the files created by setuptools use relative paths,
+and will change all the scripts to use ``activate_this.py`` instead of using
+the location of the Python interpreter to select the environment.
+
+**Note:** scripts which have been made relocatable will only work if
+the virtualenv is activated, specifically the python executable from
+the virtualenv must be the first one on the system PATH. Also note that
+the activate scripts are not currently made relocatable by
+``virtualenv --relocatable``.
+
+**Note:** you must run this after you've installed *any* packages into
+the environment. If you make an environment relocatable, then
+install a new package, you must run ``virtualenv --relocatable``
+again.
+
+Also, this **does not make your packages cross-platform**. You can
+move the directory around, but it can only be used on other similar
+computers. Some known environmental differences that can cause
+incompatibilities: a different version of Python, when one platform
+uses UCS2 for its internal unicode representation and another uses
+UCS4 (a compile-time option), obvious platform changes like Windows
+vs. Linux, or Intel vs. ARM, and if you have libraries that bind to C
+libraries on the system, if those C libraries are located somewhere
+different (either different versions, or a different filesystem
+layout).
+
+If you use this flag to create an environment, currently, the
+:option:`--system-site-packages` option will be implied.
+
+The :option:`--extra-search-dir` option
+---------------------------------------
+
+This option allows you to provide your own versions of setuptools and/or
+pip to use instead of the embedded versions that come with virtualenv.
+
+To use this feature, pass one or more ``--extra-search-dir`` options to
+virtualenv like this::
+
+    $ virtualenv --extra-search-dir=/path/to/distributions ENV
+
+The ``/path/to/distributions`` path should point to a directory that contains
+setuptools and/or pip wheels.
+
+virtualenv will look for wheels in the specified directories, but will use
+pip's standard algorithm for selecting the wheel to install, which looks for
+the latest compatible wheel.
+
+As well as the extra directories, the search order includes:
+
+#. The ``virtualenv_support`` directory relative to virtualenv.py
+#. The directory where virtualenv.py is located.
+#. The current directory.
+
index 861a9f5..6f08d0e 100644 (file)
@@ -1,3 +1,6 @@
+[bdist_wheel]
+universal = 1
+
 [egg_info]
 tag_build = 
 tag_date = 0
index 6e6cdd8..ee03bc5 100644 (file)
-import sys, os
+import os
+import re
+import shutil
+import sys
+
+if sys.version_info[:2] < (2, 6):
+    sys.exit('virtualenv requires Python 2.6 or higher.')
+
 try:
     from setuptools import setup
-    kw = {'entry_points':
-          """[console_scripts]\nvirtualenv = virtualenv:main\n""",
-          'zip_safe': False}
+    from setuptools.command.test import test as TestCommand
+
+    class PyTest(TestCommand):
+        user_options = [('pytest-args=', 'a', "Arguments to pass to py.test")]
+
+        def initialize_options(self):
+            TestCommand.initialize_options(self)
+            self.pytest_args = []
+
+        def finalize_options(self):
+            TestCommand.finalize_options(self)
+            #self.test_args = []
+            #self.test_suite = True
+
+        def run_tests(self):
+            # import here, because outside the eggs aren't loaded
+            import pytest
+            sys.exit(pytest.main(self.pytest_args))
+
+    setup_params = {
+        'entry_points': {
+            'console_scripts': ['virtualenv=virtualenv:main'],
+        },
+        'zip_safe': False,
+        'cmdclass': {'test': PyTest},
+        'tests_require': ['pytest', 'mock'],
+    }
 except ImportError:
     from distutils.core import setup
     if sys.platform == 'win32':
-        print('Note: without Setuptools installed you will have to use "python -m virtualenv ENV"')
-        kw = {}
+        print('Note: without Setuptools installed you will '
+              'have to use "python -m virtualenv ENV"')
+        setup_params = {}
     else:
-        kw = {'scripts': ['scripts/virtualenv']}
-
-here = os.path.dirname(os.path.abspath(__file__))
-
-## Get long_description from index.txt:
-f = open(os.path.join(here, 'docs', 'index.txt'))
-long_description = f.read().strip()
-long_description = long_description.split('split here', 1)[1]
-f.close()
-f = open(os.path.join(here, 'docs', 'news.txt'))
-long_description += "\n\n" + f.read()
-f.close()
-
-setup(name='virtualenv',
-      # If you change the version here, change it in virtualenv.py and
-      # docs/conf.py as well
-      version="1.7",
-      description="Virtual Python Environment builder",
-      long_description=long_description,
-      classifiers=[
-        'Development Status :: 4 - Beta',
+        script = 'scripts/virtualenv'
+        setup_params = {'scripts': [script]}
+
+
+def read_file(*paths):
+    here = os.path.dirname(os.path.abspath(__file__))
+    with open(os.path.join(here, *paths)) as f:
+        return f.read()
+
+# Get long_description from index.rst:
+long_description = read_file('docs', 'index.rst')
+long_description = long_description.strip().split('split here', 1)[0]
+# Add release history
+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():
+    version_file = read_file('virtualenv.py')
+    version_match = re.search(r"^__version__ = ['\"]([^'\"]*)['\"]",
+                              version_file, re.M)
+    if version_match:
+        return version_match.group(1)
+    raise RuntimeError("Unable to find version string.")
+
+
+# Hack to prevent stupid TypeError: 'NoneType' object is not callable error on
+# exit of python setup.py test # in multiprocessing/util.py _exit_function when
+# running python setup.py test (see
+# http://www.eby-sarna.com/pipermail/peak/2010-May/003357.html)
+try:
+    import multiprocessing  # noqa
+except ImportError:
+    pass
+
+setup(
+    name='virtualenv',
+    version=get_version(),
+    description="Virtual Python Environment builder",
+    long_description=long_description,
+    classifiers=[
+        'Development Status :: 5 - Production/Stable',
         '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',
         'Programming Language :: Python :: 3',
-        'Programming Language :: Python :: 3.1',
-        'Programming Language :: Python :: 3.2',
-        ],
-      keywords='setuptools deployment installation distutils',
-      author='Ian Bicking',
-      author_email='ianb@colorstudy.com',
-      maintainer='Jannis Leidel, Carl Meyer and Brian Rosner',
-      maintainer_email='python-virtualenv@groups.google.com',
-      url='http://www.virtualenv.org',
-      license='MIT',
-      py_modules=['virtualenv'],
-      packages=['virtualenv_support'],
-      package_data={'virtualenv_support': ['*-py%s.egg' % sys.version[:3], '*.tar.gz']},
-      test_suite='nose.collector',
-      tests_require=['nose', 'Mock'],
-      **kw
-      )
+        'Programming Language :: Python :: 3.3',
+        'Programming Language :: Python :: 3.4',
+        'Programming Language :: Python :: 3.5',
+    ],
+    keywords='setuptools deployment installation distutils',
+    author='Ian Bicking',
+    author_email='ianb@colorstudy.com',
+    maintainer='Jannis Leidel, Carl Meyer and Brian Rosner',
+    maintainer_email='python-virtualenv@groups.google.com',
+    url='https://virtualenv.pypa.io/',
+    license='MIT',
+    py_modules=['virtualenv'],
+    packages=['virtualenv_support'],
+    package_data={'virtualenv_support': ['*.whl']},
+    **setup_params)
diff --git a/misc/virtualenv/tests/test_activate.sh b/misc/virtualenv/tests/test_activate.sh
new file mode 100755 (executable)
index 0000000..e277273
--- /dev/null
@@ -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}
+
diff --git a/misc/virtualenv/tests/test_activate_output.expected b/misc/virtualenv/tests/test_activate_output.expected
new file mode 100644 (file)
index 0000000..d49469f
--- /dev/null
@@ -0,0 +1,2 @@
+New python executable in /tmp/test_virtualenv_activate.venv/bin/python
+Installing setuptools, pip, wheel...done.
diff --git a/misc/virtualenv/tests/test_cmdline.py b/misc/virtualenv/tests/test_cmdline.py
new file mode 100644 (file)
index 0000000..9682ef0
--- /dev/null
@@ -0,0 +1,44 @@
+import sys
+import subprocess
+import virtualenv
+import pytest
+
+VIRTUALENV_SCRIPT = virtualenv.__file__
+
+def test_commandline_basic(tmpdir):
+    """Simple command line usage should work"""
+    subprocess.check_call([
+        sys.executable,
+        VIRTUALENV_SCRIPT,
+        str(tmpdir.join('venv'))
+    ])
+
+def test_commandline_explicit_interp(tmpdir):
+    """Specifying the Python interpreter should work"""
+    subprocess.check_call([
+        sys.executable,
+        VIRTUALENV_SCRIPT,
+        '-p', sys.executable,
+        str(tmpdir.join('venv'))
+    ])
+
+# The registry lookups to support the abbreviated "-p 3.5" form of specifying
+# a Python interpreter on Windows don't seem to work with Python 3.5. The
+# registry layout is not well documented, and it's not clear that the feature
+# is sufficiently widely used to be worth fixing.
+# See https://github.com/pypa/virtualenv/issues/864
+@pytest.mark.skipif("sys.platform == 'win32' and sys.version_info[:2] >= (3,5)")
+def test_commandline_abbrev_interp(tmpdir):
+    """Specifying abbreviated forms of the Python interpreter should work"""
+    if sys.platform == 'win32':
+        fmt = '%s.%s'
+    else:
+        fmt = 'python%s.%s'
+    abbrev = fmt % (sys.version_info[0], sys.version_info[1])
+    subprocess.check_call([
+        sys.executable,
+        VIRTUALENV_SCRIPT,
+        '-p', abbrev,
+        str(tmpdir.join('venv'))
+    ])
+
index 3752e15..ce45ede 100644 (file)
@@ -1,10 +1,18 @@
 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 == "1.7", "Should have version"
+    assert virtualenv.virtualenv_version, "Should have version"
 
 
 @patch('os.path.exists')
@@ -12,39 +20,122 @@ 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)
 
-    exe = virtualenv.resolve_interpreter("/usr/bin/python42")
+    assert exe == test_abs_path, "Absolute path should return as is"
 
-    assert exe == "/usr/bin/python42", "Absolute path should return as is"
-    mock_exists.assert_called_with("/usr/bin/python42")
-    virtualenv.is_executable.assert_called_with("/usr/bin/python42")
+    mock_exists.assert_called_with(test_abs_path)
+    virtualenv.is_executable.assert_called_with(test_abs_path)
 
 
 @patch('os.path.exists')
-def test_resolve_intepreter_with_nonexistant_interpreter(mock_exists):
-    """Should exit when with absolute path if not exists"""
+def test_resolve_interpreter_with_nonexistent_interpreter(mock_exists):
+    """Should SystemExit with an nonexistent python interpreter path"""
     mock_exists.return_value = False
 
-    try:
-        virtualenv.resolve_interpreter("/usr/bin/python42")
-        assert False, "Should raise exception"
-    except SystemExit:
-        pass
+    with pytest.raises(SystemExit):
+        virtualenv.resolve_interpreter("/usr/bin/python53")
 
-    mock_exists.assert_called_with("/usr/bin/python42")
+    mock_exists.assert_called_with("/usr/bin/python53")
 
 
 @patch('os.path.exists')
-def test_resolve_intepreter_with_invalid_interpreter(mock_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.resolve_interpreter("/usr/bin/python42")
-        assert False, "Should raise exception"
-    except SystemExit:
-        pass
+        virtualenv.create_environment(ve_path, symlink=False)
 
-    mock_exists.assert_called_with("/usr/bin/python42")
-    virtualenv.is_executable.assert_called_with("/usr/bin/python42")
+        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)
index 5b4951d..42cd1f4 100755 (executable)
@@ -1,59 +1,65 @@
 #!/usr/bin/env python
-"""Create a "virtual" Python installation
-"""
+"""Create a "virtual" Python installation"""
 
-# If you change the version here, change it in setup.py
-# and docs/conf.py as well.
-virtualenv_version = "1.7"
+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
+import struct
+import subprocess
+import pkgutil
+import tempfile
+import textwrap
 from distutils.util import strtobool
+from os.path import join
 
 try:
-    import subprocess
+    import ConfigParser
 except ImportError:
-    if sys.version_info <= (2, 3):
-        print('ERROR: %s' % sys.exc_info()[1])
-        print('ERROR: this script requires Python 2.4 or greater; or at least the subprocess module.')
-        print('If you copy subprocess.py from a newer version of Python this script will probably work')
-        sys.exit(101)
-    else:
-        raise
-try:
-    set
-except NameError:
-    from sets import Set as set
+    import configparser as ConfigParser
+
+__version__ = "15.1.0"
+virtualenv_version = __version__  # legacy
+
+if sys.version_info < (2, 6):
+    print('ERROR: %s' % sys.exc_info()[1])
+    print('ERROR: this script requires Python 2.6 or greater.')
+    sys.exit(101)
+
 try:
     basestring
 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')
 is_pypy = hasattr(sys, 'pypy_version_info')
-is_win  = (sys.platform == 'win32')
+is_win = (sys.platform == 'win32')
+is_cygwin = (sys.platform == 'cygwin')
+is_darwin = (sys.platform == 'darwin')
 abiflags = getattr(sys, 'abiflags', '')
 
 user_dir = os.path.expanduser('~')
-if sys.platform == 'win32':
-    user_dir = os.environ.get('APPDATA', user_dir)  # Use %APPDATA% for roaming
+if is_win:
     default_storage_dir = os.path.join(user_dir, 'virtualenv')
 else:
     default_storage_dir = os.path.join(user_dir, '.virtualenv')
@@ -66,6 +72,49 @@ elif is_jython:
 else:
     expected_exe = 'python'
 
+# Return a mapping of version -> Python executable
+# Only provided for Windows, where the information in the registry is used
+if not is_win:
+    def get_installed_pythons():
+        return {}
+else:
+    try:
+        import winreg
+    except ImportError:
+        import _winreg as winreg
+
+    def get_installed_pythons():
+        try:
+            python_core = winreg.CreateKey(winreg.HKEY_LOCAL_MACHINE,
+                                           "Software\\Python\\PythonCore")
+        except WindowsError:
+            # No registered Python installations
+            return {}
+        i = 0
+        versions = []
+        while True:
+            try:
+                versions.append(winreg.EnumKey(python_core, i))
+                i = i + 1
+            except WindowsError:
+                break
+        exes = dict()
+        for ver in versions:
+            try:
+                path = winreg.QueryValue(python_core, "%s\\InstallPath" % ver)
+            except WindowsError:
+                continue
+            exes[ver] = join(path, "python.exe")
+
+        winreg.CloseKey(python_core)
+
+        # Add the major versions
+        # Sort the keys, then repeatedly update the major version entry
+        # Last executable (i.e., highest version) wins with this approach
+        for ver in sorted(exes):
+            exes[ver[0]] = exes[ver]
+
+        return exes
 
 REQUIRED_MODULES = ['os', 'posix', 'posixpath', 'nt', 'ntpath', 'genericpath',
                     'fnmatch', 'locale', 'encodings', 'codecs',
@@ -81,174 +130,45 @@ if majver == 2:
         REQUIRED_MODULES.extend(['warnings', 'linecache', '_abcoll', 'abc'])
     if minver >= 7:
         REQUIRED_MODULES.extend(['_weakrefset'])
-    if minver <= 3:
-        REQUIRED_MODULES.extend(['sets', '__future__'])
 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'])
+    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:
-        # 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.
+    if minver >= 3:
+        import sysconfig
+        platdir = sysconfig.get_config_var('PLATDIR')
+        REQUIRED_FILES.append(platdir)
         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",
-            #"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([
+            'operator',
+            '_collections_abc',
+            '_bootlocale',
+        ])
+    if minver >= 6:
+        REQUIRED_MODULES.extend(['enum'])
 
 if is_pypy:
     # these are needed to correctly display the exceptions that may happen
     # during the bootstrap
     REQUIRED_MODULES.extend(['traceback', 'linecache'])
 
+    if majver == 3:
+        # _functools is needed to import locale during stdio initialization and
+        # needs to be copied on PyPy because it's not built in
+        REQUIRED_MODULES.append('_functools')
+
+
 class Logger(object):
 
     """
@@ -273,16 +193,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.WARN, 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:
@@ -378,7 +304,7 @@ class Logger(object):
         else:
             return level >= consumer_level
 
-    #@classmethod
+    @classmethod
     def level_for_integer(cls, level):
         levels = cls.LEVELS
         if level < 0:
@@ -387,8 +313,6 @@ class Logger(object):
             return levels[-1]
         return levels[level]
 
-    level_for_integer = classmethod(level_for_integer)
-
 # create a silent logger just to prevent this from being undefined
 # will be overridden with requested verbosity main() is called.
 logger = Logger([(Logger.LEVELS[-1], sys.stdout)])
@@ -400,9 +324,9 @@ def mkdir(path):
     else:
         logger.info('Directory %s already exists', path)
 
-def copyfileordir(src, dest):
+def copyfileordir(src, dest, symlink=True):
     if os.path.isdir(src):
-        shutil.copytree(src, dest, True)
+        shutil.copytree(src, dest, symlink)
     else:
         shutil.copy2(src, dest)
 
@@ -415,42 +339,39 @@ def copyfile(src, dest, symlink=True):
         logger.debug('File %s already exists', dest)
         return
     if not os.path.exists(os.path.dirname(dest)):
-        logger.info('Creating parent directories for %s' % os.path.dirname(dest))
+        logger.info('Creating parent directories for %s', os.path.dirname(dest))
         os.makedirs(os.path.dirname(dest))
     if not os.path.islink(src):
         srcpath = os.path.abspath(src)
     else:
         srcpath = os.readlink(src)
-    if symlink and hasattr(os, 'symlink'):
+    if symlink and hasattr(os, 'symlink') and not is_win:
         logger.info('Symlinking %s', dest)
         try:
             os.symlink(srcpath, dest)
         except (OSError, NotImplementedError):
             logger.info('Symlinking failed, copying to %s', dest)
-            copyfileordir(src, dest)
+            copyfileordir(src, dest, symlink)
     else:
         logger.info('Copying to %s', dest)
-        copyfileordir(src, dest)
+        copyfileordir(src, dest, symlink)
 
 def writefile(dest, content, overwrite=True):
     if not os.path.exists(dest):
         logger.info('Writing %s', dest)
-        f = open(dest, 'wb')
-        f.write(content.encode('utf-8'))
-        f.close()
+        with open(dest, 'wb') as f:
+            f.write(content.encode('utf-8'))
         return
     else:
-        f = open(dest, 'rb')
-        c = f.read()
-        f.close()
-        if c != content:
+        with open(dest, 'rb') as f:
+            c = f.read()
+        if c != content.encode("utf-8"):
             if not overwrite:
                 logger.notify('File %s exists with different content; not overwriting', dest)
                 return
             logger.notify('Overwriting %s with new content', dest)
-            f = open(dest, 'wb')
-            f.write(content.encode('utf-8'))
-            f.close()
+            with open(dest, 'wb') as f:
+                f.write(content.encode('utf-8'))
         else:
             logger.info('Content %s already in place', dest)
 
@@ -469,114 +390,15 @@ def make_exe(fn):
         logger.info('Changed mode of %s to %s', fn, oct(newmode))
 
 def _find_file(filename, dirs):
-    for dir in dirs:
-        if os.path.exists(join(dir, filename)):
-            return join(dir, filename)
-    return filename
-
-def _install_req(py_executable, unzip=False, distribute=False,
-                 search_dirs=None, never_download=False):
-
-    if search_dirs is None:
-        search_dirs = file_search_dirs()
-
-    if not distribute:
-        setup_fn = 'setuptools-0.6c11-py%s.egg' % sys.version[:3]
-        project_name = 'setuptools'
-        bootstrap_script = EZ_SETUP_PY
-        source = None
-    else:
-        setup_fn = None
-        source = 'distribute-0.6.24.tar.gz'
-        project_name = 'distribute'
-        bootstrap_script = DISTRIBUTE_SETUP_PY
-
-    if setup_fn is not None:
-        setup_fn = _find_file(setup_fn, search_dirs)
-
-    if source is not None:
-        source = _find_file(source, search_dirs)
-
-    if is_jython and os._name == 'nt':
-        # Jython's .bat sys.executable can't handle a command line
-        # argument with newlines
-        fd, ez_setup = tempfile.mkstemp('.py')
-        os.write(fd, bootstrap_script)
-        os.close(fd)
-        cmd = [py_executable, ez_setup]
-    else:
-        cmd = [py_executable, '-c', bootstrap_script]
-    if unzip:
-        cmd.append('--always-unzip')
-    env = {}
-    remove_from_env = []
-    if logger.stdout_level_matches(logger.DEBUG):
-        cmd.append('-v')
-
-    old_chdir = os.getcwd()
-    if setup_fn is not None and os.path.exists(setup_fn):
-        logger.info('Using existing %s egg: %s' % (project_name, setup_fn))
-        cmd.append(setup_fn)
-        if os.environ.get('PYTHONPATH'):
-            env['PYTHONPATH'] = setup_fn + os.path.pathsep + os.environ['PYTHONPATH']
-        else:
-            env['PYTHONPATH'] = setup_fn
-    else:
-        # the source is found, let's chdir
-        if source is not None and os.path.exists(source):
-            logger.info('Using existing %s egg: %s' % (project_name, source))
-            os.chdir(os.path.dirname(source))
-            # in this case, we want to be sure that PYTHONPATH is unset (not
-            # just empty, really unset), else CPython tries to import the
-            # site.py that it's in virtualenv_support
-            remove_from_env.append('PYTHONPATH')
-        else:
-            if never_download:
-                logger.fatal("Can't find any local distributions of %s to install "
-                             "and --never-download is set.  Either re-run virtualenv "
-                             "without the --never-download option, or place a %s "
-                             "distribution (%s) in one of these "
-                             "locations: %r" % (project_name, project_name,
-                                                setup_fn or source,
-                                                search_dirs))
-                sys.exit(1)
-
-            logger.info('No %s egg found; downloading' % project_name)
-        cmd.extend(['--always-copy', '-U', project_name])
-    logger.start_progress('Installing %s...' % project_name)
-    logger.indent += 2
-    cwd = None
-    if project_name == 'distribute':
-        env['DONT_PATCH_SETUPTOOLS'] = 'true'
-
-    def _filter_ez_setup(line):
-        return filter_ez_setup(line, project_name)
-
-    if not os.access(os.getcwd(), os.W_OK):
-        cwd = tempfile.mkdtemp()
-        if source is not None and os.path.exists(source):
-            # the current working dir is hostile, let's copy the
-            # tarball to a temp dir
-            target = os.path.join(cwd, os.path.split(source)[-1])
-            shutil.copy(source, target)
-    try:
-        call_subprocess(cmd, show_stdout=False,
-                        filter_stdout=_filter_ez_setup,
-                        extra_env=env,
-                        remove_from_env=remove_from_env,
-                        cwd=cwd)
-    finally:
-        logger.indent -= 2
-        logger.end_progress()
-        if os.getcwd() != old_chdir:
-            os.chdir(old_chdir)
-        if is_jython and os._name == 'nt':
-            os.remove(ez_setup)
+    for dir in reversed(dirs):
+        files = glob.glob(os.path.join(dir, filename))
+        if files and os.path.isfile(files[0]):
+            return True, files[0]
+    return False, filename
 
 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:
@@ -584,83 +406,10 @@ 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)]
 
-def install_setuptools(py_executable, unzip=False,
-                       search_dirs=None, never_download=False):
-    _install_req(py_executable, unzip,
-                 search_dirs=search_dirs, never_download=never_download)
-
-def install_distribute(py_executable, unzip=False,
-                       search_dirs=None, never_download=False):
-    _install_req(py_executable, unzip, distribute=True,
-                 search_dirs=search_dirs, never_download=never_download)
-
-_pip_re = re.compile(r'^pip-.*(zip|tar.gz|tar.bz2|tgz|tbz)$', re.I)
-def install_pip(py_executable, search_dirs=None, never_download=False):
-    if search_dirs is None:
-        search_dirs = file_search_dirs()
-
-    filenames = []
-    for dir in search_dirs:
-        filenames.extend([join(dir, fn) for fn in os.listdir(dir)
-                          if _pip_re.search(fn)])
-    filenames = [(os.path.basename(filename).lower(), i, filename) for i, filename in enumerate(filenames)]
-    filenames.sort()
-    filenames = [filename for basename, i, filename in filenames]
-    if not filenames:
-        filename = 'pip'
-    else:
-        filename = filenames[-1]
-    easy_install_script = 'easy_install'
-    if sys.platform == 'win32':
-        easy_install_script = 'easy_install-script.py'
-    cmd = [join(os.path.dirname(py_executable), easy_install_script), filename]
-    if sys.platform == 'win32':
-        cmd.insert(0, py_executable)
-    if filename == 'pip':
-        if never_download:
-            logger.fatal("Can't find any local distributions of pip to install "
-                         "and --never-download is set.  Either re-run virtualenv "
-                         "without the --never-download option, or place a pip "
-                         "source distribution (zip/tar.gz/tar.bz2) in one of these "
-                         "locations: %r" % search_dirs)
-            sys.exit(1)
-        logger.info('Installing pip from network...')
-    else:
-        logger.info('Installing existing %s distribution: %s' % (
-                os.path.basename(filename), filename))
-    logger.start_progress('Installing pip...')
-    logger.indent += 2
-    def _filter_setup(line):
-        return filter_ez_setup(line, 'pip')
-    try:
-        call_subprocess(cmd, show_stdout=False,
-                        filter_stdout=_filter_setup)
-    finally:
-        logger.indent -= 2
-        logger.end_progress()
-
-def filter_ez_setup(line, project_name='setuptools'):
-    if not line.strip():
-        return Logger.DEBUG
-    if project_name == 'distribute':
-        for prefix in ('Extracting', 'Now working', 'Installing', 'Before',
-                       'Scanning', 'Setuptools', 'Egg', 'Already',
-                       'running', 'writing', 'reading', 'installing',
-                       'creating', 'copying', 'byte-compiling', 'removing',
-                       'Processing'):
-            if line.startswith(prefix):
-                return Logger.DEBUG
-        return Logger.DEBUG
-    for prefix in ['Reading ', 'Best match', 'Processing setuptools',
-                   'Copying setuptools', 'Adding setuptools',
-                   'Installing ', 'Installed ']:
-        if line.startswith(prefix):
-            return Logger.DEBUG
-    return Logger.INFO
-
 
 class UpdatingDefaultsHelpFormatter(optparse.IndentedHelpFormatter):
     """
@@ -676,7 +425,7 @@ class UpdatingDefaultsHelpFormatter(optparse.IndentedHelpFormatter):
 
 class ConfigOptionParser(optparse.OptionParser):
     """
-    Custom option parser which updates its defaults by by checking the
+    Custom option parser which updates its defaults by checking the
     configuration files and environmental variables
     """
     def __init__(self, *args, **kwargs):
@@ -718,13 +467,15 @@ class ConfigOptionParser(optparse.OptionParser):
                     val = val.split()
                 else:
                     option.nargs = 1
-                if option.action in ('store_true', 'store_false', 'count'):
+                if option.action == 'store_false':
+                    val = not strtobool(val)
+                elif option.action in ('store_true', 'count'):
                     val = strtobool(val)
                 try:
                     val = option.convert_value(key, val)
                 except optparse.OptionValueError:
                     e = sys.exc_info()[1]
-                    print("An error occured during configuration: %s" % e)
+                    print("An error occurred during configuration: %s" % e)
                     sys.exit(3)
                 defaults[option.dest] = val
         return defaults
@@ -754,7 +505,7 @@ class ConfigOptionParser(optparse.OptionParser):
             # Old, pre-Optik 1.5 behaviour.
             return optparse.Values(self.defaults)
 
-        defaults = self.update_defaults(self.defaults.copy()) # ours
+        defaults = self.update_defaults(self.defaults.copy())  # ours
         for option in self._get_all_options():
             default = defaults.get(option.dest)
             if isinstance(default, basestring):
@@ -774,14 +525,14 @@ def main():
         action='count',
         dest='verbose',
         default=0,
-        help="Increase verbosity")
+        help="Increase verbosity.")
 
     parser.add_option(
         '-q', '--quiet',
         action='count',
         dest='quiet',
         default=0,
-        help='Decrease verbosity')
+        help='Decrease verbosity.')
 
     parser.add_option(
         '-p', '--python',
@@ -795,62 +546,102 @@ def main():
         '--clear',
         dest='clear',
         action='store_true',
-        help="Clear out the non-root install and start from scratch")
+        help="Clear out the non-root install and start from scratch.")
 
+    parser.set_defaults(system_site_packages=False)
     parser.add_option(
         '--no-site-packages',
-        dest='no_site_packages',
-        action='store_true',
-        help="Don't give access to the global site-packages dir to the "
-             "virtual environment")
+        dest='system_site_packages',
+        action='store_false',
+        help="DEPRECATED. Retained only for backward compatibility. "
+             "Not having access to global site-packages is now the default behavior.")
 
     parser.add_option(
         '--system-site-packages',
         dest='system_site_packages',
         action='store_true',
-        help="Give access to the global site-packages dir to the "
-             "virtual environment")
+        help="Give the virtual environment access to the global site-packages.")
+
+    parser.add_option(
+        '--always-copy',
+        dest='symlink',
+        action='store_false',
+        default=True,
+        help="Always copy files rather than symlinking.")
 
     parser.add_option(
         '--unzip-setuptools',
         dest='unzip_setuptools',
         action='store_true',
-        help="Unzip Setuptools or Distribute when installing it")
+        help="Unzip Setuptools when installing it.")
 
     parser.add_option(
         '--relocatable',
         dest='relocatable',
         action='store_true',
-        help='Make an EXISTING virtualenv environment relocatable.  '
-        'This fixes up scripts and makes all .pth files relative')
+        help='Make an EXISTING virtualenv environment relocatable. '
+             'This fixes up scripts and makes all .pth files relative.')
 
     parser.add_option(
-        '--distribute',
-        dest='use_distribute',
+        '--no-setuptools',
+        dest='no_setuptools',
+        action='store_true',
+        help='Do not install setuptools in the new virtualenv.')
+
+    parser.add_option(
+        '--no-pip',
+        dest='no_pip',
+        action='store_true',
+        help='Do not install pip in the new virtualenv.')
+
+    parser.add_option(
+        '--no-wheel',
+        dest='no_wheel',
         action='store_true',
-        help='Use Distribute instead of Setuptools. Set environ variable '
-        'VIRTUALENV_DISTRIBUTE to make it the default ')
+        help='Do not install wheel in the new virtualenv.')
 
     default_search_dirs = file_search_dirs()
     parser.add_option(
         '--extra-search-dir',
         dest="search_dirs",
         action="append",
+        metavar='DIR',
         default=default_search_dirs,
-        help="Directory to look for setuptools/distribute/pip distributions in. "
-        "You can add any number of additional --extra-search-dir paths.")
+        help="Directory to look for setuptools/pip distributions in. "
+              "This option can be used multiple times.")
 
     parser.add_option(
-        '--never-download',
-        dest="never_download",
+        "--download",
+        dest="download",
+        default=True,
         action="store_true",
-        help="Never download anything from the network.  Instead, virtualenv will fail "
-        "if local distributions of setuptools/distribute/pip are not present.")
+        help="Download preinstalled packages from PyPI.",
+    )
 
     parser.add_option(
-        '--prompt=',
+        "--no-download",
+        '--never-download',
+        dest="download",
+        action="store_false",
+        help="Do not download preinstalled packages from PyPI.",
+    )
+
+    parser.add_option(
+        '--prompt',
         dest='prompt',
-        help='Provides an alternative prompt prefix for this environment')
+        help='Provides an alternative prompt prefix for this environment.')
+
+    parser.add_option(
+        '--setuptools',
+        dest='setuptools',
+        action='store_true',
+        help="DEPRECATED. Retained only for backward compatibility. This option has no effect.")
+
+    parser.add_option(
+        '--distribute',
+        dest='distribute',
+        action='store_true',
+        help="DEPRECATED. Retained only for backward compatibility. This option has no effect.")
 
     if 'extend_parser' in globals():
         extend_parser(parser)
@@ -863,7 +654,7 @@ def main():
         adjust_options(options, args)
 
     verbosity = options.verbose - options.quiet
-    logger = Logger([(Logger.level_for_integer(2-verbosity), sys.stdout)])
+    logger = Logger([(Logger.level_for_integer(2 - verbosity), sys.stdout)])
 
     if options.python and not os.environ.get('VIRTUALENV_INTERPRETER_RUNNING'):
         env = os.environ.copy()
@@ -879,16 +670,6 @@ def main():
             popen = subprocess.Popen([interpreter, file] + sys.argv[1:], env=env)
             raise SystemExit(popen.wait())
 
-    # Force --use-distribute on Python 3, since setuptools is not available.
-    if majver > 2:
-        options.use_distribute = True
-
-    if os.environ.get('PYTHONDONTWRITEBYTECODE') and not options.use_distribute:
-        print(
-            "The PYTHONDONTWRITEBYTECODE environment variable is "
-            "not compatible with setuptools. Either use --distribute "
-            "or unset PYTHONDONTWRITEBYTECODE.")
-        sys.exit(2)
     if not args:
         print('You must provide a DEST_DIR')
         parser.print_help()
@@ -901,6 +682,11 @@ def main():
 
     home_dir = args[0]
 
+    if os.path.exists(home_dir) and os.path.isfile(home_dir):
+        logger.fatal('ERROR: File already exists and is not a directory.')
+        logger.fatal('Please provide a different path or delete the file.')
+        sys.exit(3)
+
     if os.environ.get('WORKING_ENV'):
         logger.fatal('ERROR: you cannot run virtualenv while in a workingenv')
         logger.fatal('Please deactivate your workingenv, then re-run this script')
@@ -914,25 +700,24 @@ def main():
         make_environment_relocatable(home_dir)
         return
 
-    if options.no_site_packages:
-        logger.warn('The --no-site-packages flag is deprecated; it is now '
-                    'the default behavior.')
-
     create_environment(home_dir,
                        site_packages=options.system_site_packages,
                        clear=options.clear,
                        unzip_setuptools=options.unzip_setuptools,
-                       use_distribute=options.use_distribute,
                        prompt=options.prompt,
                        search_dirs=options.search_dirs,
-                       never_download=options.never_download)
+                       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)
 
 def call_subprocess(cmd, show_stdout=True,
                     filter_stdout=None, cwd=None,
                     raise_on_returncode=True, extra_env=None,
-                    remove_from_env=None):
+                    remove_from_env=None, stdin=None):
     cmd_parts = []
     for part in cmd:
         if len(part) > 45:
@@ -962,7 +747,9 @@ def call_subprocess(cmd, show_stdout=True,
         env = None
     try:
         proc = subprocess.Popen(
-            cmd, stderr=subprocess.STDOUT, stdin=None, stdout=stdout,
+            cmd, stderr=subprocess.STDOUT,
+            stdin=None if stdin is None else subprocess.PIPE,
+            stdout=stdout,
             cwd=cwd, env=env)
     except Exception:
         e = sys.exc_info()[1]
@@ -971,6 +758,10 @@ def call_subprocess(cmd, show_stdout=True,
         raise
     all_output = []
     if stdout is not None:
+        if stdin is not None:
+            proc.stdin.write(stdin)
+            proc.stdin.close()
+
         stdout = proc.stdout
         encoding = sys.getdefaultencoding()
         fs_encoding = sys.getfilesystemencoding()
@@ -994,7 +785,7 @@ def call_subprocess(cmd, show_stdout=True,
             else:
                 logger.info(line)
     else:
-        proc.communicate()
+        proc.communicate(stdin)
     proc.wait()
     if proc.returncode:
         if raise_on_returncode:
@@ -1009,10 +800,115 @@ def call_subprocess(cmd, show_stdout=True,
                 "Command %s had error code %s"
                 % (cmd_desc, proc.returncode))
 
+def filter_install_output(line):
+    if line.strip().startswith('running'):
+        return Logger.INFO
+    return Logger.DEBUG
+
+def find_wheels(projects, search_dirs):
+    """Find wheels from which we can import PROJECTS.
+
+    Scan through SEARCH_DIRS for a wheel for each PROJECT in turn. Return
+    a list of the first wheel found for each PROJECT
+    """
+
+    wheels = []
+
+    # Look through SEARCH_DIRS for the first suitable wheel. Don't bother
+    # about version checking here, as this is simply to get something we can
+    # then use to install the correct version.
+    for project in projects:
+        for dirname in search_dirs:
+            # This relies on only having "universal" wheels available.
+            # The pattern could be tightened to require -py2.py3-none-any.whl.
+            files = glob.glob(os.path.join(dirname, project + '-*.whl'))
+            if files:
+                wheels.append(os.path.abspath(files[0]))
+                break
+        else:
+            # We're out of luck, so quit with a suitable error
+            logger.fatal('Cannot find a wheel for %s' % (project,))
+
+    return wheels
+
+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)
+
+    # 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)
+
+    SCRIPT = textwrap.dedent("""
+        import sys
+        import pkgutil
+        import tempfile
+        import os
+
+        import pip
+
+        cert_data = pkgutil.get_data("pip._vendor.requests", "cacert.pem")
+        if cert_data is not None:
+            cert_file = tempfile.NamedTemporaryFile(delete=False)
+            cert_file.write(cert_data)
+            cert_file.close()
+        else:
+            cert_file = None
+
+        try:
+            args = ["install", "--ignore-installed"]
+            if cert_file is not None:
+                args += ["--cert", cert_file.name]
+            args += sys.argv[1:]
+
+            sys.exit(pip.main(args))
+        finally:
+            if cert_file is not None:
+                os.remove(cert_file.name)
+    """).encode("utf8")
+
+    cmd = [py_executable, '-'] + 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_USER": "0",
+    }
+
+    if not download:
+        env["PIP_NO_INDEX"] = "1"
+
+    try:
+        call_subprocess(cmd, show_stdout=False, extra_env=env, stdin=SCRIPT)
+    finally:
+        logger.indent -= 2
+        logger.end_progress()
+
 
 def create_environment(home_dir, site_packages=False, clear=False,
-                       unzip_setuptools=False, use_distribute=False,
-                       prompt=None, search_dirs=None, never_download=False):
+                       unzip_setuptools=False,
+                       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``.
 
@@ -1026,46 +922,67 @@ def create_environment(home_dir, site_packages=False, clear=False,
 
     py_executable = os.path.abspath(install_python(
         home_dir, lib_dir, inc_dir, bin_dir,
-        site_packages=site_packages, clear=clear))
+        site_packages=site_packages, clear=clear, symlink=symlink))
 
     install_distutils(home_dir)
 
-    # use_distribute also is True if VIRTUALENV_DISTRIBUTE env var is set
-    # we also check VIRTUALENV_USE_DISTRIBUTE for backwards compatibility
-    if use_distribute or os.environ.get('VIRTUALENV_USE_DISTRIBUTE'):
-        install_distribute(py_executable, unzip=unzip_setuptools,
-                           search_dirs=search_dirs, never_download=never_download)
-    else:
-        install_setuptools(py_executable, unzip=unzip_setuptools,
-                           search_dirs=search_dirs, never_download=never_download)
+    to_install = []
+
+    if not no_setuptools:
+        to_install.append('setuptools')
+
+    if not no_pip:
+        to_install.append('pip')
 
-    install_pip(py_executable, search_dirs=search_dirs, never_download=never_download)
+    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 sys.platform == 'win32':
+    if is_win:
         # Windows has lots of problems with executables with spaces in
         # the name; this function will remove them (using the ~1
         # format):
         mkdir(home_dir)
         if ' ' in home_dir:
+            import ctypes
+            GetShortPathName = ctypes.windll.kernel32.GetShortPathNameW
+            size = max(len(home_dir)+1, 256)
+            buf = ctypes.create_unicode_buffer(size)
             try:
-                import win32api
-            except ImportError:
+                u = unicode
+            except NameError:
+                u = str
+            ret = GetShortPathName(u(home_dir), buf, size)
+            if not ret:
                 print('Error: the path "%s" has a space in it' % home_dir)
-                print('To handle these kinds of paths, the win32api module must be installed:')
-                print('  http://sourceforge.net/projects/pywin32/')
+                print('We could not determine the short pathname for it.')
+                print('Exiting.')
                 sys.exit(3)
-            home_dir = win32api.GetShortPathName(home_dir)
+            home_dir = str(buf.value)
         lib_dir = join(home_dir, 'Lib')
         inc_dir = join(home_dir, 'Include')
         bin_dir = join(home_dir, 'Scripts')
-    elif is_jython:
+    if is_jython:
         lib_dir = join(home_dir, 'Lib')
         inc_dir = join(home_dir, 'Include')
         bin_dir = join(home_dir, 'bin')
@@ -1073,7 +990,7 @@ def path_locations(home_dir):
         lib_dir = home_dir
         inc_dir = join(home_dir, 'include')
         bin_dir = join(home_dir, 'bin')
-    else:
+    elif not is_win:
         lib_dir = join(home_dir, 'lib', py_version)
         inc_dir = join(home_dir, 'include', py_version + abiflags)
         bin_dir = join(home_dir, 'bin')
@@ -1083,27 +1000,44 @@ def path_locations(home_dir):
 def change_prefix(filename, dst_prefix):
     prefixes = [sys.prefix]
 
-    if sys.platform == "darwin":
+    if is_darwin:
         prefixes.extend((
             os.path.join("/Library/Python", sys.version[:3], "site-packages"),
             os.path.join(sys.prefix, "Extras", "lib", "python"),
-            os.path.join("~", "Library", "Python", sys.version[:3], "site-packages")))
+            os.path.join("~", "Library", "Python", sys.version[:3], "site-packages"),
+            # Python 2.6 no-frameworks
+            os.path.join("~", ".local", "lib","python", sys.version[:3], "site-packages"),
+            # System Python 2.7 on OSX Mountain Lion
+            os.path.join("~", "Library", "Python", sys.version[:3], "lib", "python", "site-packages")))
 
     if hasattr(sys, 'real_prefix'):
         prefixes.append(sys.real_prefix)
+    if hasattr(sys, 'base_prefix'):
+        prefixes.append(sys.base_prefix)
+    prefixes = list(map(os.path.expanduser, prefixes))
     prefixes = list(map(os.path.abspath, prefixes))
+    # Check longer prefixes first so we don't split in the middle of a filename
+    prefixes = sorted(prefixes, key=len, reverse=True)
     filename = os.path.abspath(filename)
+    # On Windows, make sure drive letter is uppercase
+    if is_win and filename[0] in 'abcdefghijklmnopqrstuvwxyz':
+        filename = filename[0].upper() + filename[1:]
+    for i, prefix in enumerate(prefixes):
+        if is_win and prefix[0] in 'abcdefghijklmnopqrstuvwxyz':
+            prefixes[i] = prefix[0].upper() + prefix[1:]
     for src_prefix in prefixes:
         if filename.startswith(src_prefix):
             _, relpath = filename.split(src_prefix, 1)
-            assert relpath[0] == os.sep
-            relpath = relpath[1:]
+            if src_prefix != os.sep: # sys.prefix == "/"
+                assert relpath[0] == os.sep
+                relpath = relpath[1:]
             return join(dst_prefix, relpath)
     assert False, "Filename %s does not start with any of these prefixes: %s" % \
         (filename, prefixes)
 
-def copy_required_modules(dst_prefix):
+def copy_required_modules(dst_prefix, symlink):
     import imp
+
     for modname in REQUIRED_MODULES:
         if modname in sys.builtin_module_names:
             logger.info("Ignoring built-in bootstrap module: %s" % modname)
@@ -1115,15 +1049,45 @@ def copy_required_modules(dst_prefix):
         else:
             if f is not None:
                 f.close()
-            dst_filename = change_prefix(filename, dst_prefix)
-            copyfile(filename, dst_filename)
+            # 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])
+                    copyfile(pyfile, dst_filename[:-1], symlink)
+
+def copy_tcltk(src, dest, symlink):
+    """ copy tcl/tk libraries on Windows (issue #93) """
+    for libversion in '8.5', '8.6':
+        for libname in 'tcl', 'tk':
+            srcdir = join(src, 'tcl', libname + libversion)
+            destdir = join(dest, 'tcl', libname + libversion)
+            # Only copy the dirs from the above combinations that exist
+            if os.path.exists(srcdir) and not os.path.exists(destdir):
+                copyfileordir(srcdir, destdir, symlink)
+
+
+def subst_path(prefix_path, prefix, home_dir):
+    prefix_path = os.path.normpath(prefix_path)
+    prefix = os.path.normpath(prefix)
+    home_dir = os.path.normpath(home_dir)
+    if not prefix_path.startswith(prefix):
+        logger.warn('Path not in prefix %r %r', prefix_path, prefix)
+        return
+    return prefix_path.replace(prefix, home_dir, 1)
 
 
-def install_python(home_dir, lib_dir, inc_dir, bin_dir, site_packages, clear):
+def install_python(home_dir, lib_dir, inc_dir, bin_dir, site_packages, clear, symlink=True):
     """Install just the base environment, no distutils patches etc"""
     if sys.executable.startswith(bin_dir):
         print('Please use the *system* python to run this script')
@@ -1138,15 +1102,17 @@ def install_python(home_dir, lib_dir, inc_dir, bin_dir, site_packages, clear):
     if hasattr(sys, 'real_prefix'):
         logger.notify('Using real prefix %r' % sys.real_prefix)
         prefix = sys.real_prefix
+    elif hasattr(sys, 'base_prefix'):
+        logger.notify('Using base prefix %r' % sys.base_prefix)
+        prefix = sys.base_prefix
     else:
         prefix = sys.prefix
     mkdir(lib_dir)
-    fix_lib64(lib_dir)
-    fix_local_scheme(home_dir)
+    fix_lib64(lib_dir, symlink)
     stdlib_dirs = [os.path.dirname(os.__file__)]
-    if sys.platform == 'win32':
+    if is_win:
         stdlib_dirs.append(join(os.path.dirname(stdlib_dirs[0]), 'DLLs'))
-    elif sys.platform == 'darwin':
+    elif is_darwin:
         stdlib_dirs.append(join(stdlib_dirs[0], 'site-packages'))
     if hasattr(os, 'symlink'):
         logger.info('Symlinking Python bootstrap modules')
@@ -1161,15 +1127,18 @@ def install_python(home_dir, lib_dir, inc_dir, bin_dir, site_packages, clear):
             for fn in os.listdir(stdlib_dir):
                 bn = os.path.splitext(fn)[0]
                 if fn != 'site-packages' and bn in REQUIRED_FILES:
-                    copyfile(join(stdlib_dir, fn), join(lib_dir, fn))
+                    copyfile(join(stdlib_dir, fn), join(lib_dir, fn), symlink)
         # ...and modules
-        copy_required_modules(home_dir)
+        copy_required_modules(home_dir, symlink)
     finally:
         logger.indent -= 2
+    # ...copy tcl/tk
+    if is_win:
+        copy_tcltk(prefix, home_dir, symlink)
     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')
@@ -1180,30 +1149,41 @@ def install_python(home_dir, lib_dir, inc_dir, bin_dir, site_packages, clear):
     site_packages_filename = join(site_dir, 'no-global-site-packages.txt')
     if not site_packages:
         writefile(site_packages_filename, '')
-    else:
-        if os.path.exists(site_packages_filename):
-            logger.info('Deleting %s' % site_packages_filename)
-            os.unlink(site_packages_filename)
 
     if is_pypy or is_win:
         stdinc_dir = join(prefix, 'include')
     else:
         stdinc_dir = join(prefix, 'include', py_version + abiflags)
     if os.path.exists(stdinc_dir):
-        copyfile(stdinc_dir, inc_dir)
+        copyfile(stdinc_dir, inc_dir, symlink)
     else:
         logger.debug('No include dir %s' % stdinc_dir)
 
+    platinc_dir = distutils.sysconfig.get_python_inc(plat_specific=1)
+    if platinc_dir != stdinc_dir:
+        platinc_dest = distutils.sysconfig.get_python_inc(
+            plat_specific=1, prefix=home_dir)
+        if platinc_dir == platinc_dest:
+            # Do platinc_dest manually due to a CPython bug;
+            # not http://bugs.python.org/issue3386 but a close cousin
+            platinc_dest = subst_path(platinc_dir, prefix, home_dir)
+        if platinc_dest:
+            # PyPy's stdinc_dir and prefix are relative to the original binary
+            # (traversing virtualenvs), whereas the platinc_dir is relative to
+            # the inner virtualenv and ignores the prefix argument.
+            # This seems more evolved than designed.
+            copyfile(platinc_dir, platinc_dest, symlink)
+
     # pypy never uses exec_prefix, just ignore it
     if sys.exec_prefix != prefix and not is_pypy:
-        if sys.platform == 'win32':
+        if is_win:
             exec_dir = join(sys.exec_prefix, 'lib')
         elif is_jython:
             exec_dir = join(sys.exec_prefix, 'Lib')
         else:
             exec_dir = join(sys.exec_prefix, 'lib', py_version)
         for fn in os.listdir(exec_dir):
-            copyfile(join(exec_dir, fn), join(lib_dir, fn))
+            copyfile(join(exec_dir, fn), join(lib_dir, fn), symlink)
 
     if is_jython:
         # Jython has either jython-dev.jar and javalib/ dir, or just
@@ -1211,7 +1191,7 @@ def install_python(home_dir, lib_dir, inc_dir, bin_dir, site_packages, clear):
         for name in 'jython-dev.jar', 'javalib', 'jython.jar':
             src = join(prefix, name)
             if os.path.exists(src):
-                copyfile(src, join(home_dir, name))
+                copyfile(src, join(home_dir, name), symlink)
         # XXX: registry should always exist after Jython 2.5rc1
         src = join(prefix, 'registry')
         if os.path.exists(src):
@@ -1222,6 +1202,10 @@ def install_python(home_dir, lib_dir, inc_dir, bin_dir, site_packages, clear):
     mkdir(bin_dir)
     py_executable = join(bin_dir, os.path.basename(sys.executable))
     if 'Python.framework' in prefix:
+        # OS X framework builds cause validation to break
+        # https://github.com/pypa/virtualenv/issues/322
+        if os.environ.get('__PYVENV_LAUNCHER__'):
+            del os.environ["__PYVENV_LAUNCHER__"]
         if re.search(r'/Python(?:-32|-64)*$', py_executable):
             # The name of the python executable is not quite what
             # we want, rename it.
@@ -1229,32 +1213,84 @@ def install_python(home_dir, lib_dir, inc_dir, bin_dir, site_packages, clear):
                     os.path.dirname(py_executable), 'python')
 
     logger.notify('New %s executable in %s', expected_exe, py_executable)
+    pcbuild_dir = os.path.dirname(sys.executable)
+    pyd_pth = os.path.join(lib_dir, 'site-packages', 'virtualenv_builddir_pyd.pth')
+    if is_win and os.path.exists(os.path.join(pcbuild_dir, 'build.bat')):
+        logger.notify('Detected python running from build directory %s', pcbuild_dir)
+        logger.notify('Writing .pth file linking to build directory for *.pyd files')
+        writefile(pyd_pth, pcbuild_dir)
+    else:
+        pcbuild_dir = None
+        if os.path.exists(pyd_pth):
+            logger.info('Deleting %s (not Windows env or not build directory python)' % pyd_pth)
+            os.unlink(pyd_pth)
+
     if sys.executable != py_executable:
         ## FIXME: could I just hard link?
         executable = sys.executable
-        if sys.platform == 'cygwin' and os.path.exists(executable + '.exe'):
-            # Cygwin misreports sys.executable sometimes
-            executable += '.exe'
-            py_executable += '.exe'
-            logger.info('Executable actually exists in %s' % executable)
         shutil.copyfile(executable, py_executable)
         make_exe(py_executable)
-        if sys.platform == 'win32' or sys.platform == 'cygwin':
+        if is_win or is_cygwin:
             pythonw = os.path.join(os.path.dirname(sys.executable), 'pythonw.exe')
             if os.path.exists(pythonw):
                 logger.info('Also created pythonw.exe')
                 shutil.copyfile(pythonw, os.path.join(os.path.dirname(py_executable), 'pythonw.exe'))
+            python_d = os.path.join(os.path.dirname(sys.executable), 'python_d.exe')
+            python_d_dest = os.path.join(os.path.dirname(py_executable), 'python_d.exe')
+            if os.path.exists(python_d):
+                logger.info('Also created python_d.exe')
+                shutil.copyfile(python_d, python_d_dest)
+            elif os.path.exists(python_d_dest):
+                logger.info('Removed python_d.exe as it is no longer at the source')
+                os.unlink(python_d_dest)
+            # we need to copy the DLL to enforce that windows will load the correct one.
+            # may not exist if we are cygwin.
+            py_executable_dll = 'python%s%s.dll' % (
+                sys.version_info[0], sys.version_info[1])
+            py_executable_dll_d = 'python%s%s_d.dll' % (
+                sys.version_info[0], sys.version_info[1])
+            pythondll = os.path.join(os.path.dirname(sys.executable), py_executable_dll)
+            pythondll_d = os.path.join(os.path.dirname(sys.executable), py_executable_dll_d)
+            pythondll_d_dest = os.path.join(os.path.dirname(py_executable), py_executable_dll_d)
+            if os.path.exists(pythondll):
+                logger.info('Also created %s' % py_executable_dll)
+                shutil.copyfile(pythondll, os.path.join(os.path.dirname(py_executable), py_executable_dll))
+            if os.path.exists(pythondll_d):
+                logger.info('Also created %s' % py_executable_dll_d)
+                shutil.copyfile(pythondll_d, pythondll_d_dest)
+            elif os.path.exists(pythondll_d_dest):
+                logger.info('Removed %s as the source does not exist' % pythondll_d_dest)
+                os.unlink(pythondll_d_dest)
         if is_pypy:
             # make a symlink python --> pypy-c
             python_executable = os.path.join(os.path.dirname(py_executable), 'python')
+            if sys.platform in ('win32', 'cygwin'):
+                python_executable += '.exe'
             logger.info('Also created executable %s' % python_executable)
-            copyfile(py_executable, python_executable)
+            copyfile(py_executable, python_executable, symlink)
+
+            if is_win:
+                for name in ['libexpat.dll', 'libpypy.dll', 'libpypy-c.dll',
+                            'libeay32.dll', 'ssleay32.dll', 'sqlite3.dll',
+                            'tcl85.dll', 'tk85.dll']:
+                    src = join(prefix, name)
+                    if os.path.exists(src):
+                        copyfile(src, join(bin_dir, name), symlink)
+
+                for d in sys.path:
+                    if d.endswith('lib_pypy'):
+                        break
+                else:
+                    logger.fatal('Could not find lib_pypy in sys.path')
+                    raise SystemExit(3)
+                logger.info('Copying lib_pypy')
+                copyfile(d, os.path.join(home_dir, 'lib_pypy'), symlink)
 
     if os.path.splitext(os.path.basename(py_executable))[0] != expected_exe:
         secondary_exe = os.path.join(os.path.dirname(py_executable),
                                      expected_exe)
         py_executable_ext = os.path.splitext(py_executable)[1]
-        if py_executable_ext == '.exe':
+        if py_executable_ext.lower() == '.exe':
             # python2.4 gives an extension of '.4' :P
             secondary_exe += py_executable_ext
         if os.path.exists(secondary_exe):
@@ -1265,16 +1301,19 @@ def install_python(home_dir, lib_dir, inc_dir, bin_dir, site_packages, clear):
             shutil.copyfile(sys.executable, secondary_exe)
             make_exe(secondary_exe)
 
-    if 'Python.framework' in prefix:
-        logger.debug('MacOSX Python framework detected')
-
-        # Make sure we use the the embedded interpreter inside
-        # the framework, even if sys.executable points to
-        # the stub executable in ${sys.prefix}/bin
-        # See http://groups.google.com/group/python-virtualenv/
-        #                              browse_thread/thread/17cab2f85da75951
-        original_python = os.path.join(
-            prefix, 'Resources/Python.app/Contents/MacOS/Python')
+    if '.framework' in prefix:
+        if 'Python.framework' in prefix:
+            logger.debug('MacOSX Python framework detected')
+            # Make sure we use the embedded interpreter inside
+            # the framework, even if sys.executable points to
+            # the stub executable in ${sys.prefix}/bin
+            # See http://groups.google.com/group/python-virtualenv/
+            #                              browse_thread/thread/17cab2f85da75951
+            original_python = os.path.join(
+                prefix, 'Resources/Python.app/Contents/MacOS/Python')
+        if 'EPD' in prefix:
+            logger.debug('EPD framework detected')
+            original_python = os.path.join(prefix, 'bin/python')
         shutil.copy(original_python, py_executable)
 
         # Copy the framework's dylib into the virtual
@@ -1285,53 +1324,55 @@ def install_python(home_dir, lib_dir, inc_dir, bin_dir, site_packages, clear):
             os.unlink(virtual_lib)
         copyfile(
             os.path.join(prefix, 'Python'),
-            virtual_lib)
+            virtual_lib,
+            symlink)
 
         # And then change the install_name of the copied python executable
         try:
-            call_subprocess(
-                ["install_name_tool", "-change",
-                 os.path.join(prefix, 'Python'),
-                 '@executable_path/../.Python',
-                 py_executable])
+            mach_o_change(py_executable,
+                          os.path.join(prefix, 'Python'),
+                          '@executable_path/../.Python')
         except:
-            logger.fatal(
-                "Could not call install_name_tool -- you must have Apple's development tools installed")
-            raise
-
-        # Some tools depend on pythonX.Y being present
-        py_executable_version = '%s.%s' % (
+            e = sys.exc_info()[1]
+            logger.warn("Could not call mach_o_change: %s. "
+                        "Trying to call install_name_tool instead." % e)
+            try:
+                call_subprocess(
+                    ["install_name_tool", "-change",
+                     os.path.join(prefix, 'Python'),
+                     '@executable_path/../.Python',
+                     py_executable])
+            except:
+                logger.fatal("Could not call install_name_tool -- you must "
+                             "have Apple's development tools installed")
+                raise
+
+    if not is_win:
+        # Ensure that 'python', 'pythonX' and 'pythonX.Y' all exist
+        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])
-        if not py_executable.endswith(py_executable_version):
-            # symlinking pythonX.Y > python
-            pth = py_executable + '%s.%s' % (
-                    sys.version_info[0], sys.version_info[1])
-            if os.path.exists(pth):
-                os.unlink(pth)
-            os.symlink('python', pth)
-        else:
-            # reverse symlinking python -> pythonX.Y (with --python)
-            pth = join(bin_dir, 'python')
-            if os.path.exists(pth):
-                os.unlink(pth)
-            os.symlink(os.path.basename(py_executable), pth)
-
-    if sys.platform == 'win32' and ' ' in py_executable:
-        # There's a bug with subprocess on Windows when using a first
-        # argument that has a space in it.  Instead we have to quote
-        # the value:
-        py_executable = '"%s"' % py_executable
-    cmd = [py_executable, '-c', """
-import sys
-prefix = sys.prefix
-if sys.version_info[0] == 3:
-    prefix = prefix.encode('utf8')
-if hasattr(sys.stdout, 'detach'):
-    sys.stdout = sys.stdout.detach()
-elif hasattr(sys.stdout, 'buffer'):
-    sys.stdout = sys.stdout.buffer
-sys.stdout.write(prefix)
-"""]
+        py_exe_no_version = 'python'
+        required_symlinks = [ py_exe_no_version, py_exe_version_major,
+                         py_exe_version_major_minor ]
+
+        py_executable_base = os.path.basename(py_executable)
+
+        if py_executable_base in required_symlinks:
+            # Don't try to symlink to yourself.
+            required_symlinks.remove(py_executable_base)
+
+        for pth in required_symlinks:
+            full_pth = join(bin_dir, pth)
+            if os.path.exists(full_pth):
+                os.unlink(full_pth)
+            if symlink:
+                os.symlink(py_executable_base, full_pth)
+            else:
+                copyfile(py_executable, full_pth, symlink)
+
+    cmd = [py_executable, '-c', 'import sys;out=sys.stdout;'
+        'getattr(out, "buffer", out).write(sys.prefix.encode("utf-8"))']
     logger.info('Testing executable with %s %s "%s"' % tuple(cmd))
     try:
         proc = subprocess.Popen(cmd,
@@ -1343,7 +1384,7 @@ sys.stdout.write(prefix)
             logger.fatal('ERROR: The executable %s could not be run: %s' % (py_executable, e))
             sys.exit(100)
         else:
-          raise e
+            raise e
 
     proc_stdout = proc_stdout.strip().decode("utf-8")
     proc_stdout = os.path.normcase(os.path.abspath(proc_stdout))
@@ -1358,9 +1399,13 @@ sys.stdout.write(prefix)
             % (proc_stdout, norm_home_dir))
         logger.fatal(
             'ERROR: virtualenv is not compatible with this system or executable')
-        if sys.platform == 'win32':
+        if is_win:
             logger.fatal(
-                'Note: some Windows users have reported this error when they installed Python for "Only this user".  The problem may be resolvable if you install Python "For all users".  (See https://bugs.launchpad.net/virtualenv/+bug/352844)')
+                'Note: some Windows users have reported this error when they '
+                'installed Python for "Only this user" or have multiple '
+                'versions of Python installed. Copying the appropriate '
+                'PythonXX.dll to the virtualenv Scripts/ directory may fix '
+                'this problem.')
         sys.exit(100)
     else:
         logger.info('Got sys.prefix result: %r' % proc_stdout)
@@ -1370,14 +1415,34 @@ sys.stdout.write(prefix)
         logger.notify('Please make sure you remove any previous custom paths from '
                       'your %s file.' % pydistutils)
     ## FIXME: really this should be calculated earlier
+
+    fix_local_scheme(home_dir, symlink)
+
+    if site_packages:
+        if os.path.exists(site_packages_filename):
+            logger.info('Deleting %s' % site_packages_filename)
+            os.unlink(site_packages_filename)
+
     return py_executable
 
+
 def install_activate(home_dir, bin_dir, prompt=None):
-    if sys.platform == 'win32' or is_jython and os._name == 'nt':
-        files = {'activate.bat': ACTIVATE_BAT,
-                 'deactivate.bat': DEACTIVATE_BAT}
-        if os.environ.get('OS') == 'Windows_NT' and os.environ.get('OSTYPE') == 'cygwin':
-            files['activate'] = ACTIVATE_SH
+    if is_win or is_jython and os._name == 'nt':
+        files = {
+            'activate.bat': ACTIVATE_BAT,
+            'deactivate.bat': DEACTIVATE_BAT,
+            'activate.ps1': ACTIVATE_PS,
+        }
+
+        # MSYS needs paths of the form /c/path/to/file
+        drive, tail = os.path.splitdrive(home_dir.replace(os.sep, '/'))
+        home_dir_msys = (drive and "/%s%s" or "%s%s") % (drive[:1], tail)
+
+        # Run-time conditional enables (basic) Cygwin compatibility
+        home_dir_sh = ("""$(if [ "$OSTYPE" "==" "cygwin" ]; then cygpath -u '%s'; else echo '%s'; fi;)""" %
+                       (home_dir, home_dir_msys))
+        files['activate'] = ACTIVATE_SH.replace('__VIRTUAL_ENV__', home_dir_sh)
+
     else:
         files = {'activate': ACTIVATE_SH}
 
@@ -1388,10 +1453,11 @@ def install_activate(home_dir, bin_dir, prompt=None):
         # same for csh/tcsh support...
         files['activate.csh'] = ACTIVATE_CSH
 
+    files['activate_this.py'] = ACTIVATE_THIS
 
+    install_files(home_dir, bin_dir, prompt, files)
 
-    files['activate_this.py'] = ACTIVATE_THIS
-    home_dir = os.path.abspath(home_dir)
+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)
@@ -1403,6 +1469,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)
@@ -1414,7 +1489,7 @@ def install_distutils(home_dir):
     writefile(os.path.join(distutils_path, '__init__.py'), DISTUTILS_INIT)
     writefile(os.path.join(distutils_path, 'distutils.cfg'), DISTUTILS_CFG, overwrite=False)
 
-def fix_local_scheme(home_dir):
+def fix_local_scheme(home_dir, symlink=True):
     """
     Platforms that use the "posix_local" install scheme (like Ubuntu with
     Python 2.7) need to be given an additional "local" location, sigh.
@@ -1427,45 +1502,74 @@ def fix_local_scheme(home_dir):
         if sysconfig._get_default_scheme() == 'posix_local':
             local_path = os.path.join(home_dir, 'local')
             if not os.path.exists(local_path):
-                os.symlink(os.path.abspath(home_dir), local_path)
-
-def fix_lib64(lib_dir):
+                os.mkdir(local_path)
+                for subdir_name in os.listdir(home_dir):
+                    if subdir_name == 'local':
+                        continue
+                    copyfile(os.path.abspath(os.path.join(home_dir, subdir_name)), \
+                                                            os.path.join(local_path, subdir_name), symlink)
+
+def fix_lib64(lib_dir, symlink=True):
     """
     Some platforms (particularly Gentoo on x64) put things in lib64/pythonX.Y
     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]:
-        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)
-        assert os.path.basename(lib_parent) == 'lib', (
-            "Unexpected parent dir: %r" % lib_parent)
-        copyfile(lib_parent, os.path.join(os.path.dirname(lib_parent), 'lib64'))
+    # 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')
+
+    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):
     """
     If the executable given isn't an absolute path, search $PATH for the interpreter
     """
+    # If the "executable" is a version number, get the installed executable for
+    # that version
+    orig_exe = exe
+    python_versions = get_installed_pythons()
+    if exe in python_versions:
+        exe = python_versions[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))
+        logger.fatal('The path %s (from --python=%s) does not exist' % (exe, orig_exe))
         raise SystemExit(3)
     if not is_executable(exe):
-        logger.fatal('The executable %s (from --python=%s) is not executable' % (exe, exe))
+        logger.fatal('The path %s (from --python=%s) is not an executable file' % (exe, orig_exe))
         raise SystemExit(3)
     return exe
 
 def is_executable(exe):
     """Checks a file is executable"""
-    return os.access(exe, os.X_OK)
+    return os.path.isfile(exe) and os.access(exe, os.X_OK)
 
 ############################################################
 ## Relocating the environment:
@@ -1481,37 +1585,49 @@ def make_environment_relocatable(home_dir):
         logger.fatal(
             'The environment doesn\'t have a file %s -- please re-run virtualenv '
             'on this environment to update it' % activate_this)
-    fixup_scripts(home_dir)
+    fixup_scripts(home_dir, bin_dir)
     fixup_pth_and_egg_link(home_dir)
     ## FIXME: need to fix up distutils.cfg
 
 OK_ABS_SCRIPTS = ['python', 'python%s' % sys.version[:3],
-                  'activate', 'activate.bat', 'activate_this.py']
+                  'activate', 'activate.bat', 'activate_this.py',
+                  'activate.fish', 'activate.csh']
+
+def fixup_scripts(home_dir, bin_dir):
+    if is_win:
+        new_shebang_args = (
+            '%s /c' % os.path.normcase(os.environ.get('COMSPEC', 'cmd.exe')),
+            '', '.exe')
+    else:
+        new_shebang_args = ('/usr/bin/env', sys.version[:3], '')
 
-def fixup_scripts(home_dir):
     # This is what we expect at the top of scripts:
-    shebang = '#!%s/bin/python' % os.path.normcase(os.path.abspath(home_dir))
+    shebang = '#!%s' % os.path.normcase(os.path.join(
+        os.path.abspath(bin_dir), 'python%s' % new_shebang_args[2]))
     # This is what we'll put:
-    new_shebang = '#!/usr/bin/env python%s' % sys.version[:3]
-    activate = "import os; activate_this=os.path.join(os.path.dirname(__file__), 'activate_this.py'); execfile(activate_this, dict(__file__=activate_this)); del os, activate_this"
-    if sys.platform == 'win32':
-        bin_suffix = 'Scripts'
-    else:
-        bin_suffix = 'bin'
-    bin_dir = os.path.join(home_dir, bin_suffix)
-    home_dir, lib_dir, inc_dir, bin_dir = path_locations(home_dir)
+    new_shebang = '#!%s python%s%s' % new_shebang_args
+
     for filename in os.listdir(bin_dir):
         filename = os.path.join(bin_dir, filename)
         if not os.path.isfile(filename):
             # ignore subdirs, e.g. .svn ones.
             continue
-        f = open(filename, 'rb')
-        lines = f.readlines()
-        f.close()
+        lines = None
+        with open(filename, 'rb') as f:
+            try:
+                lines = f.read().decode('utf-8').splitlines()
+            except UnicodeDecodeError:
+                # This is probably a binary program instead
+                # of a script, so just ignore it.
+                continue
         if not lines:
             logger.warn('Script %s is an empty file' % filename)
             continue
-        if not lines[0].strip().startswith(shebang):
+
+        old_shebang = lines[0].strip()
+        old_shebang = old_shebang[0:2] + os.path.normcase(old_shebang[2:])
+
+        if not old_shebang.startswith(shebang):
             if os.path.basename(filename) in OK_ABS_SCRIPTS:
                 logger.debug('Cannot make script %s relative' % filename)
             elif lines[0].strip() == new_shebang:
@@ -1521,10 +1637,25 @@ def fixup_scripts(home_dir):
                             % (filename, shebang))
             continue
         logger.notify('Making script %s relative' % filename)
-        lines = [new_shebang+'\n', activate+'\n'] + lines[1:]
-        f = open(filename, 'wb')
-        f.writelines(lines)
-        f.close()
+        script = relative_script([new_shebang] + lines[1:])
+        with open(filename, 'wb') as f:
+            f.write('\n'.join(script).encode('utf-8'))
+
+
+def relative_script(lines):
+    "Return a script that'll work in a relocatable environment."
+    activate = "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"
+    # Find the last future statement in the script. If we insert the activation
+    # line before a future statement, Python will raise a SyntaxError.
+    activate_at = None
+    for idx, line in reversed(list(enumerate(lines))):
+        if line.split()[:3] == ['from', '__future__', 'import']:
+            activate_at = idx + 1
+            break
+    if activate_at is None:
+        # Activate after the shebang.
+        activate_at = 1
+    return lines[:activate_at] + ['', activate, ''] + lines[activate_at:]
 
 def fixup_pth_and_egg_link(home_dir, sys_path=None):
     """Makes .pth and .egg-link files use relative paths"""
@@ -1556,9 +1687,8 @@ def fixup_pth_and_egg_link(home_dir, sys_path=None):
 def fixup_pth_file(filename):
     lines = []
     prev_lines = []
-    f = open(filename)
-    prev_lines = f.readlines()
-    f.close()
+    with open(filename) as f:
+        prev_lines = f.readlines()
     for line in prev_lines:
         line = line.strip()
         if (not line or line.startswith('#') or line.startswith('import ')
@@ -1573,22 +1703,19 @@ def fixup_pth_file(filename):
         logger.info('No changes to .pth file %s' % filename)
         return
     logger.notify('Making paths in .pth file %s relative' % filename)
-    f = open(filename, 'w')
-    f.write('\n'.join(lines) + '\n')
-    f.close()
+    with open(filename, 'w') as f:
+        f.write('\n'.join(lines) + '\n')
 
 def fixup_egg_link(filename):
-    f = open(filename)
-    link = f.read().strip()
-    f.close()
+    with open(filename) as f:
+        link = f.readline().strip()
     if os.path.abspath(link) != link:
         logger.debug('Link in %s already relative' % filename)
         return
     new_link = make_relative_path(filename, link)
     logger.notify('Rewriting link %s in %s as %s' % (link, filename, new_link))
-    f = open(filename, 'w')
-    f.write(new_link)
-    f.close()
+    with open(filename, 'w') as f:
+        f.write(new_link)
 
 def make_relative_path(source, dest, dest_is_directory=True):
     """
@@ -1663,17 +1790,16 @@ def create_bootstrap_script(extra_text, python_version=''):
         This example immediately installs a package, and runs a setup
         script from that package.
 
-    If you provide something like ``python_version='2.4'`` then the
-    script will start with ``#!/usr/bin/env python2.4`` instead of
+    If you provide something like ``python_version='2.5'`` then the
+    script will start with ``#!/usr/bin/env python2.5`` instead of
     ``#!/usr/bin/env python``.  You can use this when the script must
     be run with a particular Python version.
     """
     filename = __file__
     if filename.endswith('.pyc'):
         filename = filename[:-1]
-    f = open(filename, 'rb')
-    content = f.read()
-    f.close()
+    with codecs.open(filename, 'r', encoding='utf-8') as f:
+        content = f.read()
     py_exe = 'python%s' % python_version
     content = (('#!/usr/bin/env %s\n' % py_exe)
                + '## WARNING: This file is generated\n'
@@ -1688,390 +1814,333 @@ def convert(s):
 
 ##file site.py
 SITE_PY = convert("""
-eJzVPP1z2zaWv/OvwMqTIZXKdD66nR2n7o2TOK3v3MTbpLO5dT06SoIk1hTJEqQV7c3d337vAwAB
-kvLHdvvDaTKxRAIPDw/vGw8YjUanZSnzhdgUiyaTQsmkmq9FmdRrJZZFJep1Wi0Oy6Sqd/B0fpOs
-pBJ1IdROxdgqDoKnv/MTPBWf1qkyKMC3pKmLTVKn8yTLdiLdlEVVy4VYNFWar0Sap3WaZOk/oEWR
-x+Lp78cgOM8FzDxLZSVuZaUArhLFUlzu6nWRi6gpcc7P4z8nL8cToeZVWtbQoNI4A0XWSR3kUi4A
-TWjZKCBlWstDVcp5ukzntuG2aLKFKLNkLsV//RdPjZqGYaCKjdyuZSVFDsgATAmwSsQDvqaVmBcL
-GQvxWs4THICft8QKGNoE10whGfNCZEW+gjnlci6VSqqdiGZNTYAIZbEoAKcUMKjTLAu2RXWjxrCk
-tB5beCQSZg9/MsweME8cv885gOOHPPg5T79MGDZwD4Kr18w2lVymX0SCYOGn/CLnU/0sSpdikS6X
-QIO8HmOTgBFQIktnRyUtx7d6hb47IqwsVyYwhkSUuTG/pB5xcF6LJFPAtk2JNFKE+Vs5S5McqJHf
-wnAAEUgaDI2zSFVtx6HZiQIAVLiONUjJRolok6Q5MOuPyZz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9NGKhu
+eJx9Ul9LhEAQfxf8DoOclI/dYyFkaCmcq4gZQTBUrincuZFbff12T133TM+nnd35/Zvxlr7XDFhV
+mUZHOVhFlOWP3g4DUriIWoVomYZpNBWUtGpaWgImO191pFkSpzlcmgaI70jVX7n2Qp8tuByg+46O
+CMHbMq64T+nmlJt082D1T44muCDk2prgEHF4mdI9RaS/QwSt3zSyIAaftRccvqVTBziD1x/WlPD5
+xd729NDBb8Nr4DU9QNMKsJeH9pkhPedhQsIkDuCDCa6A+NF9IevVFAohkqizdHetg/tkWvPoftWJ
+MCqnOxv7/x7Np6yv9P2Ker5dmX8yNyCkkWnbZy3N5LarczlqL8htx2EM9rQ/2H5BvIsIEi8OEG8U
++g8CsNTr
 """)
 
 ##file deactivate.bat
 DEACTIVATE_BAT = convert("""
-eJxzSE3OyFfIT0vj4spMU0hJTcvMS01RiPf3cYkP8wwKCXX0iQ8I8vcNCFHQ4FIAguLUEgWIgK0q
-FlWqXJpcICVYpGzx2BAZ4uHv5+Hv6wq1BWINXBTdKriEKkI1DhW2QAfhttcxxANiFZCBbglQSJUL
-i2dASrm4rFz9XLgAwJNbyQ==
+eJyFkN0KgkAUhO8F32EQpHqFQEjQUPAPMaErqVxzId3IrV6/XST/UDx3c86c4WMO5FYysKJQFVVp
+CEfqxsnJ9DI7SA25i20fFqs3HO+GYLsDZ7h8GM3xfLHrg1QNvpSX4CWpQGvokZk4uqrQAjXjyElB
+a5IjCz0r+2dHcehHCe5MZNmB5R7TdqMqECMptHZh6DN/utb7Zs6Cej8OXYE5J04YOKFvD4GkHuJ0
+pilSd1jG6n87tDZ+BUwUOepI6CGSkFMYWf0ihvT33Qj1A+tCkSI=
+""")
+
+##file activate.ps1
+ACTIVATE_PS = convert("""
+eJylWdmO41hyfW+g/0FTU7C7IXeJIqmtB/3AnZRIStxF2kaBm7gv4ipyMF/mB3+Sf8GXVGVl1tLT
+43ECSqR4b5wbETeWE8z/+a///vNCDaN6cYtSf5G1dbNw/IVXNIu6aC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ebabe
+BIG_ENDIAN = '>'
+LITTLE_ENDIAN = '<'
+LC_LOAD_DYLIB = 0xc
+maxint = majver == 3 and getattr(sys, 'maxsize') or getattr(sys, 'maxint')
+
+
+class fileview(object):
+    """
+    A proxy for file-like objects that exposes a given view of a file.
+    Modified from macholib.
+    """
+
+    def __init__(self, fileobj, start=0, size=maxint):
+        if isinstance(fileobj, fileview):
+            self._fileobj = fileobj._fileobj
+        else:
+            self._fileobj = fileobj
+        self._start = start
+        self._end = start + size
+        self._pos = 0
+
+    def __repr__(self):
+        return '<fileview [%d, %d] %r>' % (
+            self._start, self._end, self._fileobj)
+
+    def tell(self):
+        return self._pos
+
+    def _checkwindow(self, seekto, op):
+        if not (self._start <= seekto <= self._end):
+            raise IOError("%s to offset %d is outside window [%d, %d]" % (
+                op, seekto, self._start, self._end))
+
+    def seek(self, offset, whence=0):
+        seekto = offset
+        if whence == os.SEEK_SET:
+            seekto += self._start
+        elif whence == os.SEEK_CUR:
+            seekto += self._start + self._pos
+        elif whence == os.SEEK_END:
+            seekto += self._end
+        else:
+            raise IOError("Invalid whence argument to seek: %r" % (whence,))
+        self._checkwindow(seekto, 'seek')
+        self._fileobj.seek(seekto)
+        self._pos = seekto - self._start
+
+    def write(self, bytes):
+        here = self._start + self._pos
+        self._checkwindow(here, 'write')
+        self._checkwindow(here + len(bytes), 'write')
+        self._fileobj.seek(here, os.SEEK_SET)
+        self._fileobj.write(bytes)
+        self._pos += len(bytes)
+
+    def read(self, size=maxint):
+        assert size >= 0
+        here = self._start + self._pos
+        self._checkwindow(here, 'read')
+        size = min(size, self._end - here)
+        self._fileobj.seek(here, os.SEEK_SET)
+        bytes = self._fileobj.read(size)
+        self._pos += len(bytes)
+        return bytes
+
+
+def read_data(file, endian, num=1):
+    """
+    Read a given number of 32-bits unsigned integers from the given file
+    with the given endianness.
+    """
+    res = struct.unpack(endian + 'L' * num, file.read(num * 4))
+    if len(res) == 1:
+        return res[0]
+    return res
+
+
+def mach_o_change(path, what, value):
+    """
+    Replace a given name (what) in any LC_LOAD_DYLIB command found in
+    the given binary with a new name (value), provided it's shorter.
+    """
+
+    def do_macho(file, bits, endian):
+        # Read Mach-O header (the magic number is assumed read by the caller)
+        cputype, cpusubtype, filetype, ncmds, sizeofcmds, flags = read_data(file, endian, 6)
+        # 64-bits header has one more field.
+        if bits == 64:
+            read_data(file, endian)
+        # The header is followed by ncmds commands
+        for n in range(ncmds):
+            where = file.tell()
+            # Read command header
+            cmd, cmdsize = read_data(file, endian, 2)
+            if cmd == LC_LOAD_DYLIB:
+                # The first data field in LC_LOAD_DYLIB commands is the
+                # offset of the name, starting from the beginning of the
+                # command.
+                name_offset = read_data(file, endian)
+                file.seek(where + name_offset, os.SEEK_SET)
+                # Read the NUL terminated string
+                load = file.read(cmdsize - name_offset).decode()
+                load = load[:load.index('\0')]
+                # If the string is what is being replaced, overwrite it.
+                if load == what:
+                    file.seek(where + name_offset, os.SEEK_SET)
+                    file.write(value.encode() + '\0'.encode())
+            # Seek to the next command
+            file.seek(where + cmdsize, os.SEEK_SET)
+
+    def do_file(file, offset=0, size=maxint):
+        file = fileview(file, offset, size)
+        # Read magic number
+        magic = read_data(file, BIG_ENDIAN)
+        if magic == FAT_MAGIC:
+            # Fat binaries contain nfat_arch Mach-O binaries
+            nfat_arch = read_data(file, BIG_ENDIAN)
+            for n in range(nfat_arch):
+                # Read arch header
+                cputype, cpusubtype, offset, size, align = read_data(file, BIG_ENDIAN, 5)
+                do_file(file, offset, size)
+        elif magic == MH_MAGIC:
+            do_macho(file, 32, BIG_ENDIAN)
+        elif magic == MH_CIGAM:
+            do_macho(file, 32, LITTLE_ENDIAN)
+        elif magic == MH_MAGIC_64:
+            do_macho(file, 64, BIG_ENDIAN)
+        elif magic == MH_CIGAM_64:
+            do_macho(file, 64, LITTLE_ENDIAN)
+
+    assert(len(what) >= len(value))
+
+    with open(path, 'r+b') as f:
+        do_file(f)
+
+
 if __name__ == '__main__':
     main()
 
-## TODO:
-## Copy python.exe.manifest
-## Monkeypatch distutils.sysconfig
+# TODO:
+# Copy python.exe.manifest
+# Monkeypatch distutils.sysconfig
diff --git a/misc/virtualenv/virtualenv_support/activate.bat b/misc/virtualenv/virtualenv_support/activate.bat
deleted file mode 100644 (file)
index 1b06941..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-@echo off\r
-set VIRTUAL_ENV=__VIRTUAL_ENV__\r
-\r
-if not defined PROMPT (\r
-    set PROMPT=$P$G\r
-)\r
-\r
-if defined _OLD_VIRTUAL_PROMPT (\r
-    set PROMPT=%_OLD_VIRTUAL_PROMPT%\r
-)\r
-\r
-if defined _OLD_VIRTUAL_PYTHONHOME (\r
-     set PYTHONHOME=%_OLD_VIRTUAL_PYTHONHOME%\r
-)\r
-\r
-set _OLD_VIRTUAL_PROMPT=%PROMPT%\r
-set PROMPT=__VIRTUAL_WINPROMPT__ %PROMPT%\r
-\r
-if defined PYTHONHOME (\r
-     set _OLD_VIRTUAL_PYTHONHOME=%PYTHONHOME%\r
-     set PYTHONHOME=\r
-)\r
-\r
-if defined _OLD_VIRTUAL_PATH set PATH=%_OLD_VIRTUAL_PATH%; goto SKIPPATH\r
-\r
-set _OLD_VIRTUAL_PATH=%PATH%\r
-\r
-:SKIPPATH\r
-set PATH=%VIRTUAL_ENV%\__BIN_NAME__;%PATH%\r
-\r
-:END\r
diff --git a/misc/virtualenv/virtualenv_support/activate.csh b/misc/virtualenv/virtualenv_support/activate.csh
deleted file mode 100644 (file)
index 20fe95d..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-# This file must be used with "source bin/activate.csh" *from csh*.
-# You cannot run it directly.
-# Created by Davide Di Blasi <davidedb@gmail.com>.
-
-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'
-
-# Unset irrelavent variables.
-deactivate nondestructive
-
-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__"
-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
-endif
-set prompt = "[$env_name] $prompt"
-unset env_name
-
-rehash
-
diff --git a/misc/virtualenv/virtualenv_support/activate.fish b/misc/virtualenv/virtualenv_support/activate.fish
deleted file mode 100644 (file)
index fcb31d8..0000000
+++ /dev/null
@@ -1,79 +0,0 @@
-# This file must be used with ". bin/activate.fish" *from fish* (http://fishshell.org)
-# you cannot run it directly
-
-function deactivate  -d "Exit virtualenv and return to normal shell environment"
-    # reset old environment variables
-    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"
-        functions -e fish_prompt
-        set -e _OLD_FISH_PROMPT_OVERRIDE
-    end
-
-    set -e VIRTUAL_ENV
-    if test "$argv[1]" != "nondestructive"
-        # Self destruct!
-        functions -e deactivate
-    end
-end
-
-# unset irrelavent variables
-deactivate nondestructive
-
-set -gx VIRTUAL_ENV "__VIRTUAL_ENV__"
-
-set -gx _OLD_VIRTUAL_PATH $PATH
-set -gx PATH "$VIRTUAL_ENV/__BIN_NAME__" $PATH
-
-# unset PYTHONHOME if set
-if set -q PYTHONHOME
-    set -gx _OLD_VIRTUAL_PYTHONHOME $PYTHONHOME
-    set -e PYTHONHOME
-end
-
-if test -z "$VIRTUAL_ENV_DISABLE_PROMPT"
-    # fish shell uses a function, instead of env vars,
-    # to produce the prompt. Overriding the existing function is easy.
-    # However, adding to the current prompt, instead of clobbering it,
-    # is a little more work.
-    set -l oldpromptfile (tempfile)
-    if test $status
-        # save the current fish_prompt function...
-        echo "function _old_fish_prompt" >> $oldpromptfile
-        echo -n \# >> $oldpromptfile
-        functions fish_prompt >> $oldpromptfile
-        # we've made the "_old_fish_prompt" file, source it.
-        . $oldpromptfile
-        rm -f $oldpromptfile
-        
-        if test -n "__VIRTUAL_PROMPT__"
-            # We've been given us a prompt override.
-            # 
-            # FIXME: Unsure how to handle this *safely*. We could just eval()
-            #   whatever is given, but the risk is a bit much.
-            echo "activate.fish: Alternative prompt prefix is not supported under fish-shell." 1>&2
-            echo "activate.fish: Alter the fish_prompt in this file as needed." 1>&2
-        end        
-        
-        # with the original prompt function renamed, we can override with our own.
-        function fish_prompt                
-            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 %s" (set_color -b blue white) (basename (dirname "$VIRTUAL_ENV")) (set_color normal) (_old_fish_prompt)
-            else
-                printf "%s(%s)%s%s" (set_color -b blue white) (basename "$VIRTUAL_ENV") (set_color normal) (_old_fish_prompt)
-            end
-        end 
-        set -gx _OLD_FISH_PROMPT_OVERRIDE "$VIRTUAL_ENV"
-    end
-end
-
diff --git a/misc/virtualenv/virtualenv_support/activate.sh b/misc/virtualenv/virtualenv_support/activate.sh
deleted file mode 100644 (file)
index 45458c6..0000000
+++ /dev/null
@@ -1,76 +0,0 @@
-# This file must be used with "source bin/activate" *from bash*
-# you cannot run it directly
-
-deactivate () {
-    # reset old environment variables
-    if [ -n "$_OLD_VIRTUAL_PATH" ] ; then
-        PATH="$_OLD_VIRTUAL_PATH"
-        export PATH
-        unset _OLD_VIRTUAL_PATH
-    fi
-    if [ -n "$_OLD_VIRTUAL_PYTHONHOME" ] ; then
-        PYTHONHOME="$_OLD_VIRTUAL_PYTHONHOME"
-        export PYTHONHOME
-        unset _OLD_VIRTUAL_PYTHONHOME
-    fi
-
-    # 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
-        hash -r
-    fi
-
-    if [ -n "$_OLD_VIRTUAL_PS1" ] ; then
-        PS1="$_OLD_VIRTUAL_PS1"
-        export PS1
-        unset _OLD_VIRTUAL_PS1
-    fi
-
-    unset VIRTUAL_ENV
-    if [ ! "$1" = "nondestructive" ] ; then
-    # Self destruct!
-        unset -f deactivate
-    fi
-}
-
-# unset irrelavent variables
-deactivate nondestructive
-
-VIRTUAL_ENV="__VIRTUAL_ENV__"
-export VIRTUAL_ENV
-
-_OLD_VIRTUAL_PATH="$PATH"
-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
-    _OLD_VIRTUAL_PYTHONHOME="$PYTHONHOME"
-    unset PYTHONHOME
-fi
-
-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
-    fi
-    export PS1
-fi
-
-# 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
-    hash -r
-fi
diff --git a/misc/virtualenv/virtualenv_support/argparse-1.4.0-py2.py3-none-any.whl b/misc/virtualenv/virtualenv_support/argparse-1.4.0-py2.py3-none-any.whl
new file mode 100644 (file)
index 0000000..dfef51d
Binary files /dev/null and b/misc/virtualenv/virtualenv_support/argparse-1.4.0-py2.py3-none-any.whl differ
diff --git a/misc/virtualenv/virtualenv_support/deactivate.bat b/misc/virtualenv/virtualenv_support/deactivate.bat
deleted file mode 100644 (file)
index a575a94..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-@echo off
-
-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
diff --git a/misc/virtualenv/virtualenv_support/distribute-0.6.24.tar.gz b/misc/virtualenv/virtualenv_support/distribute-0.6.24.tar.gz
deleted file mode 100644 (file)
index 654fb50..0000000
Binary files a/misc/virtualenv/virtualenv_support/distribute-0.6.24.tar.gz and /dev/null differ
diff --git a/misc/virtualenv/virtualenv_support/distutils.cfg b/misc/virtualenv/virtualenv_support/distutils.cfg
deleted file mode 100644 (file)
index 1af230e..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-# This is a config file local to this virtualenv installation
-# You may include options that will be used by all distutils commands,
-# and by easy_install.  For instance:
-#
-#   [easy_install]
-#   find_links = http://mylocalsite
diff --git a/misc/virtualenv/virtualenv_support/pip-1.0.2.tar.gz b/misc/virtualenv/virtualenv_support/pip-1.0.2.tar.gz
deleted file mode 100644 (file)
index 94d7b66..0000000
Binary files a/misc/virtualenv/virtualenv_support/pip-1.0.2.tar.gz and /dev/null differ
diff --git a/misc/virtualenv/virtualenv_support/pip-9.0.1-py2.py3-none-any.whl b/misc/virtualenv/virtualenv_support/pip-9.0.1-py2.py3-none-any.whl
new file mode 100644 (file)
index 0000000..4b8ecc6
Binary files /dev/null and b/misc/virtualenv/virtualenv_support/pip-9.0.1-py2.py3-none-any.whl differ
diff --git a/misc/virtualenv/virtualenv_support/setuptools-0.6c11-py2.4.egg b/misc/virtualenv/virtualenv_support/setuptools-0.6c11-py2.4.egg
deleted file mode 100644 (file)
index b2c1592..0000000
Binary files a/misc/virtualenv/virtualenv_support/setuptools-0.6c11-py2.4.egg and /dev/null differ
diff --git a/misc/virtualenv/virtualenv_support/setuptools-0.6c11-py2.5.egg b/misc/virtualenv/virtualenv_support/setuptools-0.6c11-py2.5.egg
deleted file mode 100644 (file)
index b004539..0000000
Binary files a/misc/virtualenv/virtualenv_support/setuptools-0.6c11-py2.5.egg and /dev/null differ
diff --git a/misc/virtualenv/virtualenv_support/setuptools-0.6c11-py2.6.egg b/misc/virtualenv/virtualenv_support/setuptools-0.6c11-py2.6.egg
deleted file mode 100644 (file)
index 3c72d15..0000000
Binary files a/misc/virtualenv/virtualenv_support/setuptools-0.6c11-py2.6.egg and /dev/null differ
diff --git a/misc/virtualenv/virtualenv_support/setuptools-0.6c11-py2.7.egg b/misc/virtualenv/virtualenv_support/setuptools-0.6c11-py2.7.egg
deleted file mode 100644 (file)
index 8a51424..0000000
Binary files a/misc/virtualenv/virtualenv_support/setuptools-0.6c11-py2.7.egg and /dev/null differ
diff --git a/misc/virtualenv/virtualenv_support/setuptools-28.8.0-py2.py3-none-any.whl b/misc/virtualenv/virtualenv_support/setuptools-28.8.0-py2.py3-none-any.whl
new file mode 100644 (file)
index 0000000..502e3cb
Binary files /dev/null and b/misc/virtualenv/virtualenv_support/setuptools-28.8.0-py2.py3-none-any.whl differ
diff --git a/misc/virtualenv/virtualenv_support/wheel-0.29.0-py2.py3-none-any.whl b/misc/virtualenv/virtualenv_support/wheel-0.29.0-py2.py3-none-any.whl
new file mode 100644 (file)
index 0000000..506d5e5
Binary files /dev/null and b/misc/virtualenv/virtualenv_support/wheel-0.29.0-py2.py3-none-any.whl differ
index 8197236..71c6aaa 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 from ez_setup import use_setuptools
-use_setuptools(version="24.0.2")
+use_setuptools(version="38.4.0")
 
 import setuptools
 
@@ -26,9 +26,9 @@ setuptools.setup(name="baltrad.bdbserver",
         "pycrypto >= 2.4",
         "python-daemon >= 1.6",
         "python-keyczar >= 0.7b",
-        "SQLAlchemy >= 0.7",
-        "sqlalchemy-migrate >= 0.7.2",
-        "werkzeug >= 0.8",
+        "SQLAlchemy >= 1.0.13",
+        "sqlalchemy-migrate >= 0.10.0",
+        "werkzeug >= 0.14",
     ],
     entry_points = {
         "baltrad.bdbserver.backends": [
index 08f2dd1..4ce0943 100644 (file)
@@ -85,12 +85,18 @@ class JsonResponse(BaseResponse,
 
 class HttpBadRequest(HTTPException):
     code = httplib.BAD_REQUEST
+    def __init__(self, description=None, response=None):
+        HTTPException.__init__(self, description, response)
 
 class HttpNotFound(HTTPException):
     code = httplib.NOT_FOUND
+    def __init__(self, description=None, response=None):
+        HTTPException.__init__(self, description, response)
     
 class HttpConflict(HTTPException):
     code = httplib.CONFLICT
+    def __init__(self, description=None, response=None):
+        HTTPException.__init__(self, description, response)
 
 class HttpUnauthorized(HTTPException):
     """401 Unauthorized
@@ -102,6 +108,7 @@ class HttpUnauthorized(HTTPException):
     code = httplib.UNAUTHORIZED
 
     def __init__(self, challenge):
+        HTTPException.__init__(self)
         if isinstance(challenge, basestring):
             challenge = [challenge]
         self._challenges = challenge
@@ -114,3 +121,6 @@ class HttpUnauthorized(HTTPException):
 
 class HttpForbidden(HTTPException):
     code = httplib.FORBIDDEN
+    def __init__(self, description=None, response=None):
+        HTTPException.__init__(self, description, response)
+