diff --git a/README.md b/README.md index e9dd97c0..99fd29ea 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,7 @@ $ find . -type f ./conf/app.conf ./conf/routes -$ heroku create -b https://github.com/robfig/heroku-buildpack-go-revel.git +$ heroku create -b https://github.com/revel/heroku-buildpack-go-revel.git ... ``` @@ -62,6 +62,22 @@ $ git push heroku master The buildpack will detect your repository as Revel if it contains the `conf/app.conf` and `conf/routes` files. +It's possible to specify the revel mode by setting the REVEL_MODE environment variable. "prod" will be the default mode. + +#### Dependencies and private repositories +If you want to use private repositories you just need to create Godeps folder with this command: +``` +$ godep save ./... +``` +and commit your changes: +``` +$ git add -A . +$ git commit -a -m "Dependencies" +``` +Once the `Godeps` created and committed you can push your changes (deploy): +``` +$ git push heroku master +``` ## Hacking on this Buildpack To change this buildpack, fork it on GitHub. Push diff --git a/bin/compile b/bin/compile index 91dc7191..d2a7f0a8 100755 --- a/bin/compile +++ b/bin/compile @@ -1,14 +1,43 @@ #!/bin/bash -# usage: bin/compile +# usage: bin/compile set -eo pipefail +# Go releases for Darwin beginning with 1.2rc1 +# have included more than one build, depending +# on the specific version of Mac OS X. Try to +# account for that, but don't try too hard. +# This doesn't affect Heroku builds, it's only +# for testing on Darwin systems. +platext() { + case $1 in + go1.0*|go1.1beta*|go1.1rc*|go1.1|go1.1.*) return ;; + esac + case $(uname|tr A-Z a-z) in + darwin) printf %s -osx10.8 ;; + esac +} + +# Go releases have moved to a new URL scheme +# starting with Go version 1.2.2. Return the old +# location for known old versions and the new +# location otherwise. +urlfor() { + ver=$1 + file=$2 + case $ver in + go1.0*|go1.1beta*|go1.1rc*|go1.1|go1.1.*|go1.2beta*|go1.2rc*|go1.2|go1.2.1) + echo http://go.googlecode.com/files/$file + ;; + *) + echo https://storage.googleapis.com/golang/$file + ;; + esac +} + mkdir -p "$1" "$2" build=$(cd "$1/" && pwd) cache=$(cd "$2/" && pwd) -ver=${GOVERSION:-1.1.2} -file=${GOFILE:-go$ver.$(uname|tr A-Z a-z)-amd64.tar.gz} -url=${GOURL:-http://go.googlecode.com/files/$file} buildpack=$(dirname $(dirname $0)) arch=$(uname -m|tr A-Z a-z) if test $arch = x86_64 @@ -23,47 +52,60 @@ python=python2.7 PATH=$buildpack/$plat/bin:$venv/bin:$PATH virtualenv() { - python "$buildpack/vendor/virtualenv-1.7/virtualenv.py" "$@" + python "$buildpack/vendor/virtualenv-1.11.6/virtualenv.py" "$@" } if test -f $build/Godeps -then name=$(<$build/Godeps jq -r .ImportPath) +then + name=$(<$build/Godeps jq -r .ImportPath) + ver=$(<$build/Godeps jq -r .GoVersion) +elif test -d $build/Godeps +then + name=$(<$build/Godeps/Godeps.json jq -r .ImportPath) + ver=$(<$build/Godeps/Godeps.json jq -r .GoVersion) elif test -f $build/.godir -then name=$(cat $build/.godir) +then + name=$(cat $build/.godir) + ver=go${GOVERSION:-1.4} else echo >&2 " ! A .godir is required. For instructions:" echo >&2 " ! http://mmcgrana.github.io/2012/09/getting-started-with-go-on-heroku" exit 1 fi +file=${GOFILE:-$ver.$(uname|tr A-Z a-z)-amd64$(platext $ver).tar.gz} +url=${GOURL:-$(urlfor $ver $file)} + if test -e $build/bin && ! test -d $build/bin then echo >&2 " ! File bin exists and is not a directory." exit 1 fi -if test -d $cache/go-$ver/go +if test -d $cache/$ver/go then - echo "-----> Using Go $ver" + echo "-----> Using $ver" else rm -rf $cache/* # be sure not to build up cruft - mkdir -p $cache/go-$ver - cd $cache/go-$ver - echo -n "-----> Installing Go $ver..." + mkdir -p $cache/$ver + cd $cache/$ver + echo -n "-----> Installing $ver..." curl -sO $url tar zxf $file rm -f $file echo " done" fi -cp -R $cache/go-$ver/go $build/.goroot +mkdir -p $build/bin +cp -R $cache/$ver/go $build/.goroot +GOBIN=$build/bin export GOBIN GOROOT=$build/.goroot export GOROOT GOPATH=$build/.go export GOPATH -PATH=$GOPATH/bin:$GOROOT/bin:$PATH +PATH=$GOROOT/bin:$PATH -if ! (which hg > /dev/null && which bzr > /dev/null) +if ! (which hg >/dev/null && which bzr >/dev/null) then echo -n " Installing Virtualenv..." virtualenv --python $python --distribute --never-download --prompt='(venv) ' $venv > /dev/null 2>&1 @@ -83,26 +125,50 @@ p=$GOPATH/src/$name mkdir -p $p cp -R $build/* $p -unset GIT_DIR # unset git dir or it will mess with goinstall -cd $p -if test -f $build/Godeps +# allow apps to specify cgo flags and set up /app symlink so things like CGO_CFLAGS=-I/app/... work +env_dir="$3" +if [ -d "$env_dir" ] then - echo "-----> Running: godep go get -tags heroku ./..." - godep go get -tags heroku ./... -else - echo "-----> Running: go get -tags heroku ./..." - go get -tags heroku ./... + ln -sfn $build /app/code + for cgo_opt in CGO_CFLAGS CGO_CPPFLAGS CGO_CXXFLAGS CGO_LDFLAGS + do + if [ -f "$env_dir/$cgo_opt" ] + then + export "$cgo_opt=$(cat "$env_dir/$cgo_opt")" + fi + done fi -mkdir -p $build/bin -if test -d $GOPATH/bin +FLAGS=(-tags heroku) +if test -f "$env_dir/GO_GIT_DESCRIBE_SYMBOL" +then + git_describe=$(git describe --tags --always) + git_describe_symbol=$(cat "$env_dir/GO_GIT_DESCRIBE_SYMBOL") + FLAGS=(${FLAGS[@]} -ldflags "-X $git_describe_symbol $git_describe") +fi + +unset GIT_DIR # unset git dir or it will mess with goinstall +cd $p +if test -e $build/Godeps then - mv $GOPATH/bin/* $build/bin + if test -d $build/vendor + then + # go1.6+ or GO15VENDOREXPERIMENT + echo "-----> Running: godep restore" + godep restore + else + echo "-----> Copying workspace" + cp -R $(godep path)/* $GOPATH + echo "-----> Running: godep go install ${FLAGS[@]} ./..." + godep go install "${FLAGS[@]}" ./... + fi +else + echo "-----> Running: go get ${FLAGS[@]} ./..." + go get "${FLAGS[@]}" ./... fi -rm -rf $build/.heroku mkdir -p $build/.profile.d echo 'PATH=$PATH:$HOME/bin' > $build/.profile.d/go.sh -go get github.com/robfig/revel/revel +go get github.com/revel/cmd/revel diff --git a/bin/release b/bin/release index 6fcf5fcb..e9a36cba 100755 --- a/bin/release +++ b/bin/release @@ -2,6 +2,13 @@ # bin/release name=$(cat $1/.godir) + +# Get the Revel mode from the REVEL_MODE environment variable (defaults to "prod") +env=$REVEL_MODE +if [ -z "$env" ]; then + env="prod" +fi + cat <`_ + 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 + `_ 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 + `_ + (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 `_. + * 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! + +Keywords: setuptools deployment installation distutils +Platform: UNKNOWN +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.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 diff --git a/vendor/virtualenv-1.11.6/README.rst b/vendor/virtualenv-1.11.6/README.rst new file mode 100644 index 00000000..5a7a545f --- /dev/null +++ b/vendor/virtualenv-1.11.6/README.rst @@ -0,0 +1,10 @@ +virtualenv +========== + +.. image:: https://pypip.in/v/virtualenv/badge.png + :target: https://pypi.python.org/pypi/virtualenv + +.. image:: https://secure.travis-ci.org/pypa/virtualenv.png?branch=develop + :target: http://travis-ci.org/pypa/virtualenv + +For documentation, see https://virtualenv.pypa.io/ diff --git a/vendor/virtualenv-1.7/bin/rebuild-script.py b/vendor/virtualenv-1.11.6/bin/rebuild-script.py old mode 100755 new mode 100644 similarity index 94% rename from vendor/virtualenv-1.7/bin/rebuild-script.py rename to vendor/virtualenv-1.11.6/bin/rebuild-script.py index a6163e32..44fb1296 --- a/vendor/virtualenv-1.7/bin/rebuild-script.py +++ b/vendor/virtualenv-1.11.6/bin/rebuild-script.py @@ -29,7 +29,8 @@ def rebuild(): 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') + pathname = os.path.join(here, '..', 'virtualenv_embedded', filename) + f = open(pathname, 'rb') c = f.read() f.close() new_data = c.encode('zlib').encode('base64') diff --git a/vendor/virtualenv-1.7/docs/Makefile b/vendor/virtualenv-1.11.6/docs/Makefile similarity index 100% rename from vendor/virtualenv-1.7/docs/Makefile rename to vendor/virtualenv-1.11.6/docs/Makefile diff --git a/vendor/virtualenv-1.7/docs/conf.py b/vendor/virtualenv-1.11.6/docs/conf.py similarity index 84% rename from vendor/virtualenv-1.7/docs/conf.py rename to vendor/virtualenv-1.11.6/docs/conf.py index 39203f1c..8f55474c 100644 --- a/vendor/virtualenv-1.7/docs/conf.py +++ b/vendor/virtualenv-1.11.6/docs/conf.py @@ -11,10 +11,13 @@ # 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 # --------------------- @@ -28,22 +31,25 @@ #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: @@ -77,13 +83,19 @@ # given in html_static_path. #html_style = 'default.css' -html_theme = 'nature' -html_theme_path = ['_theme'] +if os.environ.get('DOCS_LOCAL'): + import sphinx_rtd_theme + html_theme = "sphinx_rtd_theme" + html_theme_path = [sphinx_rtd_theme.get_html_theme_path()] +else: + # on RTD + html_theme = 'default' + # 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/vendor/virtualenv-1.11.6/docs/index.rst b/vendor/virtualenv-1.11.6/docs/index.rst new file mode 100644 index 00000000..1e386c3d --- /dev/null +++ b/vendor/virtualenv-1.11.6/docs/index.rst @@ -0,0 +1,19 @@ + +virtualenv +========== + +`Changes & News `_ | +`Mailing list `_ | +`Issues `_ | +`Github `_ | +`PyPI `_ | +User IRC: #pypa +Dev IRC: #pypa-dev + +.. comment: split here + + +.. toctree:: + :maxdepth: 2 + + virtualenv diff --git a/vendor/virtualenv-1.7/docs/make.bat b/vendor/virtualenv-1.11.6/docs/make.bat similarity index 100% rename from vendor/virtualenv-1.7/docs/make.bat rename to vendor/virtualenv-1.11.6/docs/make.bat diff --git a/vendor/virtualenv-1.7/docs/news.txt b/vendor/virtualenv-1.11.6/docs/news.rst similarity index 51% rename from vendor/virtualenv-1.7/docs/news.txt rename to vendor/virtualenv-1.11.6/docs/news.rst index 254229ce..a07a6168 100644 --- a/vendor/virtualenv-1.7/docs/news.txt +++ b/vendor/virtualenv-1.11.6/docs/news.rst @@ -1,10 +1,315 @@ Changes & News -------------- +.. warning:: + + Python bugfix releases 2.6.8, 2.7.3, 3.1.5 and 3.2.3 include a change that + will cause "import random" to fail with "cannot import name urandom" on any + virtualenv created on a Unix host with an earlier release of Python + 2.6/2.7/3.1/3.2, if the underlying system Python is upgraded. This is due to + the fact that a virtualenv uses the system Python's standard library but + contains its own copy of the Python interpreter, so an upgrade to the system + Python results in a mismatch between the version of the Python interpreter + and the version of the standard library. It can be fixed by removing + ``$ENV/bin/python`` and re-running virtualenv on the same target directory + with the upgraded Python. + + +1.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 environemnt variables. Thanks Ralf Schmitt. + +* Allow setting ``--no-site-packages`` from the config file. + +* Use ``/usr/bin/multiarch-platform`` if available to figure out the include + directory. Thanks for the patch, Mika Laitio. + +* Fix ``install_name_tool`` replacement to work on Python 3.X. + +* Handle paths of users' site-packages on Mac OS X correctly when changing + the prefix. + +* Updated the embedded version of distribute to 0.6.28 and pip to 1.2. + + +1.7.2 (2012-06-22) +~~~~~~~~~~~~~~~~~~ + +* Updated to distribute 0.6.27. + +* Fix activate.fish on OS X. Fixes #8. Thanks David Schoonover. + +* Create a virtualenv-x.x script with the Python version when installing, so + virtualenv for multiple Python versions can be installed to the same + script location. Thanks Miki Tebeka. + +* Restored ability to create a virtualenv with a path longer than 78 + characters, without breaking creation of virtualenvs with non-ASCII paths. + Thanks, Bradley Ayers. + +* Added ability to create virtualenvs without having installed Apple's + developers tools (using an own implementation of ``install_name_tool``). + Thanks Mike Hommey. + +* Fixed PyPy and Jython support on Windows. Thanks Konstantin Zemlyak. + +* Added pydoc script to ease use. Thanks Marc Abramowitz. Fixes #149. + +* Fixed creating a bootstrap script on Python 3. Thanks Raul Leal. Fixes #280. + +* Fixed inconsistency when having set the ``PYTHONDONTWRITEBYTECODE`` env var + with the --distribute option or the ``VIRTUALENV_USE_DISTRIBUTE`` env var. + ``VIRTUALENV_USE_DISTRIBUTE`` is now considered again as a legacy alias. + + +1.7.1.2 (2012-02-17) +~~~~~~~~~~~~~~~~~~~~ + +* Fixed minor issue in `--relocatable`. Thanks, Cap Petschulat. + + +1.7.1.1 (2012-02-16) +~~~~~~~~~~~~~~~~~~~~ + +* 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) ~~~~~~~~~~~~~~~~ -* Updated embedded Distribute release to 0.6.24. Thanks Alex Grönholm. +* 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 @@ -20,16 +325,19 @@ Changes & News * Made ``virtualenv.py`` script executable. + 1.6.4 (2011-07-21) ~~~~~~~~~~~~~~~~~~ * Restored ability to run on Python 2.4, too. + 1.6.3 (2011-07-16) ~~~~~~~~~~~~~~~~~~ * Restored ability to run on Python < 2.7. + 1.6.2 (2011-07-16) ~~~~~~~~~~~~~~~~~~ @@ -64,6 +372,7 @@ Changes & News * Added --never-download and --search-dir options. Thanks Ethan Jucovy. + 1.6 ~~~ @@ -74,6 +383,7 @@ Changes & News * Updated bundled pip to 1.0. + 1.5.2 ~~~~~ @@ -89,6 +399,7 @@ Changes & News * Moved virtualenv to Github at https://github.com/pypa/virtualenv + 1.5.1 ~~~~~ @@ -96,6 +407,7 @@ Changes & News * Fixed Windows regression in 1.5 + 1.5 ~~~ @@ -113,11 +425,13 @@ Changes & News * Add fish and csh activate scripts. + 1.4.9 ~~~~~ * Include pip 0.7.2 + 1.4.8 ~~~~~ @@ -132,17 +446,20 @@ Changes & News * Include pip 0.7.1 + 1.4.7 ~~~~~ * Include pip 0.7 + 1.4.6 ~~~~~ * Allow ``activate.sh`` to skip updating the prompt (by setting ``$VIRTUAL_ENV_DISABLE_PROMPT``). + 1.4.5 ~~~~~ @@ -151,6 +468,7 @@ Changes & News * Fix ``activate.bat`` and ``deactivate.bat`` under Windows when ``PATH`` contained a parenthesis + 1.4.4 ~~~~~ @@ -162,15 +480,17 @@ Changes & News * Fix problem with ``virtualenv --relocate`` when ``bin/`` has subdirectories (e.g., ``bin/.svn/``); from Alan Franzoni. -* If you set ``$VIRTUALENV_USE_DISTRIBUTE`` then virtualenv will use +* If you set ``$VIRTUALENV_DISTRIBUTE`` then virtualenv will use Distribute by default (so you don't have to remember to use ``--distribute``). + 1.4.3 ~~~~~ * Include pip 0.6.1 + 1.4.2 ~~~~~ @@ -181,11 +501,13 @@ Changes & News * Exclude ~/.local (user site-packages) from environments when using ``--no-site-packages`` + 1.4.1 ~~~~~ * Include pip 0.6 + 1.4 ~~~ @@ -195,6 +517,7 @@ Changes & News * Fixed packaging problem of support-files + 1.3.4 ~~~~~ @@ -224,6 +547,7 @@ Changes & News * Fixes for ``--python``: make it work with ``--relocatable`` and the symlink created to the exact Python version. + 1.3.3 ~~~~~ @@ -246,6 +570,7 @@ Changes & News `_ picking up some ``.so`` libraries in ``/usr/local``. + 1.3.2 ~~~~~ @@ -253,11 +578,12 @@ Changes & News ``distutils.cfg`` -- this has been causing problems for a lot of people, in rather obscure ways. -* If you use a `boot script <./index.html#boot-script>`_ it will attempt to import ``virtualenv`` +* If you use a boot script it will attempt to import ``virtualenv`` and find a pre-downloaded Setuptools egg using that. * Added platform-specific paths, like ``/usr/lib/pythonX.Y/plat-linux2`` + 1.3.1 ~~~~~ @@ -280,6 +606,7 @@ Changes & News * Fixed handling of Jython environments that use a jython-complete.jar. + 1.3 ~~~ @@ -306,6 +633,7 @@ Changes & News * Fixed the ``__classpath__`` entry in Jython's ``sys.path`` taking precedent over virtualenv's libs. + 1.2 ~~~ @@ -314,11 +642,13 @@ Changes & News * Add ``sets`` to the module copied over for Python 2.3 (though Python 2.3 still probably doesn't work). + 1.1.1 ~~~~~ * Added support for Jython 2.5. + 1.1 ~~~ @@ -333,6 +663,7 @@ Changes & News * Copy or symlink over the ``include`` directory so that packages will more consistently compile. + 1.0 ~~~ @@ -342,6 +673,7 @@ Changes & News * Fixed typos in ``deactivate.bat``. * Preserve ``$PYTHONPATH`` when calling subprocesses. + 0.9.2 ~~~~~ @@ -356,6 +688,7 @@ Changes & News * Fixed an issue with Mac Framework Python builds, and absolute paths (from Ronald Oussoren). + 0.9.1 ~~~~~ @@ -363,6 +696,7 @@ Changes & News * Fix a little bug in ``bin/activate``. * Actually get ``distutils.cfg`` to work reliably. + 0.9 ~~~ @@ -378,6 +712,7 @@ Changes & News * Should work on MacOSX Framework builds (the default Python installations on Mac). Thanks to Ronald Oussoren. + 0.8.4 ~~~~~ @@ -385,11 +720,13 @@ Changes & News were inaccurate. * Slightly prettier output. + 0.8.3 ~~~~~ * Added support for Windows. + 0.8.2 ~~~~~ @@ -398,11 +735,13 @@ Changes & News * Give error about running while inside a workingenv. * Give better error message about Python 2.3. + 0.8.1 ~~~~~ Fixed packaging of the library. + 0.8 ~~~ diff --git a/vendor/virtualenv-1.7/docs/index.txt b/vendor/virtualenv-1.11.6/docs/virtualenv.rst similarity index 53% rename from vendor/virtualenv-1.7/docs/index.txt rename to vendor/virtualenv-1.11.6/docs/virtualenv.rst index 9f81adf0..c0e725f8 100644 --- a/vendor/virtualenv-1.7/docs/index.txt +++ b/vendor/virtualenv-1.11.6/docs/virtualenv.rst @@ -1,52 +1,13 @@ -virtualenv -========== -* `Discussion list `_ -* `Bugs `_ - -.. contents:: - -.. toctree:: - :maxdepth: 1 - - news - -.. comment: split here - -Status and License ------------------- - -``virtualenv`` is a successor to `workingenv -`_, and an extension -of `virtual-python -`_. - -It was written by Ian Bicking, sponsored by the `Open Planning -Project `_ and is now maintained by a -`group of developers `_. -It is licensed under an -`MIT-style permissive license `_. - -You can install it with ``pip install virtualenv``, or the `latest -development version `_ -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 @@ -59,41 +20,208 @@ 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 +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 +Installation +------------ + +.. warning:: + + We advise installing virtualenv-1.9 or greater. Prior to version 1.9, the + pip included in virtualenv did not 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 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 -If you install it you can also just do ``virtualenv ENV``. + +To install 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. + +Usage +----- + +The basic usage is:: + + $ 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 +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 -`_ or `distribute -`_ into the environment. To use -Distribute instead of setuptools, just call virtualenv like this:: +It also installs `Setuptools +`_ into the environment. - $ python virtualenv.py --distribute ENV +.. note:: -You can also set the environment variable VIRTUALENV_USE_DISTRIBUTE. + Virtualenv (<1.10) used to provide a ``--distribute`` option to use the + setuptools fork Distribute_. Since Distribute has been merged back into + setuptools this option is now no-op, it will always use the improved + setuptools releases. -A new virtualenv also includes the `pip `_ +A new virtualenv also includes the `pip `_ installer, so you can use ``ENV/bin/pip`` to install additional packages into the environment. +.. _Distribute: https://pypi.python.org/pypi/distribute + +activate script +~~~~~~~~~~~~~~~ + +In a newly created virtualenv there will be a ``bin/activate`` shell +script. For Windows systems, activation scripts are provided for CMD.exe +and Powershell. + +On Posix systems you can do:: + + $ source bin/activate + +This will change your ``$PATH`` so its first entry is the virtualenv's +``bin/`` directory. (You have to use ``source`` because it changes your +shell environment in-place.) This is all it does; it's purely a +convenience. If you directly run a script or the python interpreter +from the virtualenv's ``bin/`` directory (e.g. ``path/to/env/bin/pip`` +or ``/path/to/env/bin/python script.py``) there's no need for +activation. + +After activating an environment you can use the function ``deactivate`` to +undo the changes to your ``$PATH``. + +The ``activate`` script will also modify your shell prompt to indicate +which environment is currently active. You can disable this behavior, +which can be useful if you have your own custom prompt that already +displays the active environment name. To do so, set the +``VIRTUAL_ENV_DISABLE_PROMPT`` environment variable to any non-empty +value before running the ``activate`` script. + +On Windows you just do:: + + > \path\to\env\Scripts\activate + +And type `deactivate` to undo the changes. + +Based on your active shell (CMD.exe or Powershell.exe), Windows will use +either activate.bat or activate.ps1 (as appropriate) to activate the +virtual environment. If using Powershell, see the notes about code signing +below. + +.. note:: + + If using Powershell, the ``activate`` script is subject to the + `execution policies`_ on the system. By default on Windows 7, the system's + excution policy is set to ``Restricted``, meaning no scripts like the + ``activate`` script are allowed to be executed. But that can't stop us + from changing that slightly to allow it to be executed. + + In order to use the script, you have to relax your system's execution + policy to ``AllSigned``, meaning all scripts on the system must be + digitally signed to be executed. Since the virtualenv activation + script is signed by one of the authors (Jannis Leidel) this level of + the execution policy suffices. As an administrator run:: + + PS C:\> Set-ExecutionPolicy AllSigned + + Then you'll be asked to trust the signer, when executing the script. + You will be prompted with the following:: + + PS C:\> virtualenv .\foo + New python executable in C:\foo\Scripts\python.exe + Installing setuptools................done. + Installing pip...................done. + PS C:\> .\foo\scripts\activate + + Do you want to run software from this untrusted publisher? + File C:\foo\scripts\activate.ps1 is published by E=jannis@leidel.info, + CN=Jannis Leidel, L=Berlin, S=Berlin, C=DE, Description=581796-Gh7xfJxkxQSIO4E0 + and is not trusted on your system. Only run scripts from trusted publishers. + [V] Never run [D] Do not run [R] Run once [A] Always run [?] Help + (default is "D"):A + (foo) PS C:\> + + If you select ``[A] Always Run``, the certificate will be added to the + Trusted Publishers of your user account, and will be trusted in this + user's context henceforth. If you select ``[R] Run Once``, the script will + be run, but you will be prometed on a subsequent invocation. Advanced users + can add the signer's certificate to the Trusted Publishers of the Computer + account to apply to all users (though this technique is out of scope of this + document). + + Alternatively, you may relax the system execution policy to allow running + of local scripts without verifying the code signature using the following:: + + PS C:\> Set-ExecutionPolicy RemoteSigned + + Since the ``activate.ps1`` script is generated locally for each virtualenv, + it is not considered a remote script and can then be executed. + +.. _`execution policies`: http://technet.microsoft.com/en-us/library/dd347641.aspx + +The ``--system-site-packages`` Option +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +If you build with ``virtualenv --system-site-packages ENV``, your virtual +environment will inherit packages from ``/usr/lib/python2.7/site-packages`` +(or wherever your global site-packages directory is). + +This can be used if you have control over the global site-packages directory, +and you want to depend on the packages there. If you want isolation from the +global system, do not use this flag. + + Environment variables and configuration files ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ virtualenv can not only be configured by passing command line options such as -``--distribute`` but also by two other means: +``--python`` but also by two other means: - Environment variables @@ -102,15 +230,15 @@ virtualenv can not only be configured by passing command line options such as 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:: + 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_USE_DISTRIBUTE=true - $ python virtualenv.py ENV + $ export VIRTUALENV_PYTHON=/opt/python-3.3/bin/python + $ virtualenv ENV It's the same as passing the option to virtualenv directly:: - $ python virtualenv.py --distribute ENV + $ 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 passsed values, e.g.:: @@ -120,19 +248,19 @@ virtualenv can not only be configured by passing command line options such as is the same as calling:: - $ python virtualenv.py --extra-search-dir=/path/to/dists --extra-search-dir=/path/to/other/dists ENV + $ virtualenv --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``. + ``%APPDATA%\virtualenv\virtualenv.ini``. The names of the settings are derived from the long command line option, - e.g. the option ``--distribute`` would look like this:: + e.g. the option ``--python`` would look like this:: [virtualenv] - distribute = true + python = /opt/python-3.3/bin/python Appending options like ``--extra-search-dir`` can be written on multiple lines:: @@ -166,20 +294,20 @@ 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 +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 +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 +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). @@ -195,8 +323,8 @@ If you include these functions, they will be called: ``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 + 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): @@ -237,103 +365,70 @@ Here's a more concrete example of how you could use this:: Another example is available `here `_. -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 +created by the virtualenv. For instance, in a `mod_python `_ or `mod_wsgi `_ 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 +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 +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 +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. +caveats that have not yet been identified. + +.. warning:: -Normally environments are tied to a specific path. That means that + 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 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. +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 +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 +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 +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 @@ -345,43 +440,33 @@ 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 -`_ (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 +The ``--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, distribute and/or pip distributions. Setuptools -distributions must be ``.egg`` files; distribute and pip distributions -should be `.tar.gz` source distributions. +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. -Virtualenv will still download these packages if no satisfactory local -distributions are found. +As well as the extra directories, the search order includes: -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:: +#. The ``virtualenv_support`` directory relative to virtualenv.py +#. The directory where virtualenv.py is located. +#. The current directory. - $ virtualenv --extra-search-dir=/path/to/distributions --never-download ENV +If no satisfactory local distributions are found, virtualenv will +fail. Virtualenv will never download packages. -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 ------------------------------------ @@ -389,33 +474,33 @@ 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, + 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 + the environment (e.g., a globally installed ``hg`` or ``bzr``). It also conflicted a lot with Setuptools. * `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 + 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 + 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 + path, so updates are tracked separately. This script also installs Setuptools automatically, saving a step and avoiding the need for network access. * `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, + 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 + 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 @@ -424,14 +509,23 @@ deployment use one of these tools. Contributing ------------ -Refer to the `contributing to pip`_ documentation - it applies equally to -virtualenv. +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. -.. _contributing to pip: http://www.pip-installer.org/en/latest/how-to-contribute.html +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 ~~~~~~~~~~~~~~~~~ @@ -472,7 +566,7 @@ Other Documentation and Links using virtualenv (virtualenvwrapper) `_ including some handy scripts to make working with multiple - environments easier. He also wrote `an example of using virtualenv + environments easier. He also wrote `an example of using virtualenv to try IPython `_. @@ -483,5 +577,19 @@ Other Documentation and Links `_. * `virtualenv commands - `_ for some more + `_ for some more workflow-related tools around virtualenv. + +Status and License +------------------ + +``virtualenv`` is a successor to `workingenv +`_, and an extension +of `virtual-python +`_. + +It was written by Ian Bicking, sponsored by the `Open Planning +Project `_ and is now maintained by a +`group of developers `_. +It is licensed under an +`MIT-style permissive license `_. diff --git a/vendor/virtualenv-1.7/scripts/virtualenv b/vendor/virtualenv-1.11.6/scripts/virtualenv similarity index 100% rename from vendor/virtualenv-1.7/scripts/virtualenv rename to vendor/virtualenv-1.11.6/scripts/virtualenv diff --git a/vendor/virtualenv-1.7/setup.cfg b/vendor/virtualenv-1.11.6/setup.cfg similarity index 71% rename from vendor/virtualenv-1.7/setup.cfg rename to vendor/virtualenv-1.11.6/setup.cfg index 861a9f55..6c71b612 100644 --- a/vendor/virtualenv-1.7/setup.cfg +++ b/vendor/virtualenv-1.11.6/setup.cfg @@ -1,3 +1,6 @@ +[wheel] +universal = 1 + [egg_info] tag_build = tag_date = 0 diff --git a/vendor/virtualenv-1.11.6/setup.py b/vendor/virtualenv-1.11.6/setup.py new file mode 100644 index 00000000..ea8f7a0f --- /dev/null +++ b/vendor/virtualenv-1.11.6/setup.py @@ -0,0 +1,89 @@ +import os +import re +import shutil +import sys + +try: + from setuptools import setup + setup_params = { + 'entry_points': { + 'console_scripts': [ + 'virtualenv=virtualenv:main', + 'virtualenv-%s.%s=virtualenv:main' % sys.version_info[:2] + ], + }, + 'zip_safe': False, + 'test_suite': 'nose.collector', + 'tests_require': ['nose', '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"') + setup_params = {} + else: + script = 'scripts/virtualenv' + script_ver = script + '-%s.%s' % sys.version_info[:2] + shutil.copy(script, script_ver) + setup_params = {'scripts': [script, script_ver]} + +here = os.path.dirname(os.path.abspath(__file__)) + +## Get long_description from index.txt: +f = open(os.path.join(here, 'docs', 'index.rst')) +long_description = f.read().strip() +long_description = long_description.split('split here', 1)[1] +f.close() +f = open(os.path.join(here, 'docs', 'news.rst')) +long_description += "\n\n" + f.read() +f.close() + + +def get_version(): + f = open(os.path.join(here, 'virtualenv.py')) + version_file = f.read() + f.close() + 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 +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.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='https://virtualenv.pypa.io/', + license='MIT', + py_modules=['virtualenv'], + packages=['virtualenv_support'], + package_data={'virtualenv_support': ['*.whl']}, + **setup_params) diff --git a/vendor/virtualenv-1.11.6/virtualenv.egg-info/PKG-INFO b/vendor/virtualenv-1.11.6/virtualenv.egg-info/PKG-INFO new file mode 100644 index 00000000..06743271 --- /dev/null +++ b/vendor/virtualenv-1.11.6/virtualenv.egg-info/PKG-INFO @@ -0,0 +1,777 @@ +Metadata-Version: 1.1 +Name: virtualenv +Version: 1.11.6 +Summary: Virtual Python Environment builder +Home-page: https://virtualenv.pypa.io/ +Author: Jannis Leidel, Carl Meyer and Brian Rosner +Author-email: python-virtualenv@groups.google.com +License: MIT +Description: + + + .. toctree:: + :maxdepth: 2 + + virtualenv + + Changes & News + -------------- + + .. warning:: + + Python bugfix releases 2.6.8, 2.7.3, 3.1.5 and 3.2.3 include a change that + will cause "import random" to fail with "cannot import name urandom" on any + virtualenv created on a Unix host with an earlier release of Python + 2.6/2.7/3.1/3.2, if the underlying system Python is upgraded. This is due to + the fact that a virtualenv uses the system Python's standard library but + contains its own copy of the Python interpreter, so an upgrade to the system + Python results in a mismatch between the version of the Python interpreter + and the version of the standard library. It can be fixed by removing + ``$ENV/bin/python`` and re-running virtualenv on the same target directory + with the upgraded Python. + + + 1.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 environemnt variables. Thanks Ralf Schmitt. + + * Allow setting ``--no-site-packages`` from the config file. + + * Use ``/usr/bin/multiarch-platform`` if available to figure out the include + directory. Thanks for the patch, Mika Laitio. + + * Fix ``install_name_tool`` replacement to work on Python 3.X. + + * Handle paths of users' site-packages on Mac OS X correctly when changing + the prefix. + + * Updated the embedded version of distribute to 0.6.28 and pip to 1.2. + + + 1.7.2 (2012-06-22) + ~~~~~~~~~~~~~~~~~~ + + * Updated to distribute 0.6.27. + + * Fix activate.fish on OS X. Fixes #8. Thanks David Schoonover. + + * Create a virtualenv-x.x script with the Python version when installing, so + virtualenv for multiple Python versions can be installed to the same + script location. Thanks Miki Tebeka. + + * Restored ability to create a virtualenv with a path longer than 78 + characters, without breaking creation of virtualenvs with non-ASCII paths. + Thanks, Bradley Ayers. + + * Added ability to create virtualenvs without having installed Apple's + developers tools (using an own implementation of ``install_name_tool``). + Thanks Mike Hommey. + + * Fixed PyPy and Jython support on Windows. Thanks Konstantin Zemlyak. + + * Added pydoc script to ease use. Thanks Marc Abramowitz. Fixes #149. + + * Fixed creating a bootstrap script on Python 3. Thanks Raul Leal. Fixes #280. + + * Fixed inconsistency when having set the ``PYTHONDONTWRITEBYTECODE`` env var + with the --distribute option or the ``VIRTUALENV_USE_DISTRIBUTE`` env var. + ``VIRTUALENV_USE_DISTRIBUTE`` is now considered again as a legacy alias. + + + 1.7.1.2 (2012-02-17) + ~~~~~~~~~~~~~~~~~~~~ + + * Fixed minor issue in `--relocatable`. Thanks, Cap Petschulat. + + + 1.7.1.1 (2012-02-16) + ~~~~~~~~~~~~~~~~~~~~ + + * 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 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_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 `_ + 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 + `_ 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 + `_ + (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 `_. + * 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! + +Keywords: setuptools deployment installation distutils +Platform: UNKNOWN +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.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 diff --git a/vendor/virtualenv-1.11.6/virtualenv.egg-info/SOURCES.txt b/vendor/virtualenv-1.11.6/virtualenv.egg-info/SOURCES.txt new file mode 100644 index 00000000..1e17d927 --- /dev/null +++ b/vendor/virtualenv-1.11.6/virtualenv.egg-info/SOURCES.txt @@ -0,0 +1,34 @@ +AUTHORS.txt +LICENSE.txt +MANIFEST.in +README.rst +setup.cfg +setup.py +virtualenv.py +bin/rebuild-script.py +docs/Makefile +docs/conf.py +docs/index.rst +docs/make.bat +docs/news.rst +docs/virtualenv.rst +scripts/virtualenv +virtualenv.egg-info/PKG-INFO +virtualenv.egg-info/SOURCES.txt +virtualenv.egg-info/dependency_links.txt +virtualenv.egg-info/entry_points.txt +virtualenv.egg-info/not-zip-safe +virtualenv.egg-info/top_level.txt +virtualenv_embedded/activate.bat +virtualenv_embedded/activate.csh +virtualenv_embedded/activate.fish +virtualenv_embedded/activate.ps1 +virtualenv_embedded/activate.sh +virtualenv_embedded/activate_this.py +virtualenv_embedded/deactivate.bat +virtualenv_embedded/distutils-init.py +virtualenv_embedded/distutils.cfg +virtualenv_embedded/site.py +virtualenv_support/__init__.py +virtualenv_support/pip-1.5.6-py2.py3-none-any.whl +virtualenv_support/setuptools-3.6-py2.py3-none-any.whl \ No newline at end of file diff --git a/vendor/virtualenv-1.7/virtualenv.egg-info/dependency_links.txt b/vendor/virtualenv-1.11.6/virtualenv.egg-info/dependency_links.txt similarity index 100% rename from vendor/virtualenv-1.7/virtualenv.egg-info/dependency_links.txt rename to vendor/virtualenv-1.11.6/virtualenv.egg-info/dependency_links.txt diff --git a/vendor/virtualenv-1.7/virtualenv.egg-info/entry_points.txt b/vendor/virtualenv-1.11.6/virtualenv.egg-info/entry_points.txt similarity index 58% rename from vendor/virtualenv-1.7/virtualenv.egg-info/entry_points.txt rename to vendor/virtualenv-1.11.6/virtualenv.egg-info/entry_points.txt index 46e4bb50..56a94e1c 100644 --- a/vendor/virtualenv-1.7/virtualenv.egg-info/entry_points.txt +++ b/vendor/virtualenv-1.11.6/virtualenv.egg-info/entry_points.txt @@ -1,2 +1,4 @@ [console_scripts] virtualenv = virtualenv:main +virtualenv-2.7 = virtualenv:main + diff --git a/vendor/virtualenv-1.7/virtualenv.egg-info/not-zip-safe b/vendor/virtualenv-1.11.6/virtualenv.egg-info/not-zip-safe similarity index 100% rename from vendor/virtualenv-1.7/virtualenv.egg-info/not-zip-safe rename to vendor/virtualenv-1.11.6/virtualenv.egg-info/not-zip-safe diff --git a/vendor/virtualenv-1.7/virtualenv.egg-info/top_level.txt b/vendor/virtualenv-1.11.6/virtualenv.egg-info/top_level.txt similarity index 100% rename from vendor/virtualenv-1.7/virtualenv.egg-info/top_level.txt rename to vendor/virtualenv-1.11.6/virtualenv.egg-info/top_level.txt diff --git a/vendor/virtualenv-1.11.6/virtualenv.py b/vendor/virtualenv-1.11.6/virtualenv.py new file mode 100644 index 00000000..0329fc98 --- /dev/null +++ b/vendor/virtualenv-1.11.6/virtualenv.py @@ -0,0 +1,2342 @@ +#!/usr/bin/env python +"""Create a "virtual" Python installation +""" + +__version__ = "1.11.6" +virtualenv_version = __version__ # legacy + +import base64 +import sys +import os +import codecs +import optparse +import re +import shutil +import logging +import tempfile +import zlib +import errno +import glob +import distutils.sysconfig +from distutils.util import strtobool +import struct +import subprocess +import tarfile + +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: + set +except NameError: + from sets import Set as set +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_cygwin = (sys.platform == 'cygwin') +is_darwin = (sys.platform == 'darwin') +abiflags = getattr(sys, 'abiflags', '') + +user_dir = os.path.expanduser('~') +if is_win: + default_storage_dir = os.path.join(user_dir, 'virtualenv') +else: + default_storage_dir = os.path.join(user_dir, '.virtualenv') +default_config_file = os.path.join(default_storage_dir, 'virtualenv.ini') + +if is_pypy: + expected_exe = 'pypy' +elif is_jython: + expected_exe = '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(): + python_core = winreg.CreateKey(winreg.HKEY_LOCAL_MACHINE, + "Software\\Python\\PythonCore") + 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: + path = winreg.QueryValue(python_core, "%s\\InstallPath" % ver) + 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', + 'stat', 'UserDict', 'readline', 'copy_reg', 'types', + 're', 'sre', 'sre_parse', 'sre_constants', 'sre_compile', + 'zlib'] + +REQUIRED_FILES = ['lib-dynload', 'config'] + +majver, minver = sys.version_info[:2] +if majver == 2: + if minver >= 6: + 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', 'tokenize', 'token', + 'functools', 'heapq', 'bisect', 'weakref', + 'reprlib']) + if minver >= 2: + REQUIRED_FILES[-1] = 'config-%s' % majver + if minver >= 3: + import sysconfig + platdir = sysconfig.get_config_var('PLATDIR') + REQUIRED_FILES.append(platdir) + # The whole list of 3.3 modules is reproduced below - the current + # uncommented ones are required for 3.3 as of now, but more may be + # added as 3.3 development continues. + REQUIRED_MODULES.extend([ + #"aifc", + #"antigravity", + #"argparse", + #"ast", + #"asynchat", + #"asyncore", + "base64", + #"bdb", + #"binhex", + #"bisect", + #"calendar", + #"cgi", + #"cgitb", + #"chunk", + #"cmd", + #"codeop", + #"code", + #"colorsys", + #"_compat_pickle", + #"compileall", + #"concurrent", + #"configparser", + #"contextlib", + #"cProfile", + #"crypt", + #"csv", + #"ctypes", + #"curses", + #"datetime", + #"dbm", + #"decimal", + #"difflib", + #"dis", + #"doctest", + #"dummy_threading", + "_dummy_thread", + #"email", + #"filecmp", + #"fileinput", + #"formatter", + #"fractions", + #"ftplib", + #"functools", + #"getopt", + #"getpass", + #"gettext", + #"glob", + #"gzip", + "hashlib", + #"heapq", + "hmac", + #"html", + #"http", + #"idlelib", + #"imaplib", + #"imghdr", + "imp", + "importlib", + #"inspect", + #"json", + #"lib2to3", + #"logging", + #"macpath", + #"macurl2path", + #"mailbox", + #"mailcap", + #"_markupbase", + #"mimetypes", + #"modulefinder", + #"multiprocessing", + #"netrc", + #"nntplib", + #"nturl2path", + #"numbers", + #"opcode", + #"optparse", + #"os2emxpath", + #"pdb", + #"pickle", + #"pickletools", + #"pipes", + #"pkgutil", + #"platform", + #"plat-linux2", + #"plistlib", + #"poplib", + #"pprint", + #"profile", + #"pstats", + #"pty", + #"pyclbr", + #"py_compile", + #"pydoc_data", + #"pydoc", + #"_pyio", + #"queue", + #"quopri", + #"reprlib", + "rlcompleter", + #"runpy", + #"sched", + #"shelve", + #"shlex", + #"smtpd", + #"smtplib", + #"sndhdr", + #"socket", + #"socketserver", + #"sqlite3", + #"ssl", + #"stringprep", + #"string", + #"_strptime", + #"subprocess", + #"sunau", + #"symbol", + #"symtable", + #"sysconfig", + #"tabnanny", + #"telnetlib", + #"test", + #"textwrap", + #"this", + #"_threading_local", + #"threading", + #"timeit", + #"tkinter", + #"tokenize", + #"token", + #"traceback", + #"trace", + #"tty", + #"turtledemo", + #"turtle", + #"unittest", + #"urllib", + #"uuid", + #"uu", + #"wave", + #"weakref", + #"webbrowser", + #"wsgiref", + #"xdrlib", + #"xml", + #"xmlrpc", + #"zipfile", + ]) + if minver >= 4: + REQUIRED_MODULES.extend([ + 'operator', + '_collections_abc', + '_bootlocale', + ]) + +if is_pypy: + # these are needed to correctly display the exceptions that may happen + # during the bootstrap + REQUIRED_MODULES.extend(['traceback', 'linecache']) + +class Logger(object): + + """ + Logging object for use in command-line script. Allows ranges of + levels, to avoid some redundancy of displayed information. + """ + + DEBUG = logging.DEBUG + INFO = logging.INFO + NOTIFY = (logging.INFO+logging.WARN)/2 + WARN = WARNING = logging.WARN + ERROR = logging.ERROR + FATAL = logging.FATAL + + LEVELS = [DEBUG, INFO, NOTIFY, WARN, ERROR, FATAL] + + def __init__(self, consumers): + self.consumers = consumers + self.indent = 0 + self.in_progress = None + self.in_progress_hanging = False + + def debug(self, msg, *args, **kw): + self.log(self.DEBUG, msg, *args, **kw) + def info(self, msg, *args, **kw): + self.log(self.INFO, msg, *args, **kw) + def notify(self, msg, *args, **kw): + self.log(self.NOTIFY, msg, *args, **kw) + def warn(self, msg, *args, **kw): + self.log(self.WARN, msg, *args, **kw) + def error(self, msg, *args, **kw): + self.log(self.ERROR, msg, *args, **kw) + def fatal(self, msg, *args, **kw): + self.log(self.FATAL, msg, *args, **kw) + def log(self, level, msg, *args, **kw): + if args: + if kw: + raise TypeError( + "You may give positional or keyword arguments, not both") + args = args or kw + rendered = None + for consumer_level, consumer in self.consumers: + if self.level_matches(level, consumer_level): + if (self.in_progress_hanging + and consumer in (sys.stdout, sys.stderr)): + self.in_progress_hanging = False + sys.stdout.write('\n') + sys.stdout.flush() + if rendered is None: + if args: + rendered = msg % args + else: + rendered = msg + rendered = ' '*self.indent + rendered + if hasattr(consumer, 'write'): + consumer.write(rendered+'\n') + else: + consumer(rendered) + + def start_progress(self, msg): + assert not self.in_progress, ( + "Tried to start_progress(%r) while in_progress %r" + % (msg, self.in_progress)) + if self.level_matches(self.NOTIFY, self._stdout_level()): + sys.stdout.write(msg) + sys.stdout.flush() + self.in_progress_hanging = True + else: + self.in_progress_hanging = False + self.in_progress = msg + + def end_progress(self, msg='done.'): + assert self.in_progress, ( + "Tried to end_progress without start_progress") + if self.stdout_level_matches(self.NOTIFY): + if not self.in_progress_hanging: + # Some message has been printed out since start_progress + sys.stdout.write('...' + self.in_progress + msg + '\n') + sys.stdout.flush() + else: + sys.stdout.write(msg + '\n') + sys.stdout.flush() + self.in_progress = None + self.in_progress_hanging = False + + def show_progress(self): + """If we are in a progress scope, and no log messages have been + shown, write out another '.'""" + if self.in_progress_hanging: + sys.stdout.write('.') + sys.stdout.flush() + + def stdout_level_matches(self, level): + """Returns true if a message at this level will go to stdout""" + return self.level_matches(level, self._stdout_level()) + + def _stdout_level(self): + """Returns the level that stdout runs at""" + for level, consumer in self.consumers: + if consumer is sys.stdout: + return level + return self.FATAL + + def level_matches(self, level, consumer_level): + """ + >>> l = Logger([]) + >>> l.level_matches(3, 4) + False + >>> l.level_matches(3, 2) + True + >>> l.level_matches(slice(None, 3), 3) + False + >>> l.level_matches(slice(None, 3), 2) + True + >>> l.level_matches(slice(1, 3), 1) + True + >>> l.level_matches(slice(2, 3), 1) + False + """ + if isinstance(level, slice): + start, stop = level.start, level.stop + if start is not None and start > consumer_level: + return False + if stop is not None and stop <= consumer_level: + return False + return True + else: + return level >= consumer_level + + #@classmethod + def level_for_integer(cls, level): + levels = cls.LEVELS + if level < 0: + return levels[0] + if level >= len(levels): + 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)]) + +def mkdir(path): + if not os.path.exists(path): + logger.info('Creating %s', path) + os.makedirs(path) + else: + logger.info('Directory %s already exists', path) + +def copyfileordir(src, dest, symlink=True): + if os.path.isdir(src): + shutil.copytree(src, dest, symlink) + else: + shutil.copy2(src, dest) + +def copyfile(src, dest, symlink=True): + if not os.path.exists(src): + # Some bad symlink in the src + logger.warn('Cannot find file %s (bad symlink)', src) + return + if os.path.exists(dest): + 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)) + 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') 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, symlink) + else: + logger.info('Copying to %s', 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() + return + else: + f = open(dest, 'rb') + c = f.read() + f.close() + 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() + else: + logger.info('Content %s already in place', dest) + +def rmtree(dir): + if os.path.exists(dir): + logger.notify('Deleting tree %s', dir) + shutil.rmtree(dir) + else: + logger.info('Do not need to delete %s; already gone', dir) + +def make_exe(fn): + if hasattr(os, 'chmod'): + oldmode = os.stat(fn).st_mode & 0xFFF # 0o7777 + newmode = (oldmode | 0x16D) & 0xFFF # 0o555, 0o7777 + os.chmod(fn, newmode) + logger.info('Changed mode of %s to %s', fn, oct(newmode)) + +def _find_file(filename, dirs): + 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')] + if os.path.splitext(os.path.dirname(__file__))[0] != 'virtualenv': + # Probably some boot script; just in case virtualenv is installed... + try: + import virtualenv + except ImportError: + pass + else: + dirs.append(os.path.join(os.path.dirname(virtualenv.__file__), 'virtualenv_support')) + return [d for d in dirs if os.path.isdir(d)] + + +class UpdatingDefaultsHelpFormatter(optparse.IndentedHelpFormatter): + """ + Custom help formatter for use in ConfigOptionParser that updates + the defaults before expanding them, allowing them to show up correctly + in the help listing + """ + def expand_default(self, option): + if self.parser is not None: + self.parser.update_defaults(self.parser.defaults) + return optparse.IndentedHelpFormatter.expand_default(self, option) + + +class ConfigOptionParser(optparse.OptionParser): + """ + Custom option parser which updates its defaults by checking the + configuration files and environmental variables + """ + def __init__(self, *args, **kwargs): + self.config = ConfigParser.RawConfigParser() + self.files = self.get_config_files() + self.config.read(self.files) + optparse.OptionParser.__init__(self, *args, **kwargs) + + def get_config_files(self): + config_file = os.environ.get('VIRTUALENV_CONFIG_FILE', False) + if config_file and os.path.exists(config_file): + return [config_file] + return [default_config_file] + + def update_defaults(self, defaults): + """ + Updates the given defaults with values from the config files and + the environ. Does a little special handling for certain types of + options (lists). + """ + # Then go and look for the other sources of configuration: + config = {} + # 1. config files + config.update(dict(self.get_config_section('virtualenv'))) + # 2. environmental variables + config.update(dict(self.get_environ_vars())) + # Then set the options with those values + for key, val in config.items(): + key = key.replace('_', '-') + if not key.startswith('--'): + key = '--%s' % key # only prefer long opts + option = self.get_option(key) + if option is not None: + # ignore empty values + if not val: + continue + # handle multiline configs + if option.action == 'append': + val = val.split() + else: + option.nargs = 1 + 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) + sys.exit(3) + defaults[option.dest] = val + return defaults + + def get_config_section(self, name): + """ + Get a section of a configuration + """ + if self.config.has_section(name): + return self.config.items(name) + return [] + + def get_environ_vars(self, prefix='VIRTUALENV_'): + """ + Returns a generator with all environmental vars with prefix VIRTUALENV + """ + for key, val in os.environ.items(): + if key.startswith(prefix): + yield (key.replace(prefix, '').lower(), val) + + def get_default_values(self): + """ + Overridding to make updating the defaults after instantiation of + the option parser possible, update_defaults() does the dirty work. + """ + if not self.process_default_values: + # Old, pre-Optik 1.5 behaviour. + return optparse.Values(self.defaults) + + defaults = self.update_defaults(self.defaults.copy()) # ours + for option in self._get_all_options(): + default = defaults.get(option.dest) + if isinstance(default, basestring): + opt_str = option.get_opt_string() + defaults[option.dest] = option.check_value(opt_str, default) + return optparse.Values(defaults) + + +def main(): + parser = ConfigOptionParser( + version=virtualenv_version, + usage="%prog [OPTIONS] DEST_DIR", + formatter=UpdatingDefaultsHelpFormatter()) + + parser.add_option( + '-v', '--verbose', + action='count', + dest='verbose', + default=0, + help="Increase verbosity.") + + parser.add_option( + '-q', '--quiet', + action='count', + dest='quiet', + default=0, + help='Decrease verbosity.') + + parser.add_option( + '-p', '--python', + dest='python', + metavar='PYTHON_EXE', + help='The Python interpreter to use, e.g., --python=python2.5 will use the python2.5 ' + 'interpreter to create the new environment. The default is the interpreter that ' + 'virtualenv was installed with (%s)' % sys.executable) + + parser.add_option( + '--clear', + dest='clear', + action='store_true', + 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='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 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 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.') + + parser.add_option( + '--no-setuptools', + dest='no_setuptools', + action='store_true', + help='Do not install setuptools (or pip) in the new virtualenv.') + + parser.add_option( + '--no-pip', + dest='no_pip', + action='store_true', + help='Do not install pip 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/pip distributions in. " + "This option can be used multiple times.") + + parser.add_option( + '--never-download', + dest="never_download", + action="store_true", + default=True, + help="DEPRECATED. Retained only for backward compatibility. This option has no effect. " + "Virtualenv never downloads pip or setuptools.") + + parser.add_option( + '--prompt', + dest='prompt', + 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) + + options, args = parser.parse_args() + + global logger + + if 'adjust_options' in globals(): + adjust_options(options, args) + + verbosity = options.verbose - options.quiet + 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() + interpreter = resolve_interpreter(options.python) + if interpreter == sys.executable: + logger.warn('Already using interpreter %s' % interpreter) + else: + logger.notify('Running virtualenv with interpreter %s' % interpreter) + env['VIRTUALENV_INTERPRETER_RUNNING'] = 'true' + file = __file__ + if file.endswith('.pyc'): + file = file[:-1] + popen = subprocess.Popen([interpreter, file] + sys.argv[1:], env=env) + raise SystemExit(popen.wait()) + + if not args: + print('You must provide a DEST_DIR') + parser.print_help() + sys.exit(2) + if len(args) > 1: + print('There must be only one argument: DEST_DIR (you gave %s)' % ( + ' '.join(args))) + parser.print_help() + sys.exit(2) + + home_dir = args[0] + + 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') + sys.exit(3) + + if 'PYTHONHOME' in os.environ: + logger.warn('PYTHONHOME is set. You *must* activate the virtualenv before using it') + del os.environ['PYTHONHOME'] + + if options.relocatable: + make_environment_relocatable(home_dir) + return + + if not options.never_download: + logger.warn('The --never-download option is for backward compatibility only.') + logger.warn('Setting it to false is no longer supported, and will be ignored.') + + create_environment(home_dir, + site_packages=options.system_site_packages, + clear=options.clear, + unzip_setuptools=options.unzip_setuptools, + prompt=options.prompt, + search_dirs=options.search_dirs, + never_download=True, + no_setuptools=options.no_setuptools, + no_pip=options.no_pip, + 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): + cmd_parts = [] + for part in cmd: + if len(part) > 45: + part = part[:20]+"..."+part[-20:] + if ' ' in part or '\n' in part or '"' in part or "'" in part: + part = '"%s"' % part.replace('"', '\\"') + if hasattr(part, 'decode'): + try: + part = part.decode(sys.getdefaultencoding()) + except UnicodeDecodeError: + part = part.decode(sys.getfilesystemencoding()) + cmd_parts.append(part) + cmd_desc = ' '.join(cmd_parts) + if show_stdout: + stdout = None + else: + stdout = subprocess.PIPE + logger.debug("Running command %s" % cmd_desc) + if extra_env or remove_from_env: + env = os.environ.copy() + if extra_env: + env.update(extra_env) + if remove_from_env: + for varname in remove_from_env: + env.pop(varname, None) + else: + env = None + try: + proc = subprocess.Popen( + cmd, stderr=subprocess.STDOUT, stdin=None, stdout=stdout, + cwd=cwd, env=env) + except Exception: + e = sys.exc_info()[1] + logger.fatal( + "Error %s while executing command %s" % (e, cmd_desc)) + raise + all_output = [] + if stdout is not None: + stdout = proc.stdout + encoding = sys.getdefaultencoding() + fs_encoding = sys.getfilesystemencoding() + while 1: + line = stdout.readline() + try: + line = line.decode(encoding) + except UnicodeDecodeError: + line = line.decode(fs_encoding) + if not line: + break + line = line.rstrip() + all_output.append(line) + if filter_stdout: + level = filter_stdout(line) + if isinstance(level, tuple): + level, line = level + logger.log(level, line) + if not logger.stdout_level_matches(level): + logger.show_progress() + else: + logger.info(line) + else: + proc.communicate() + proc.wait() + if proc.returncode: + if raise_on_returncode: + if all_output: + logger.notify('Complete output from command %s:' % cmd_desc) + logger.notify('\n'.join(all_output) + '\n----------------------------------------') + raise OSError( + "Command %s failed with error code %s" + % (cmd_desc, proc.returncode)) + else: + logger.warn( + "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): + if search_dirs is None: + search_dirs = file_search_dirs() + + wheels = find_wheels(['setuptools', 'pip'], search_dirs) + pythonpath = os.pathsep.join(wheels) + findlinks = ' '.join(search_dirs) + + cmd = [ + py_executable, '-c', + 'import sys, pip; sys.exit(pip.main(["install", "--ignore-installed"] + sys.argv[1:]))', + ] + project_names + logger.start_progress('Installing %s...' % (', '.join(project_names))) + logger.indent += 2 + try: + call_subprocess(cmd, show_stdout=False, + extra_env = { + 'PYTHONPATH': pythonpath, + 'PIP_FIND_LINKS': findlinks, + 'PIP_USE_WHEEL': '1', + 'PIP_PRE': '1', + 'PIP_NO_INDEX': '1' + } + ) + finally: + logger.indent -= 2 + logger.end_progress() + +def create_environment(home_dir, site_packages=False, clear=False, + unzip_setuptools=False, + prompt=None, search_dirs=None, never_download=False, + no_setuptools=False, no_pip=False, symlink=True): + """ + Creates a new environment in ``home_dir``. + + If ``site_packages`` is true, then the global ``site-packages/`` + directory will be on the path. + + If ``clear`` is true (default False) then the environment will + first be cleared. + """ + home_dir, lib_dir, inc_dir, bin_dir = path_locations(home_dir) + + py_executable = os.path.abspath(install_python( + home_dir, lib_dir, inc_dir, bin_dir, + site_packages=site_packages, clear=clear, symlink=symlink)) + + install_distutils(home_dir) + + if not no_setuptools: + to_install = ['setuptools'] + if not no_pip: + to_install.append('pip') + install_wheel(to_install, py_executable, search_dirs) + + install_activate(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)""" + # XXX: We'd use distutils.sysconfig.get_python_inc/lib but its + # prefix arg is broken: http://bugs.python.org/issue3386 + 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: + 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('We could not determine the short pathname for it.') + print('Exiting.') + sys.exit(3) + home_dir = str(buf.value) + lib_dir = join(home_dir, 'Lib') + inc_dir = join(home_dir, 'Include') + bin_dir = join(home_dir, 'Scripts') + if is_jython: + lib_dir = join(home_dir, 'Lib') + inc_dir = join(home_dir, 'Include') + bin_dir = join(home_dir, 'bin') + elif is_pypy: + lib_dir = home_dir + inc_dir = join(home_dir, 'include') + bin_dir = join(home_dir, 'bin') + elif not is_win: + lib_dir = join(home_dir, 'lib', py_version) + multiarch_exec = '/usr/bin/multiarch-platform' + if is_executable_file(multiarch_exec): + # In Mageia (2) and Mandriva distros the include dir must be like: + # virtualenv/include/multiarch-x86_64-linux/python2.7 + # instead of being virtualenv/include/python2.7 + p = subprocess.Popen(multiarch_exec, stdout=subprocess.PIPE, stderr=subprocess.PIPE) + stdout, stderr = p.communicate() + # stdout.strip is needed to remove newline character + inc_dir = join(home_dir, 'include', stdout.strip(), py_version + abiflags) + else: + inc_dir = join(home_dir, 'include', py_version + abiflags) + bin_dir = join(home_dir, 'bin') + return home_dir, lib_dir, inc_dir, bin_dir + + +def change_prefix(filename, dst_prefix): + prefixes = [sys.prefix] + + 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"), + # 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) + for src_prefix in prefixes: + if filename.startswith(src_prefix): + _, relpath = filename.split(src_prefix, 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, symlink): + import imp + # If we are running under -p, we need to remove the current + # directory from sys.path temporarily here, so that we + # definitely get the modules from the site directory of + # the interpreter we are running under, not the one + # virtualenv.py is installed under (which might lead to py2/py3 + # incompatibility issues) + _prev_sys_path = sys.path + if os.environ.get('VIRTUALENV_INTERPRETER_RUNNING'): + sys.path = sys.path[1:] + try: + for modname in REQUIRED_MODULES: + if modname in sys.builtin_module_names: + logger.info("Ignoring built-in bootstrap module: %s" % modname) + continue + try: + f, filename, _ = imp.find_module(modname) + except ImportError: + logger.info("Cannot import bootstrap module: %s" % modname) + else: + if f is not None: + f.close() + # special-case custom readline.so on OS X, but not for pypy: + if modname == 'readline' and sys.platform == 'darwin' and not ( + is_pypy or filename.endswith(join('lib-dynload', 'readline.so'))): + dst_filename = join(dst_prefix, 'lib', 'python%s' % sys.version[:3], 'readline.so') + elif modname == 'readline' and sys.platform == 'win32': + # special-case for Windows, where readline is not a + # standard module, though it may have been installed in + # site-packages by a third-party package + pass + else: + dst_filename = change_prefix(filename, dst_prefix) + copyfile(filename, dst_filename, symlink) + if filename.endswith('.pyc'): + pyfile = filename[:-1] + if os.path.exists(pyfile): + copyfile(pyfile, dst_filename[:-1], symlink) + finally: + sys.path = _prev_sys_path + + +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, 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') + return + + if clear: + rmtree(lib_dir) + ## FIXME: why not delete it? + ## Maybe it should delete everything with #!/path/to/venv/python in it + logger.notify('Not deleting %s', bin_dir) + + 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, symlink) + stdlib_dirs = [os.path.dirname(os.__file__)] + if is_win: + stdlib_dirs.append(join(os.path.dirname(stdlib_dirs[0]), 'DLLs')) + elif is_darwin: + stdlib_dirs.append(join(stdlib_dirs[0], 'site-packages')) + if hasattr(os, 'symlink'): + logger.info('Symlinking Python bootstrap modules') + else: + logger.info('Copying Python bootstrap modules') + logger.indent += 2 + try: + # copy required files... + for stdlib_dir in stdlib_dirs: + if not os.path.isdir(stdlib_dir): + continue + 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), symlink) + # ...and modules + copy_required_modules(home_dir, symlink) + finally: + logger.indent -= 2 + mkdir(join(lib_dir, 'site-packages')) + import site + site_filename = site.__file__ + if site_filename.endswith('.pyc'): + site_filename = site_filename[:-1] + elif site_filename.endswith('$py.class'): + site_filename = site_filename.replace('$py.class', '.py') + site_filename_dst = change_prefix(site_filename, home_dir) + site_dir = os.path.dirname(site_filename_dst) + writefile(site_filename_dst, SITE_PY) + writefile(join(site_dir, 'orig-prefix.txt'), prefix) + site_packages_filename = join(site_dir, 'no-global-site-packages.txt') + if not site_packages: + writefile(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, 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 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), symlink) + + if is_jython: + # Jython has either jython-dev.jar and javalib/ dir, or just + # jython.jar + for name in 'jython-dev.jar', 'javalib', 'jython.jar': + src = join(prefix, name) + if os.path.exists(src): + 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): + copyfile(src, join(home_dir, 'registry'), symlink=False) + copyfile(join(prefix, 'cachedir'), join(home_dir, 'cachedir'), + symlink=False) + + 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. + py_executable = os.path.join( + 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 + shutil.copyfile(executable, py_executable) + make_exe(py_executable) + 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, symlink) + + if is_win: + for name in 'libexpat.dll', 'libpypy.dll', 'libpypy-c.dll', 'libeay32.dll', 'ssleay32.dll', 'sqlite.dll': + src = join(prefix, name) + if os.path.exists(src): + copyfile(src, join(bin_dir, name), 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.lower() == '.exe': + # python2.4 gives an extension of '.4' :P + secondary_exe += py_executable_ext + if os.path.exists(secondary_exe): + logger.warn('Not overwriting existing %s script %s (you must use %s)' + % (expected_exe, secondary_exe, py_executable)) + else: + logger.notify('Also creating executable in %s' % secondary_exe) + shutil.copyfile(sys.executable, secondary_exe) + make_exe(secondary_exe) + + if '.framework' in prefix: + 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 '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 + # environment + virtual_lib = os.path.join(home_dir, '.Python') + + if os.path.exists(virtual_lib): + os.unlink(virtual_lib) + copyfile( + os.path.join(prefix, 'Python'), + virtual_lib, + symlink) + + # And then change the install_name of the copied python executable + try: + mach_o_change(py_executable, + os.path.join(prefix, 'Python'), + '@executable_path/../.Python') + except: + 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]) + 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) + + if is_win 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 + # NOTE: keep this check as one line, cmd.exe doesn't cope with line breaks + 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, + stdout=subprocess.PIPE) + proc_stdout, proc_stderr = proc.communicate() + except OSError: + e = sys.exc_info()[1] + if e.errno == errno.EACCES: + logger.fatal('ERROR: The executable %s could not be run: %s' % (py_executable, e)) + sys.exit(100) + else: + raise e + + proc_stdout = proc_stdout.strip().decode("utf-8") + proc_stdout = os.path.normcase(os.path.abspath(proc_stdout)) + norm_home_dir = os.path.normcase(os.path.abspath(home_dir)) + if hasattr(norm_home_dir, 'decode'): + norm_home_dir = norm_home_dir.decode(sys.getfilesystemencoding()) + if proc_stdout != norm_home_dir: + logger.fatal( + 'ERROR: The executable %s is not functioning' % py_executable) + logger.fatal( + 'ERROR: It thinks sys.prefix is %r (should be %r)' + % (proc_stdout, norm_home_dir)) + logger.fatal( + 'ERROR: virtualenv is not compatible with this system or executable') + if is_win: + logger.fatal( + '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) + + pydistutils = os.path.expanduser('~/.pydistutils.cfg') + if os.path.exists(pydistutils): + 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): + home_dir = os.path.abspath(home_dir) + 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} + + # suppling activate.fish in addition to, not instead of, the + # bash script support. + files['activate.fish'] = ACTIVATE_FISH + + # same for csh/tcsh support... + files['activate.csh'] = ACTIVATE_CSH + + files['activate_this.py'] = ACTIVATE_THIS + if hasattr(home_dir, 'decode'): + home_dir = home_dir.decode(sys.getfilesystemencoding()) + vname = os.path.basename(home_dir) + for name, content in files.items(): + content = content.replace('__VIRTUAL_PROMPT__', prompt or '') + content = content.replace('__VIRTUAL_WINPROMPT__', prompt or '(%s)' % vname) + content = content.replace('__VIRTUAL_ENV__', home_dir) + content = content.replace('__VIRTUAL_NAME__', vname) + content = content.replace('__BIN_NAME__', os.path.basename(bin_dir)) + writefile(os.path.join(bin_dir, name), content) + +def install_distutils(home_dir): + distutils_path = change_prefix(distutils.__path__[0], home_dir) + mkdir(distutils_path) + ## FIXME: maybe this prefix setting should only be put in place if + ## there's a local distutils.cfg with a prefix setting? + home_dir = os.path.abspath(home_dir) + ## FIXME: this is breaking things, removing for now: + #distutils_cfg = DISTUTILS_CFG + "\n[install]\nprefix=%s\n" % 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, 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. + """ + try: + import sysconfig + except ImportError: + pass + else: + if sysconfig._get_default_scheme() == 'posix_local': + local_path = os.path.join(home_dir, 'local') + if not os.path.exists(local_path): + 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]: + # 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 + + 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 + cp_or_ln = (os.symlink if symlink else copyfile) + cp_or_ln('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 + 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) + break + if not os.path.exists(exe): + logger.fatal('The executable %s (from --python=%s) does not exist' % (exe, exe)) + raise SystemExit(3) + if not is_executable(exe): + logger.fatal('The executable %s (from --python=%s) is not executable' % (exe, exe)) + raise SystemExit(3) + return exe + +def is_executable(exe): + """Checks a file is executable""" + return os.access(exe, os.X_OK) + +############################################################ +## Relocating the environment: + +def make_environment_relocatable(home_dir): + """ + Makes the already-existing environment use relative paths, and takes out + the #!-based environment selection in scripts. + """ + home_dir, lib_dir, inc_dir, bin_dir = path_locations(home_dir) + activate_this = os.path.join(bin_dir, 'activate_this.py') + if not os.path.exists(activate_this): + 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, 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.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], '') + + # This is what we expect at the top of scripts: + 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 = '#!%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') + try: + 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 + finally: + f.close() + if not lines: + logger.warn('Script %s is an empty file' % filename) + continue + + 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: + logger.info('Script %s has already been made relative' % filename) + else: + logger.warn('Script %s cannot be made relative (it\'s not a normal script that starts with %s)' + % (filename, shebang)) + continue + logger.notify('Making script %s relative' % filename) + script = relative_script([new_shebang] + lines[1:]) + f = open(filename, 'wb') + f.write('\n'.join(script).encode('utf-8')) + f.close() + +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""" + home_dir = os.path.normcase(os.path.abspath(home_dir)) + if sys_path is None: + sys_path = sys.path + for path in sys_path: + if not path: + path = '.' + if not os.path.isdir(path): + continue + path = os.path.normcase(os.path.abspath(path)) + if not path.startswith(home_dir): + logger.debug('Skipping system (non-environment) directory %s' % path) + continue + for filename in os.listdir(path): + filename = os.path.join(path, filename) + if filename.endswith('.pth'): + if not os.access(filename, os.W_OK): + logger.warn('Cannot write .pth file %s, skipping' % filename) + else: + fixup_pth_file(filename) + if filename.endswith('.egg-link'): + if not os.access(filename, os.W_OK): + logger.warn('Cannot write .egg-link file %s, skipping' % filename) + else: + fixup_egg_link(filename) + +def fixup_pth_file(filename): + lines = [] + prev_lines = [] + f = open(filename) + prev_lines = f.readlines() + f.close() + for line in prev_lines: + line = line.strip() + if (not line or line.startswith('#') or line.startswith('import ') + or os.path.abspath(line) != line): + lines.append(line) + else: + new_value = make_relative_path(filename, line) + if line != new_value: + logger.debug('Rewriting path %s as %s (in %s)' % (line, new_value, filename)) + lines.append(new_value) + if lines == prev_lines: + 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() + +def fixup_egg_link(filename): + f = open(filename) + link = f.readline().strip() + f.close() + 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() + +def make_relative_path(source, dest, dest_is_directory=True): + """ + Make a filename relative, where the filename is dest, and it is + being referred to from the filename source. + + >>> make_relative_path('/usr/share/something/a-file.pth', + ... '/usr/share/another-place/src/Directory') + '../another-place/src/Directory' + >>> make_relative_path('/usr/share/something/a-file.pth', + ... '/home/user/src/Directory') + '../../../home/user/src/Directory' + >>> make_relative_path('/usr/share/a-file.pth', '/usr/share/') + './' + """ + source = os.path.dirname(source) + if not dest_is_directory: + dest_filename = os.path.basename(dest) + dest = os.path.dirname(dest) + dest = os.path.normpath(os.path.abspath(dest)) + source = os.path.normpath(os.path.abspath(source)) + dest_parts = dest.strip(os.path.sep).split(os.path.sep) + source_parts = source.strip(os.path.sep).split(os.path.sep) + while dest_parts and source_parts and dest_parts[0] == source_parts[0]: + dest_parts.pop(0) + source_parts.pop(0) + full_parts = ['..']*len(source_parts) + dest_parts + if not dest_is_directory: + full_parts.append(dest_filename) + if not full_parts: + # Special case for the current directory (otherwise it'd be '') + return './' + return os.path.sep.join(full_parts) + + + +############################################################ +## Bootstrap script creation: + +def create_bootstrap_script(extra_text, python_version=''): + """ + 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): + 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. + + 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 = codecs.open(filename, 'r', encoding='utf-8') + content = f.read() + f.close() + py_exe = 'python%s' % python_version + content = (('#!/usr/bin/env %s\n' % py_exe) + + '## WARNING: This file is generated\n' + + content) + return content.replace('##EXT' 'END##', extra_text) + +##EXTEND## + +def convert(s): + b = base64.b64decode(s.encode('ascii')) + return zlib.decompress(b).decode('utf-8') + +##file site.py +SITE_PY = convert(""" +eJzFPf1z2zaWv/OvwMqToZTIdOJ0e3tOnRsncVrvuYm3SWdz63q0lARZrCmSJUjL2pu7v/3eBwAC +JCXbm+6cphNLJPDw8PC+8PAeOhgMTopCZnOxyud1KoWScTlbiiKulkos8lJUy6Sc7xdxWW3g6ewm +vpZKVLlQGxVhqygInn7lJ3gqPi8TZVCAb3Fd5au4SmZxmm5EsiryspJzMa/LJLsWSZZUSZwm/4AW +eRaJp1+PQXCWCZh5mshS3MpSAVwl8oW42FTLPBPDusA5v4j+GL8cjYWalUlRQYNS4wwUWcZVkEk5 +BzShZa2AlEkl91UhZ8kimdmG67xO56JI45kUf/87T42ahmGg8pVcL2UpRQbIAEwJsArEA74mpZjl +cxkJ8UbOYhyAnzfEChjaGNdMIRmzXKR5dg1zyuRMKhWXGzGc1hUBIpTFPAecEsCgStI0WOfljRrB +ktJ6rOGRiJk9/Mkwe8A8cfwu5wCOH7Pg5yy5GzNs4B4EVy2ZbUq5SO5EjGDhp7yTs4l+NkwWYp4s +FkCDrBphk4ARUCJNpgcFLcd3eoVeHxBWlitjGEMiytyYX1KPKDirRJwqYNu6QBopwvydnCZxBtTI +bmE4gAgkDfrGmSeqsuPQ7EQOAEpcxwqkZKXEcBUnGTDrj/GM0P5rks3ztRoRBWC1lPi1VpU7/2EP +AaC1Q4BxgItlVrPO0uRGppsRIPAZsC+lqtMKBWKelHJW5WUiFQEA1DZC3gHSYxGXUpOQOdPI7Zjo +TzRJMlxYFDAUeHyJJFkk13VJEiYWCXAucMX7jz+Jd6dvzk4+aB4zwFhmr1eAM0ChhXZwggHEQa3K +g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kVJc2wRcm1g +QhYFlXiTaTfO2ki0fQoiFM4tLuO4aZrhOzqR4dIPcWx17hphMBY+Srwh7RTyN83XOWkcSPh1Pg/k +TXX/jbJTbMtUmcxZ+/bbqOsy82suFQg/BhdSOTRhMNBHlUarCpU7JzBhmkKmRejKOQzayQe6MWoa +n1wqWmuh6LZAaHxcdeqIlVLhIBJdO9/kbl0It2oEXQj+eGjJOuvOIR/YGRqvFhttUB2XTvLXYN2H +37CBdbW2W7j2r2+VsCn0doVWcFG1/4y1VwBjfwAyoZhD +""") + +##file activate.bat +ACTIVATE_BAT = convert(""" +eJx9UdEKgjAUfW6wfxjiIH+hEDKUFHSKLCMI7kNOEkIf9P9pTJ3OLJ/03HPPPed4Es9XS9qqwqgT +PbGKKOdXL4aAFS7A4gvAwgijuiKlqOpGlATS2NeMLE+TjJM9RkQ+SmqAXLrBo1LLIeLdiWlD6jZt +r7VNubWkndkXaxg5GO3UaOOKS6drO3luDDiO5my3iA0YAKGzPRV1ack8cOdhysI0CYzIPzjSiH5X +0QcvC8Lfaj0emsVKYF2rhL5L3fCkVjV76kShi59NHwDniAHzkgDgqBcwOgTMx+gDQQqXCw== +""") + +##file deactivate.bat +DEACTIVATE_BAT = convert(""" +eJxzSE3OyFfIT0vj4ipOLVEI8wwKCXX0iXf1C7Pl4spMU0hJTcvMS01RiPf3cYmHyQYE+fsGhCho +cCkAAUibEkTEVhWLMlUlLk6QGixStlyaeCyJDPHw9/Pw93VFsQguim4ZXAJoIUw5DhX47XUM8UCx +EchHtwsohN1bILUgw61c/Vy4AJYPYm4= +""") + +##file activate.ps1 +ACTIVATE_PS = convert(""" +eJylWdmS40Z2fVeE/oHT6rCloNUEAXDThB6wAyQAEjsB29GBjdgXYiWgmC/zgz/Jv+AEWNVd3S2N +xuOKYEUxM+/Jmzfvcm7W//zXf/+wUMOoXtyi1F9kbd0sHH/hFc2iLtrK9b3FrSqyxaVQwr8uhqJd +uHaeg9mqzRdR8/13Pyy8qPLdJh0+LMhi0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3wvgh +gGEUM66kK6j4NiyoneuPLSwaCWDxczgaolEWpiMyDVDb7dNuLAbriL8ig8mmeju31oNvQdpnvEPC +1vAXbWacGRVrGt/uXN/gU0CDDwgooKRrHfTBb1/s9lYZ8ZqOBU0yLvpuP6+K9hLFsvIjeNhBi0KL +MlOuWRn3FRwx5oHXjl0YImUx0+gLzjGchrgzca026ETmYJzPD+IpuKzNi8AFn048Thd63OdD86M6 +84zE8yQm0VqXdbbgvub2pKVnS76icBGdeTHHXTKspUmr4NYo/furFLKiMdQzFjHJNcdAnMhltBJK +0/IKX3DVFqvPJ2dLE7bDBkH0l/PJ29074+F0CsGYOxsb7U3myTUncYfXqnLLfa6sJybX4g+hmcjO +kMRBfA1JellfRRKJcyRpxdS4rIl6FdmQCWjo/o9Qz7yKffoP4JHjOvABcRn4CZIT2RH4jnxmfpVG +qgLaAvQBNfuO6X0/Ux02nb4FKx3vgP+XnkX0QW9pLy/NsXgdN24dD3LxO2Nwil7Zlc1dqtP3d7/h +kzp1/+7hGBuY4pk0XD/0Ao/oTe/XGrfyM773aB7iUhgkpy+dwAMalxMP0DrBcsVw/6p25+/hobP9 +GBknrWExDhLJ1bwt1NcCNblaFbMKCyvmX0PeRaQ= +""") + +##file distutils.cfg +DISTUTILS_CFG = convert(""" +eJxNj00KwkAMhfc9xYNuxe4Ft57AjYiUtDO1wXSmNJnK3N5pdSEEAu8nH6lxHVlRhtDHMPATA4uH +xJ4EFmGbvfJiicSHFRzUSISMY6hq3GLCRLnIvSTnEefN0FIjw5tF0Hkk9Q5dRunBsVoyFi24aaLg +9FDOlL0FPGluf4QjcInLlxd6f6rqkgPu/5nHLg0cXCscXoozRrP51DRT3j9QNl99AP53T2Q= +""") + +##file activate_this.py +ACTIVATE_THIS = convert(""" +eJyNU01v2zAMvetXEB4K21jmDOstQA4dMGCHbeihlyEIDMWmG62yJEiKE//7kXKdpN2KzYBt8euR +fKSyLPs8wiEo8wh4wqZTGou4V6Hm0wJa1cSiTkJdr8+GsoTRHuCotBayiWqQEYGtMCgfD1KjGYBe +5a3p0cRKiAe2NtLADikftnDco0ko/SFEVgEZ8aRC5GLux7i3BpSJ6J1H+i7A2CjiHq9z7JRZuuQq +siwTIvpxJYCeuWaBpwZdhB+yxy/eWz+ZvVSU8C4E9FFZkyxFsvCT/ZzL8gcz9aXVE14Yyp2M+2W0 +y7n5mp0qN+avKXvbsyyzUqjeWR8hjGE+2iCE1W1tQ82hsCZN9UzlJr+/e/iab8WfqsmPI6pWeUPd +FrMsd4H/55poeO9n54COhUs+sZNEzNtg/wanpjpuqHJaxs76HtZryI/K3H7KJ/KDIhqcbJ7kI4ar +XL+sMgXnX0D+Te2Iy5xdP8yueSlQB/x/ED2BTAtyE3K4SYUN6AMNfbO63f4lBW3bUJPbTL+mjSxS +PyRfJkZRgj+VbFv+EzHFi5pKwUEepa4JslMnwkowSRCXI+m5XvEOvtuBrxHdhLalG0JofYBok6qj +YdN2dEngUlbC4PG60M1WEN0piu7Nq7on0mgyyUw3iV1etLo6r/81biWdQ9MWHFaePWZYaq+nmp+t +s3az+sj7eA0jfgPfeoN1 +""") + +MH_MAGIC = 0xfeedface +MH_CIGAM = 0xcefaedfe +MH_MAGIC_64 = 0xfeedfacf +MH_CIGAM_64 = 0xcffaedfe +FAT_MAGIC = 0xcafebabe +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 '' % ( + 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)) + do_file(open(path, 'r+b')) + + +if __name__ == '__main__': + main() + +## TODO: +## Copy python.exe.manifest +## Monkeypatch distutils.sysconfig diff --git a/vendor/virtualenv-1.11.6/virtualenv_embedded/activate.bat b/vendor/virtualenv-1.11.6/virtualenv_embedded/activate.bat new file mode 100644 index 00000000..c572b1f7 --- /dev/null +++ b/vendor/virtualenv-1.11.6/virtualenv_embedded/activate.bat @@ -0,0 +1,26 @@ +@echo off +set "VIRTUAL_ENV=__VIRTUAL_ENV__" + +if defined _OLD_VIRTUAL_PROMPT ( + set "PROMPT=%_OLD_VIRTUAL_PROMPT%" +) else ( + if not defined PROMPT ( + set "PROMPT=$P$G" + ) + set "_OLD_VIRTUAL_PROMPT=%PROMPT%" +) +set "PROMPT=__VIRTUAL_WINPROMPT__ %PROMPT%" + +if not defined _OLD_VIRTUAL_PYTHONHOME ( + set "_OLD_VIRTUAL_PYTHONHOME=%PYTHONHOME%" +) +set PYTHONHOME= + +if defined _OLD_VIRTUAL_PATH ( + set "PATH=%_OLD_VIRTUAL_PATH%" +) else ( + set "_OLD_VIRTUAL_PATH=%PATH%" +) +set "PATH=%VIRTUAL_ENV%\__BIN_NAME__;%PATH%" + +:END diff --git a/vendor/virtualenv-1.7/virtualenv_support/activate.csh b/vendor/virtualenv-1.11.6/virtualenv_embedded/activate.csh similarity index 72% rename from vendor/virtualenv-1.7/virtualenv_support/activate.csh rename to vendor/virtualenv-1.11.6/virtualenv_embedded/activate.csh index 20fe95d4..9db77443 100644 --- a/vendor/virtualenv-1.7/virtualenv_support/activate.csh +++ b/vendor/virtualenv-1.11.6/virtualenv_embedded/activate.csh @@ -2,9 +2,9 @@ # You cannot run it directly. # Created by Davide Di Blasi . -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' +alias deactivate 'test $?_OLD_VIRTUAL_PATH != 0 && setenv PATH "$_OLD_VIRTUAL_PATH" && unset _OLD_VIRTUAL_PATH; rehash; test $?_OLD_VIRTUAL_PROMPT != 0 && set prompt="$_OLD_VIRTUAL_PROMPT" && unset _OLD_VIRTUAL_PROMPT; unsetenv VIRTUAL_ENV; test "\!:*" != "nondestructive" && unalias deactivate && unalias pydoc' -# Unset irrelavent variables. +# Unset irrelevant variables. deactivate nondestructive setenv VIRTUAL_ENV "__VIRTUAL_ENV__" @@ -12,7 +12,7 @@ setenv VIRTUAL_ENV "__VIRTUAL_ENV__" set _OLD_VIRTUAL_PATH="$PATH" setenv PATH "$VIRTUAL_ENV/__BIN_NAME__:$PATH" -set _OLD_VIRTUAL_PROMPT="$prompt" + if ("__VIRTUAL_PROMPT__" != "") then set env_name = "__VIRTUAL_PROMPT__" @@ -25,8 +25,18 @@ else set env_name = `basename "$VIRTUAL_ENV"` endif endif -set prompt = "[$env_name] $prompt" + +# Could be in a non-interactive environment, +# in which case, $prompt is undefined and we wouldn't +# care about the prompt anyway. +if ( $?prompt ) then + set _OLD_VIRTUAL_PROMPT="$prompt" + set prompt = "[$env_name] $prompt" +endif + unset env_name +alias pydoc python -m pydoc + rehash diff --git a/vendor/virtualenv-1.11.6/virtualenv_embedded/activate.fish b/vendor/virtualenv-1.11.6/virtualenv_embedded/activate.fish new file mode 100644 index 00000000..eaa241d0 --- /dev/null +++ b/vendor/virtualenv-1.11.6/virtualenv_embedded/activate.fish @@ -0,0 +1,74 @@ +# This file must be used with "source bin/activate.fish" *from fish* (http://fishshell.com) +# 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" + # set an empty local fish_function_path, so fish_prompt doesn't automatically reload + set -l fish_function_path + # erase the virtualenv's fish_prompt function, and restore the original + functions -e fish_prompt + functions -c _old_fish_prompt fish_prompt + functions -e _old_fish_prompt + set -e _OLD_FISH_PROMPT_OVERRIDE + end + + set -e VIRTUAL_ENV + if test "$argv[1]" != "nondestructive" + # Self destruct! + functions -e deactivate + end +end + +# unset irrelevant 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 uses a function instead of an env var to generate the prompt. + + # copy the current fish_prompt function as the function _old_fish_prompt + functions -c fish_prompt _old_fish_prompt + + # with the original prompt function copied, we can override with our own. + function fish_prompt + # Prompt override? + if test -n "__VIRTUAL_PROMPT__" + printf "%s%s" "__VIRTUAL_PROMPT__" (set_color normal) + _old_fish_prompt + return + end + # ...Otherwise, prepend env + set -l _checkbase (basename "$VIRTUAL_ENV") + if test $_checkbase = "__" + # special case for Aspen magic directories + # see http://www.zetadev.com/software/aspen/ + printf "%s[%s]%s " (set_color -b blue white) (basename (dirname "$VIRTUAL_ENV")) (set_color normal) + _old_fish_prompt + else + printf "%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 diff --git a/vendor/virtualenv-1.11.6/virtualenv_embedded/activate.ps1 b/vendor/virtualenv-1.11.6/virtualenv_embedded/activate.ps1 new file mode 100644 index 00000000..e40ca1bf --- /dev/null +++ b/vendor/virtualenv-1.11.6/virtualenv_embedded/activate.ps1 @@ -0,0 +1,148 @@ +# This file must be dot sourced from PoSh; you cannot run it +# directly. Do this: . ./activate.ps1 + +# FIXME: clean up unused vars. +$script:THIS_PATH = $myinvocation.mycommand.path +$script:BASE_DIR = split-path (resolve-path "$THIS_PATH/..") -Parent +$script:DIR_NAME = split-path $BASE_DIR -Leaf + +function global:deactivate ( [switch] $NonDestructive ){ + + if ( test-path variable:_OLD_VIRTUAL_PATH ) { + $env:PATH = $variable:_OLD_VIRTUAL_PATH + remove-variable "_OLD_VIRTUAL_PATH" -scope global + } + + if ( test-path function:_old_virtual_prompt ) { + $function:prompt = $function:_old_virtual_prompt + remove-item function:\_old_virtual_prompt + } + + if ($env:VIRTUAL_ENV) { + $old_env = split-path $env:VIRTUAL_ENV -leaf + remove-item env:VIRTUAL_ENV -erroraction silentlycontinue + } + + if ( !$NonDestructive ) { + # Self destruct! + remove-item function:deactivate + } +} + +# unset irrelevant variables +deactivate -nondestructive + +$VIRTUAL_ENV = $BASE_DIR +$env:VIRTUAL_ENV = $VIRTUAL_ENV + +$global:_OLD_VIRTUAL_PATH = $env:PATH +$env:PATH = "$env:VIRTUAL_ENV/Scripts;" + $env:PATH +function global:_old_virtual_prompt { "" } +$function:_old_virtual_prompt = $function:prompt +function global:prompt { + # Add a prefix to the current prompt, but don't discard it. + write-host "($(split-path $env:VIRTUAL_ENV -leaf)) " -nonewline + & $function:_old_virtual_prompt +} + +# SIG # Begin signature block +# MIISeAYJKoZIhvcNAQcCoIISaTCCEmUCAQExCzAJBgUrDgMCGgUAMGkGCisGAQQB +# gjcCAQSgWzBZMDQGCisGAQQBgjcCAR4wJgIDAQAABBAfzDtgWUsITrck0sYpfvNR +# AgEAAgEAAgEAAgEAAgEAMCEwCQYFKw4DAhoFAAQUS5reBwSg3zOUwhXf2jPChZzf +# yPmggg6tMIIGcDCCBFigAwIBAgIBJDANBgkqhkiG9w0BAQUFADB9MQswCQYDVQQG +# EwJJTDEWMBQGA1UEChMNU3RhcnRDb20gTHRkLjErMCkGA1UECxMiU2VjdXJlIERp +# Z2l0YWwgQ2VydGlmaWNhdGUgU2lnbmluZzEpMCcGA1UEAxMgU3RhcnRDb20gQ2Vy +# dGlmaWNhdGlvbiBBdXRob3JpdHkwHhcNMDcxMDI0MjIwMTQ2WhcNMTcxMDI0MjIw +# MTQ2WjCBjDELMAkGA1UEBhMCSUwxFjAUBgNVBAoTDVN0YXJ0Q29tIEx0ZC4xKzAp +# BgNVBAsTIlNlY3VyZSBEaWdpdGFsIENlcnRpZmljYXRlIFNpZ25pbmcxODA2BgNV +# BAMTL1N0YXJ0Q29tIENsYXNzIDIgUHJpbWFyeSBJbnRlcm1lZGlhdGUgT2JqZWN0 +# IENBMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAyiOLIjUemqAbPJ1J +# 0D8MlzgWKbr4fYlbRVjvhHDtfhFN6RQxq0PjTQxRgWzwFQNKJCdU5ftKoM5N4YSj +# Id6ZNavcSa6/McVnhDAQm+8H3HWoD030NVOxbjgD/Ih3HaV3/z9159nnvyxQEckR +# ZfpJB2Kfk6aHqW3JnSvRe+XVZSufDVCe/vtxGSEwKCaNrsLc9pboUoYIC3oyzWoU +# TZ65+c0H4paR8c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g5SP9h2v/C4aTx8tyc6tE3TOPh2f9b8DL +# S+SbVArJpuJqrPTxDDoO1QNjTgLcdVYeZDE+r/NjaGZ6cMSd8db3EaG3ijD/0bud +# SItbm/OlNVbQOFRR76D+ZNgPcU5iNZ3bmvQQIg6aSB9MHUpIE/SeCkNl9YeVk1/1 +# GFULgNMRmIYP4KLvu9ylh5Gu3hvD5VNhH6+FlXANwFy07uXks5uF8mfZVxVCnodG +# xkNCx+6PsrA5Z7WP4pXcmYnMn97npP/Q9EHJWw== +# SIG # End signature block diff --git a/vendor/virtualenv-1.7/virtualenv_support/activate.sh b/vendor/virtualenv-1.11.6/virtualenv_embedded/activate.sh similarity index 92% rename from vendor/virtualenv-1.7/virtualenv_support/activate.sh rename to vendor/virtualenv-1.11.6/virtualenv_embedded/activate.sh index 45458c63..e50c7825 100644 --- a/vendor/virtualenv-1.7/virtualenv_support/activate.sh +++ b/vendor/virtualenv-1.11.6/virtualenv_embedded/activate.sh @@ -2,6 +2,8 @@ # you cannot run it directly deactivate () { + unset pydoc + # reset old environment variables if [ -n "$_OLD_VIRTUAL_PATH" ] ; then PATH="$_OLD_VIRTUAL_PATH" @@ -18,7 +20,7 @@ deactivate () { # 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 + hash -r 2>/dev/null fi if [ -n "$_OLD_VIRTUAL_PS1" ] ; then @@ -34,7 +36,7 @@ deactivate () { fi } -# unset irrelavent variables +# unset irrelevant variables deactivate nondestructive VIRTUAL_ENV="__VIRTUAL_ENV__" @@ -55,7 +57,7 @@ fi if [ -z "$VIRTUAL_ENV_DISABLE_PROMPT" ] ; then _OLD_VIRTUAL_PS1="$PS1" if [ "x__VIRTUAL_PROMPT__" != x ] ; then - PS1="__VIRTUAL_PROMPT__$PS1" + PS1="__VIRTUAL_PROMPT__$PS1" else if [ "`basename \"$VIRTUAL_ENV\"`" = "__" ] ; then # special case for Aspen magic directories @@ -68,9 +70,11 @@ if [ -z "$VIRTUAL_ENV_DISABLE_PROMPT" ] ; then export PS1 fi +alias pydoc="python -m pydoc" + # This should detect bash and zsh, which have a hash command that must # be called to get it to forget past commands. Without forgetting # past commands the $PATH changes we made may not be respected if [ -n "$BASH" -o -n "$ZSH_VERSION" ] ; then - hash -r + hash -r 2>/dev/null fi diff --git a/vendor/virtualenv-1.11.6/virtualenv_embedded/activate_this.py b/vendor/virtualenv-1.11.6/virtualenv_embedded/activate_this.py new file mode 100644 index 00000000..ea12c28a --- /dev/null +++ b/vendor/virtualenv-1.11.6/virtualenv_embedded/activate_this.py @@ -0,0 +1,34 @@ +"""By using execfile(this_file, dict(__file__=this_file)) you will +activate this virtualenv environment. + +This can be used when you must use an existing Python interpreter, not +the virtualenv bin/python +""" + +try: + __file__ +except NameError: + raise AssertionError( + "You must run this like execfile('path/to/activate_this.py', dict(__file__='path/to/activate_this.py'))") +import sys +import os + +old_os_path = os.environ['PATH'] +os.environ['PATH'] = os.path.dirname(os.path.abspath(__file__)) + os.pathsep + old_os_path +base = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) +if sys.platform == 'win32': + site_packages = os.path.join(base, 'Lib', 'site-packages') +else: + site_packages = os.path.join(base, 'lib', 'python%s' % sys.version[:3], 'site-packages') +prev_sys_path = list(sys.path) +import site +site.addsitedir(site_packages) +sys.real_prefix = sys.prefix +sys.prefix = base +# Move the added items to the front of the path: +new_sys_path = [] +for item in list(sys.path): + if item not in prev_sys_path: + new_sys_path.append(item) + sys.path.remove(item) +sys.path[:0] = new_sys_path diff --git a/vendor/virtualenv-1.11.6/virtualenv_embedded/deactivate.bat b/vendor/virtualenv-1.11.6/virtualenv_embedded/deactivate.bat new file mode 100644 index 00000000..fd4db264 --- /dev/null +++ b/vendor/virtualenv-1.11.6/virtualenv_embedded/deactivate.bat @@ -0,0 +1,20 @@ +@echo off + +set VIRTUAL_ENV= + +if defined _OLD_VIRTUAL_PROMPT ( + set "PROMPT=%_OLD_VIRTUAL_PROMPT%" + set _OLD_VIRTUAL_PROMPT= +) + +if defined _OLD_VIRTUAL_PYTHONHOME ( + set "PYTHONHOME=%_OLD_VIRTUAL_PYTHONHOME%" + set _OLD_VIRTUAL_PYTHONHOME= +) + +if defined _OLD_VIRTUAL_PATH ( + set "PATH=%_OLD_VIRTUAL_PATH%" + set _OLD_VIRTUAL_PATH= +) + +:END diff --git a/vendor/virtualenv-1.11.6/virtualenv_embedded/distutils-init.py b/vendor/virtualenv-1.11.6/virtualenv_embedded/distutils-init.py new file mode 100644 index 00000000..29fc1da4 --- /dev/null +++ b/vendor/virtualenv-1.11.6/virtualenv_embedded/distutils-init.py @@ -0,0 +1,101 @@ +import os +import sys +import warnings +import imp +import opcode # opcode is not a virtualenv module, so we can use it to find the stdlib + # Important! To work on pypy, this must be a module that resides in the + # lib-python/modified-x.y.z directory + +dirname = os.path.dirname + +distutils_path = os.path.join(os.path.dirname(opcode.__file__), 'distutils') +if os.path.normpath(distutils_path) == os.path.dirname(os.path.normpath(__file__)): + warnings.warn( + "The virtualenv distutils package at %s appears to be in the same location as the system distutils?") +else: + __path__.insert(0, distutils_path) + real_distutils = imp.load_module("_virtualenv_distutils", None, distutils_path, ('', '', imp.PKG_DIRECTORY)) + # Copy the relevant attributes + try: + __revision__ = real_distutils.__revision__ + except AttributeError: + pass + __version__ = real_distutils.__version__ + +from distutils import dist, sysconfig + +try: + basestring +except NameError: + basestring = str + +## patch build_ext (distutils doesn't know how to get the libs directory +## path on windows - it hardcodes the paths around the patched sys.prefix) + +if sys.platform == 'win32': + from distutils.command.build_ext import build_ext as old_build_ext + class build_ext(old_build_ext): + def finalize_options (self): + if self.library_dirs is None: + self.library_dirs = [] + elif isinstance(self.library_dirs, basestring): + self.library_dirs = self.library_dirs.split(os.pathsep) + + self.library_dirs.insert(0, os.path.join(sys.real_prefix, "Libs")) + old_build_ext.finalize_options(self) + + from distutils.command import build_ext as build_ext_module + build_ext_module.build_ext = build_ext + +## distutils.dist patches: + +old_find_config_files = dist.Distribution.find_config_files +def find_config_files(self): + found = old_find_config_files(self) + system_distutils = os.path.join(distutils_path, 'distutils.cfg') + #if os.path.exists(system_distutils): + # found.insert(0, system_distutils) + # What to call the per-user config file + if os.name == 'posix': + user_filename = ".pydistutils.cfg" + else: + user_filename = "pydistutils.cfg" + user_filename = os.path.join(sys.prefix, user_filename) + if os.path.isfile(user_filename): + for item in list(found): + if item.endswith('pydistutils.cfg'): + found.remove(item) + found.append(user_filename) + return found +dist.Distribution.find_config_files = find_config_files + +## distutils.sysconfig patches: + +old_get_python_inc = sysconfig.get_python_inc +def sysconfig_get_python_inc(plat_specific=0, prefix=None): + if prefix is None: + prefix = sys.real_prefix + return old_get_python_inc(plat_specific, prefix) +sysconfig_get_python_inc.__doc__ = old_get_python_inc.__doc__ +sysconfig.get_python_inc = sysconfig_get_python_inc + +old_get_python_lib = sysconfig.get_python_lib +def sysconfig_get_python_lib(plat_specific=0, standard_lib=0, prefix=None): + if standard_lib and prefix is None: + prefix = sys.real_prefix + return old_get_python_lib(plat_specific, standard_lib, prefix) +sysconfig_get_python_lib.__doc__ = old_get_python_lib.__doc__ +sysconfig.get_python_lib = sysconfig_get_python_lib + +old_get_config_vars = sysconfig.get_config_vars +def sysconfig_get_config_vars(*args): + real_vars = old_get_config_vars(*args) + if sys.platform == 'win32': + lib_dir = os.path.join(sys.real_prefix, "libs") + if isinstance(real_vars, dict) and 'LIBDIR' not in real_vars: + real_vars['LIBDIR'] = lib_dir # asked for all + elif isinstance(real_vars, list) and 'LIBDIR' in args: + real_vars = real_vars + [lib_dir] # asked for list + return real_vars +sysconfig_get_config_vars.__doc__ = old_get_config_vars.__doc__ +sysconfig.get_config_vars = sysconfig_get_config_vars diff --git a/vendor/virtualenv-1.7/virtualenv_support/distutils.cfg b/vendor/virtualenv-1.11.6/virtualenv_embedded/distutils.cfg similarity index 100% rename from vendor/virtualenv-1.7/virtualenv_support/distutils.cfg rename to vendor/virtualenv-1.11.6/virtualenv_embedded/distutils.cfg diff --git a/vendor/virtualenv-1.11.6/virtualenv_embedded/site.py b/vendor/virtualenv-1.11.6/virtualenv_embedded/site.py new file mode 100644 index 00000000..871a11ce --- /dev/null +++ b/vendor/virtualenv-1.11.6/virtualenv_embedded/site.py @@ -0,0 +1,758 @@ +"""Append module search paths for third-party packages to sys.path. + +**************************************************************** +* This module is automatically imported during initialization. * +**************************************************************** + +In earlier versions of Python (up to 1.5a3), scripts or modules that +needed to use site-specific modules would place ``import site'' +somewhere near the top of their code. Because of the automatic +import, this is no longer necessary (but code that does it still +works). + +This will append site-specific paths to the module search path. On +Unix, it starts with sys.prefix and sys.exec_prefix (if different) and +appends lib/python/site-packages as well as lib/site-python. +It also supports the Debian convention of +lib/python/dist-packages. On other platforms (mainly Mac and +Windows), it uses just sys.prefix (and sys.exec_prefix, if different, +but this is unlikely). The resulting directories, if they exist, are +appended to sys.path, and also inspected for path configuration files. + +FOR DEBIAN, this sys.path is augmented with directories in /usr/local. +Local addons go into /usr/local/lib/python/site-packages +(resp. /usr/local/lib/site-python), Debian addons install into +/usr/{lib,share}/python/dist-packages. + +A path configuration file is a file whose name has the form +.pth; its contents are additional directories (one per line) +to be added to sys.path. Non-existing directories (or +non-directories) are never added to sys.path; no directory is added to +sys.path more than once. Blank lines and lines beginning with +'#' are skipped. Lines starting with 'import' are executed. + +For example, suppose sys.prefix and sys.exec_prefix are set to +/usr/local and there is a directory /usr/local/lib/python2.X/site-packages +with three subdirectories, foo, bar and spam, and two path +configuration files, foo.pth and bar.pth. Assume foo.pth contains the +following: + + # foo package configuration + foo + bar + bletch + +and bar.pth contains: + + # bar package configuration + bar + +Then the following directories are added to sys.path, in this order: + + /usr/local/lib/python2.X/site-packages/bar + /usr/local/lib/python2.X/site-packages/foo + +Note that bletch is omitted because it doesn't exist; bar precedes foo +because bar.pth comes alphabetically before foo.pth; and spam is +omitted because it is not mentioned in either path configuration file. + +After these path manipulations, an attempt is made to import a module +named sitecustomize, which can perform arbitrary additional +site-specific customizations. If this import fails with an +ImportError exception, it is silently ignored. + +""" + +import sys +import os +try: + import __builtin__ as builtins +except ImportError: + import builtins +try: + set +except NameError: + from sets import Set as set + +# Prefixes for site-packages; add additional prefixes like /usr/local here +PREFIXES = [sys.prefix, sys.exec_prefix] +# Enable per user site-packages directory +# set it to False to disable the feature or True to force the feature +ENABLE_USER_SITE = None +# for distutils.commands.install +USER_SITE = None +USER_BASE = None + +_is_64bit = (getattr(sys, 'maxsize', None) or getattr(sys, 'maxint')) > 2**32 +_is_pypy = hasattr(sys, 'pypy_version_info') +_is_jython = sys.platform[:4] == 'java' +if _is_jython: + ModuleType = type(os) + +def makepath(*paths): + dir = os.path.join(*paths) + if _is_jython and (dir == '__classpath__' or + dir.startswith('__pyclasspath__')): + return dir, dir + dir = os.path.abspath(dir) + return dir, os.path.normcase(dir) + +def abs__file__(): + """Set all module' __file__ attribute to an absolute path""" + for m in sys.modules.values(): + if ((_is_jython and not isinstance(m, ModuleType)) or + hasattr(m, '__loader__')): + # only modules need the abspath in Jython. and don't mess + # with a PEP 302-supplied __file__ + continue + f = getattr(m, '__file__', None) + if f is None: + continue + m.__file__ = os.path.abspath(f) + +def removeduppaths(): + """ Remove duplicate entries from sys.path along with making them + absolute""" + # This ensures that the initial path provided by the interpreter contains + # only absolute pathnames, even if we're running from the build directory. + L = [] + known_paths = set() + for dir in sys.path: + # Filter out duplicate paths (on case-insensitive file systems also + # if they only differ in case); turn relative paths into absolute + # paths. + dir, dircase = makepath(dir) + if not dircase in known_paths: + L.append(dir) + known_paths.add(dircase) + sys.path[:] = L + return known_paths + +# XXX This should not be part of site.py, since it is needed even when +# using the -S option for Python. See http://www.python.org/sf/586680 +def addbuilddir(): + """Append ./build/lib. in case we're running in the build dir + (especially for Guido :-)""" + from distutils.util import get_platform + s = "build/lib.%s-%.3s" % (get_platform(), sys.version) + if hasattr(sys, 'gettotalrefcount'): + s += '-pydebug' + s = os.path.join(os.path.dirname(sys.path[-1]), s) + sys.path.append(s) + +def _init_pathinfo(): + """Return a set containing all existing directory entries from sys.path""" + d = set() + for dir in sys.path: + try: + if os.path.isdir(dir): + dir, dircase = makepath(dir) + d.add(dircase) + except TypeError: + continue + return d + +def addpackage(sitedir, name, known_paths): + """Add a new path to known_paths by combining sitedir and 'name' or execute + sitedir if it starts with 'import'""" + if known_paths is None: + _init_pathinfo() + reset = 1 + else: + reset = 0 + fullname = os.path.join(sitedir, name) + try: + f = open(fullname, "rU") + except IOError: + return + try: + for line in f: + if line.startswith("#"): + continue + if line.startswith("import"): + exec(line) + continue + line = line.rstrip() + dir, dircase = makepath(sitedir, line) + if not dircase in known_paths and os.path.exists(dir): + sys.path.append(dir) + known_paths.add(dircase) + finally: + f.close() + if reset: + known_paths = None + return known_paths + +def addsitedir(sitedir, known_paths=None): + """Add 'sitedir' argument to sys.path if missing and handle .pth files in + 'sitedir'""" + if known_paths is None: + known_paths = _init_pathinfo() + reset = 1 + else: + reset = 0 + sitedir, sitedircase = makepath(sitedir) + if not sitedircase in known_paths: + sys.path.append(sitedir) # Add path component + try: + names = os.listdir(sitedir) + except os.error: + return + names.sort() + for name in names: + if name.endswith(os.extsep + "pth"): + addpackage(sitedir, name, known_paths) + if reset: + known_paths = None + return known_paths + +def addsitepackages(known_paths, sys_prefix=sys.prefix, exec_prefix=sys.exec_prefix): + """Add site-packages (and possibly site-python) to sys.path""" + prefixes = [os.path.join(sys_prefix, "local"), sys_prefix] + if exec_prefix != sys_prefix: + prefixes.append(os.path.join(exec_prefix, "local")) + + for prefix in prefixes: + if prefix: + if sys.platform in ('os2emx', 'riscos') or _is_jython: + sitedirs = [os.path.join(prefix, "Lib", "site-packages")] + elif _is_pypy: + sitedirs = [os.path.join(prefix, 'site-packages')] + elif sys.platform == 'darwin' and prefix == sys_prefix: + + if prefix.startswith("/System/Library/Frameworks/"): # Apple's Python + + sitedirs = [os.path.join("/Library/Python", sys.version[:3], "site-packages"), + os.path.join(prefix, "Extras", "lib", "python")] + + else: # any other Python distros on OSX work this way + sitedirs = [os.path.join(prefix, "lib", + "python" + sys.version[:3], "site-packages")] + + elif os.sep == '/': + sitedirs = [os.path.join(prefix, + "lib", + "python" + sys.version[:3], + "site-packages"), + os.path.join(prefix, "lib", "site-python"), + os.path.join(prefix, "python" + sys.version[:3], "lib-dynload")] + lib64_dir = os.path.join(prefix, "lib64", "python" + sys.version[:3], "site-packages") + if (os.path.exists(lib64_dir) and + os.path.realpath(lib64_dir) not in [os.path.realpath(p) for p in sitedirs]): + if _is_64bit: + sitedirs.insert(0, lib64_dir) + else: + sitedirs.append(lib64_dir) + try: + # sys.getobjects only available in --with-pydebug build + sys.getobjects + sitedirs.insert(0, os.path.join(sitedirs[0], 'debug')) + except AttributeError: + pass + # Debian-specific dist-packages directories: + if sys.version[0] == '2': + sitedirs.append(os.path.join(prefix, "lib", + "python" + sys.version[:3], + "dist-packages")) + else: + sitedirs.append(os.path.join(prefix, "lib", + "python" + sys.version[0], + "dist-packages")) + sitedirs.append(os.path.join(prefix, "local/lib", + "python" + sys.version[:3], + "dist-packages")) + sitedirs.append(os.path.join(prefix, "lib", "dist-python")) + else: + sitedirs = [prefix, os.path.join(prefix, "lib", "site-packages")] + if sys.platform == 'darwin': + # for framework builds *only* we add the standard Apple + # locations. Currently only per-user, but /Library and + # /Network/Library could be added too + if 'Python.framework' in prefix: + home = os.environ.get('HOME') + if home: + sitedirs.append( + os.path.join(home, + 'Library', + 'Python', + sys.version[:3], + 'site-packages')) + for sitedir in sitedirs: + if os.path.isdir(sitedir): + addsitedir(sitedir, known_paths) + return None + +def check_enableusersite(): + """Check if user site directory is safe for inclusion + + The function tests for the command line flag (including environment var), + process uid/gid equal to effective uid/gid. + + None: Disabled for security reasons + False: Disabled by user (command line option) + True: Safe and enabled + """ + if hasattr(sys, 'flags') and getattr(sys.flags, 'no_user_site', False): + return False + + if hasattr(os, "getuid") and hasattr(os, "geteuid"): + # check process uid == effective uid + if os.geteuid() != os.getuid(): + return None + if hasattr(os, "getgid") and hasattr(os, "getegid"): + # check process gid == effective gid + if os.getegid() != os.getgid(): + return None + + return True + +def addusersitepackages(known_paths): + """Add a per user site-package to sys.path + + Each user has its own python directory with site-packages in the + home directory. + + USER_BASE is the root directory for all Python versions + + USER_SITE is the user specific site-packages directory + + USER_SITE/.. can be used for data. + """ + global USER_BASE, USER_SITE, ENABLE_USER_SITE + env_base = os.environ.get("PYTHONUSERBASE", None) + + def joinuser(*args): + return os.path.expanduser(os.path.join(*args)) + + #if sys.platform in ('os2emx', 'riscos'): + # # Don't know what to put here + # USER_BASE = '' + # USER_SITE = '' + if os.name == "nt": + base = os.environ.get("APPDATA") or "~" + if env_base: + USER_BASE = env_base + else: + USER_BASE = joinuser(base, "Python") + USER_SITE = os.path.join(USER_BASE, + "Python" + sys.version[0] + sys.version[2], + "site-packages") + else: + if env_base: + USER_BASE = env_base + else: + USER_BASE = joinuser("~", ".local") + USER_SITE = os.path.join(USER_BASE, "lib", + "python" + sys.version[:3], + "site-packages") + + if ENABLE_USER_SITE and os.path.isdir(USER_SITE): + addsitedir(USER_SITE, known_paths) + if ENABLE_USER_SITE: + for dist_libdir in ("lib", "local/lib"): + user_site = os.path.join(USER_BASE, dist_libdir, + "python" + sys.version[:3], + "dist-packages") + if os.path.isdir(user_site): + addsitedir(user_site, known_paths) + return known_paths + + + +def setBEGINLIBPATH(): + """The OS/2 EMX port has optional extension modules that do double duty + as DLLs (and must use the .DLL file extension) for other extensions. + The library search path needs to be amended so these will be found + during module import. Use BEGINLIBPATH so that these are at the start + of the library search path. + + """ + dllpath = os.path.join(sys.prefix, "Lib", "lib-dynload") + libpath = os.environ['BEGINLIBPATH'].split(';') + if libpath[-1]: + libpath.append(dllpath) + else: + libpath[-1] = dllpath + os.environ['BEGINLIBPATH'] = ';'.join(libpath) + + +def setquit(): + """Define new built-ins 'quit' and 'exit'. + These are simply strings that display a hint on how to exit. + + """ + if os.sep == ':': + eof = 'Cmd-Q' + elif os.sep == '\\': + eof = 'Ctrl-Z plus Return' + else: + eof = 'Ctrl-D (i.e. EOF)' + + class Quitter(object): + def __init__(self, name): + self.name = name + def __repr__(self): + return 'Use %s() or %s to exit' % (self.name, eof) + def __call__(self, code=None): + # Shells like IDLE catch the SystemExit, but listen when their + # stdin wrapper is closed. + try: + sys.stdin.close() + except: + pass + raise SystemExit(code) + builtins.quit = Quitter('quit') + builtins.exit = Quitter('exit') + + +class _Printer(object): + """interactive prompt objects for printing the license text, a list of + contributors and the copyright notice.""" + + MAXLINES = 23 + + def __init__(self, name, data, files=(), dirs=()): + self.__name = name + self.__data = data + self.__files = files + self.__dirs = dirs + self.__lines = None + + def __setup(self): + if self.__lines: + return + data = None + for dir in self.__dirs: + for filename in self.__files: + filename = os.path.join(dir, filename) + try: + fp = open(filename, "rU") + data = fp.read() + fp.close() + break + except IOError: + pass + if data: + break + if not data: + data = self.__data + self.__lines = data.split('\n') + self.__linecnt = len(self.__lines) + + def __repr__(self): + self.__setup() + if len(self.__lines) <= self.MAXLINES: + return "\n".join(self.__lines) + else: + return "Type %s() to see the full %s text" % ((self.__name,)*2) + + def __call__(self): + self.__setup() + prompt = 'Hit Return for more, or q (and Return) to quit: ' + lineno = 0 + while 1: + try: + for i in range(lineno, lineno + self.MAXLINES): + print(self.__lines[i]) + except IndexError: + break + else: + lineno += self.MAXLINES + key = None + while key is None: + try: + key = raw_input(prompt) + except NameError: + key = input(prompt) + if key not in ('', 'q'): + key = None + if key == 'q': + break + +def setcopyright(): + """Set 'copyright' and 'credits' in __builtin__""" + builtins.copyright = _Printer("copyright", sys.copyright) + if _is_jython: + builtins.credits = _Printer( + "credits", + "Jython is maintained by the Jython developers (www.jython.org).") + elif _is_pypy: + builtins.credits = _Printer( + "credits", + "PyPy is maintained by the PyPy developers: http://pypy.org/") + else: + builtins.credits = _Printer("credits", """\ + Thanks to CWI, CNRI, BeOpen.com, Zope Corporation and a cast of thousands + for supporting Python development. See www.python.org for more information.""") + here = os.path.dirname(os.__file__) + builtins.license = _Printer( + "license", "See http://www.python.org/%.3s/license.html" % sys.version, + ["LICENSE.txt", "LICENSE"], + [os.path.join(here, os.pardir), here, os.curdir]) + + +class _Helper(object): + """Define the built-in 'help'. + This is a wrapper around pydoc.help (with a twist). + + """ + + def __repr__(self): + return "Type help() for interactive help, " \ + "or help(object) for help about object." + def __call__(self, *args, **kwds): + import pydoc + return pydoc.help(*args, **kwds) + +def sethelper(): + builtins.help = _Helper() + +def aliasmbcs(): + """On Windows, some default encodings are not provided by Python, + while they are always available as "mbcs" in each locale. Make + them usable by aliasing to "mbcs" in such a case.""" + if sys.platform == 'win32': + import locale, codecs + enc = locale.getdefaultlocale()[1] + if enc.startswith('cp'): # "cp***" ? + try: + codecs.lookup(enc) + except LookupError: + import encodings + encodings._cache[enc] = encodings._unknown + encodings.aliases.aliases[enc] = 'mbcs' + +def setencoding(): + """Set the string encoding used by the Unicode implementation. The + default is 'ascii', but if you're willing to experiment, you can + change this.""" + encoding = "ascii" # Default value set by _PyUnicode_Init() + if 0: + # Enable to support locale aware default string encodings. + import locale + loc = locale.getdefaultlocale() + if loc[1]: + encoding = loc[1] + if 0: + # Enable to switch off string to Unicode coercion and implicit + # Unicode to string conversion. + encoding = "undefined" + if encoding != "ascii": + # On Non-Unicode builds this will raise an AttributeError... + sys.setdefaultencoding(encoding) # Needs Python Unicode build ! + + +def execsitecustomize(): + """Run custom site specific code, if available.""" + try: + import sitecustomize + except ImportError: + pass + +def virtual_install_main_packages(): + f = open(os.path.join(os.path.dirname(__file__), 'orig-prefix.txt')) + sys.real_prefix = f.read().strip() + f.close() + pos = 2 + hardcoded_relative_dirs = [] + if sys.path[0] == '': + pos += 1 + if _is_jython: + paths = [os.path.join(sys.real_prefix, 'Lib')] + elif _is_pypy: + if sys.version_info > (3, 2): + cpyver = '%d' % sys.version_info[0] + elif sys.pypy_version_info >= (1, 5): + cpyver = '%d.%d' % sys.version_info[:2] + else: + cpyver = '%d.%d.%d' % sys.version_info[:3] + paths = [os.path.join(sys.real_prefix, 'lib_pypy'), + os.path.join(sys.real_prefix, 'lib-python', cpyver)] + if sys.pypy_version_info < (1, 9): + paths.insert(1, os.path.join(sys.real_prefix, + 'lib-python', 'modified-%s' % cpyver)) + hardcoded_relative_dirs = paths[:] # for the special 'darwin' case below + # + # This is hardcoded in the Python executable, but relative to sys.prefix: + for path in paths[:]: + plat_path = os.path.join(path, 'plat-%s' % sys.platform) + if os.path.exists(plat_path): + paths.append(plat_path) + elif sys.platform == 'win32': + paths = [os.path.join(sys.real_prefix, 'Lib'), os.path.join(sys.real_prefix, 'DLLs')] + else: + paths = [os.path.join(sys.real_prefix, 'lib', 'python'+sys.version[:3])] + hardcoded_relative_dirs = paths[:] # for the special 'darwin' case below + lib64_path = os.path.join(sys.real_prefix, 'lib64', 'python'+sys.version[:3]) + if os.path.exists(lib64_path): + if _is_64bit: + paths.insert(0, lib64_path) + else: + paths.append(lib64_path) + # This is hardcoded in the Python executable, but relative to + # sys.prefix. Debian change: we need to add the multiarch triplet + # here, which is where the real stuff lives. As per PEP 421, in + # Python 3.3+, this lives in sys.implementation, while in Python 2.7 + # it lives in sys. + try: + arch = getattr(sys, 'implementation', sys)._multiarch + except AttributeError: + # This is a non-multiarch aware Python. Fallback to the old way. + arch = sys.platform + plat_path = os.path.join(sys.real_prefix, 'lib', + 'python'+sys.version[:3], + 'plat-%s' % arch) + if os.path.exists(plat_path): + paths.append(plat_path) + # This is hardcoded in the Python executable, but + # relative to sys.prefix, so we have to fix up: + for path in list(paths): + tk_dir = os.path.join(path, 'lib-tk') + if os.path.exists(tk_dir): + paths.append(tk_dir) + + # These are hardcoded in the Apple's Python executable, + # but relative to sys.prefix, so we have to fix them up: + if sys.platform == 'darwin': + hardcoded_paths = [os.path.join(relative_dir, module) + for relative_dir in hardcoded_relative_dirs + for module in ('plat-darwin', 'plat-mac', 'plat-mac/lib-scriptpackages')] + + for path in hardcoded_paths: + if os.path.exists(path): + paths.append(path) + + sys.path.extend(paths) + +def force_global_eggs_after_local_site_packages(): + """ + Force easy_installed eggs in the global environment to get placed + in sys.path after all packages inside the virtualenv. This + maintains the "least surprise" result that packages in the + virtualenv always mask global packages, never the other way + around. + + """ + egginsert = getattr(sys, '__egginsert', 0) + for i, path in enumerate(sys.path): + if i > egginsert and path.startswith(sys.prefix): + egginsert = i + sys.__egginsert = egginsert + 1 + +def virtual_addsitepackages(known_paths): + force_global_eggs_after_local_site_packages() + return addsitepackages(known_paths, sys_prefix=sys.real_prefix) + +def fixclasspath(): + """Adjust the special classpath sys.path entries for Jython. These + entries should follow the base virtualenv lib directories. + """ + paths = [] + classpaths = [] + for path in sys.path: + if path == '__classpath__' or path.startswith('__pyclasspath__'): + classpaths.append(path) + else: + paths.append(path) + sys.path = paths + sys.path.extend(classpaths) + +def execusercustomize(): + """Run custom user specific code, if available.""" + try: + import usercustomize + except ImportError: + pass + + +def main(): + global ENABLE_USER_SITE + virtual_install_main_packages() + abs__file__() + paths_in_sys = removeduppaths() + if (os.name == "posix" and sys.path and + os.path.basename(sys.path[-1]) == "Modules"): + addbuilddir() + if _is_jython: + fixclasspath() + GLOBAL_SITE_PACKAGES = not os.path.exists(os.path.join(os.path.dirname(__file__), 'no-global-site-packages.txt')) + if not GLOBAL_SITE_PACKAGES: + ENABLE_USER_SITE = False + if ENABLE_USER_SITE is None: + ENABLE_USER_SITE = check_enableusersite() + paths_in_sys = addsitepackages(paths_in_sys) + paths_in_sys = addusersitepackages(paths_in_sys) + if GLOBAL_SITE_PACKAGES: + paths_in_sys = virtual_addsitepackages(paths_in_sys) + if sys.platform == 'os2emx': + setBEGINLIBPATH() + setquit() + setcopyright() + sethelper() + aliasmbcs() + setencoding() + execsitecustomize() + if ENABLE_USER_SITE: + execusercustomize() + # Remove sys.setdefaultencoding() so that users cannot change the + # encoding after initialization. The test for presence is needed when + # this module is run as a script, because this code is executed twice. + if hasattr(sys, "setdefaultencoding"): + del sys.setdefaultencoding + +main() + +def _script(): + help = """\ + %s [--user-base] [--user-site] + + Without arguments print some useful information + With arguments print the value of USER_BASE and/or USER_SITE separated + by '%s'. + + Exit codes with --user-base or --user-site: + 0 - user site directory is enabled + 1 - user site directory is disabled by user + 2 - uses site directory is disabled by super user + or for security reasons + >2 - unknown error + """ + args = sys.argv[1:] + if not args: + print("sys.path = [") + for dir in sys.path: + print(" %r," % (dir,)) + print("]") + def exists(path): + if os.path.isdir(path): + return "exists" + else: + return "doesn't exist" + print("USER_BASE: %r (%s)" % (USER_BASE, exists(USER_BASE))) + print("USER_SITE: %r (%s)" % (USER_SITE, exists(USER_BASE))) + print("ENABLE_USER_SITE: %r" % ENABLE_USER_SITE) + sys.exit(0) + + buffer = [] + if '--user-base' in args: + buffer.append(USER_BASE) + if '--user-site' in args: + buffer.append(USER_SITE) + + if buffer: + print(os.pathsep.join(buffer)) + if ENABLE_USER_SITE: + sys.exit(0) + elif ENABLE_USER_SITE is False: + sys.exit(1) + elif ENABLE_USER_SITE is None: + sys.exit(2) + else: + sys.exit(3) + else: + import textwrap + print(textwrap.dedent(help % (sys.argv[0], os.pathsep))) + sys.exit(10) + +if __name__ == '__main__': + _script() diff --git a/vendor/virtualenv-1.7/tests/__init__.py b/vendor/virtualenv-1.11.6/virtualenv_support/__init__.py similarity index 100% rename from vendor/virtualenv-1.7/tests/__init__.py rename to vendor/virtualenv-1.11.6/virtualenv_support/__init__.py diff --git a/vendor/virtualenv-1.11.6/virtualenv_support/pip-1.5.6-py2.py3-none-any.whl b/vendor/virtualenv-1.11.6/virtualenv_support/pip-1.5.6-py2.py3-none-any.whl new file mode 100644 index 00000000..097ab434 Binary files /dev/null and b/vendor/virtualenv-1.11.6/virtualenv_support/pip-1.5.6-py2.py3-none-any.whl differ diff --git a/vendor/virtualenv-1.11.6/virtualenv_support/setuptools-3.6-py2.py3-none-any.whl b/vendor/virtualenv-1.11.6/virtualenv_support/setuptools-3.6-py2.py3-none-any.whl new file mode 100644 index 00000000..f0ffcfce Binary files /dev/null and b/vendor/virtualenv-1.11.6/virtualenv_support/setuptools-3.6-py2.py3-none-any.whl differ diff --git a/vendor/virtualenv-1.7/AUTHORS.txt b/vendor/virtualenv-1.7/AUTHORS.txt deleted file mode 100644 index 093a83b8..00000000 --- a/vendor/virtualenv-1.7/AUTHORS.txt +++ /dev/null @@ -1,33 +0,0 @@ -Author ------- - -Ian Bicking - -Maintainers ------------ - -Brian Rosner -Carl Meyer -Jannis Leidel - -Contributors ------------- - -Alex Grönholm -Antonio Cuni -Armin Ronacher -Chris McDonough -Christian Stefanescu -Christopher Nilsson -Curt Micol -Douglas Creager -Gunnlaugur Thor Briem -Jeff Hammel -Jorge Vargas -Josh Bronson -Kumar McMillan -Lars Francke -Philip Jenvey -Ronny Pfannschmidt -Tarek Ziadé -Vinay Sajip diff --git a/vendor/virtualenv-1.7/HACKING b/vendor/virtualenv-1.7/HACKING deleted file mode 100644 index 4eb6da73..00000000 --- a/vendor/virtualenv-1.7/HACKING +++ /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/ diff --git a/vendor/virtualenv-1.7/MANIFEST.in b/vendor/virtualenv-1.7/MANIFEST.in deleted file mode 100644 index cce54a63..00000000 --- a/vendor/virtualenv-1.7/MANIFEST.in +++ /dev/null @@ -1,9 +0,0 @@ -recursive-include docs *.txt -recursive-include scripts * -recursive-include virtualenv_support *.egg *.tar.gz -recursive-exclude virtualenv_support *.py -recursive-exclude docs/_templates *.* -include virtualenv_support/__init__.py -include *.py -include AUTHORS.txt -include LICENSE.txt \ No newline at end of file diff --git a/vendor/virtualenv-1.7/PKG-INFO b/vendor/virtualenv-1.7/PKG-INFO deleted file mode 100644 index cd83aa0e..00000000 --- a/vendor/virtualenv-1.7/PKG-INFO +++ /dev/null @@ -1,906 +0,0 @@ -Metadata-Version: 1.0 -Name: virtualenv -Version: 1.7 -Summary: Virtual Python Environment builder -Home-page: http://www.virtualenv.org -Author: Jannis Leidel, Carl Meyer and Brian Rosner -Author-email: python-virtualenv@groups.google.com -License: MIT -Description: - - Status and License - ------------------ - - ``virtualenv`` is a successor to `workingenv - `_, and an extension - of `virtual-python - `_. - - It was written by Ian Bicking, sponsored by the `Open Planning - Project `_ and is now maintained by a - `group of developers `_. - It is licensed under an - `MIT-style permissive license `_. - - You can install it with ``pip install virtualenv``, or the `latest - development version `_ - 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 - `_ or `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 `_ - 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_``. 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 `_ library installed. - - PyPy Support - ~~~~~~~~~~~~ - - Beginning with virtualenv version 1.5 `PyPy `_ 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 - `_. - - 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 - `_ or `mod_wsgi `_ - 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 - `_ (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 - `_ - 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 `_ 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 - `_. - - * `Blog announcement - `_. - - * Doug Hellmann wrote a description of his `command-line work flow - using virtualenv (virtualenvwrapper) - `_ - including some handy scripts to make working with multiple - environments easier. He also wrote `an example of using virtualenv - to try IPython - `_. - - * Chris Perkins created a `showmedo video including virtualenv - `_. - - * `Using virtualenv with mod_wsgi - `_. - - * `virtualenv commands - `_ 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 `_ - 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 - `_ 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 - `_ - (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 `_. - * 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! - -Keywords: setuptools deployment installation distutils -Platform: UNKNOWN -Classifier: Development Status :: 4 - Beta -Classifier: Intended Audience :: Developers -Classifier: License :: OSI Approved :: MIT License -Classifier: Programming Language :: Python :: 2 -Classifier: Programming Language :: Python :: 2.4 -Classifier: Programming Language :: Python :: 2.5 -Classifier: Programming Language :: Python :: 2.6 -Classifier: Programming Language :: Python :: 2.7 -Classifier: Programming Language :: Python :: 3 -Classifier: Programming Language :: Python :: 3.1 -Classifier: Programming Language :: Python :: 3.2 diff --git a/vendor/virtualenv-1.7/bin/refresh-support-files.py b/vendor/virtualenv-1.7/bin/refresh-support-files.py deleted file mode 100755 index 866b9d53..00000000 --- a/vendor/virtualenv-1.7/bin/refresh-support-files.py +++ /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/vendor/virtualenv-1.7/docs/_theme/nature/static/nature.css_t b/vendor/virtualenv-1.7/docs/_theme/nature/static/nature.css_t deleted file mode 100644 index 03b0379d..00000000 --- a/vendor/virtualenv-1.7/docs/_theme/nature/static/nature.css_t +++ /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/vendor/virtualenv-1.7/docs/_theme/nature/static/pygments.css b/vendor/virtualenv-1.7/docs/_theme/nature/static/pygments.css deleted file mode 100644 index 652b7612..00000000 --- a/vendor/virtualenv-1.7/docs/_theme/nature/static/pygments.css +++ /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/vendor/virtualenv-1.7/docs/_theme/nature/theme.conf b/vendor/virtualenv-1.7/docs/_theme/nature/theme.conf deleted file mode 100644 index 1cc40044..00000000 --- a/vendor/virtualenv-1.7/docs/_theme/nature/theme.conf +++ /dev/null @@ -1,4 +0,0 @@ -[theme] -inherit = basic -stylesheet = nature.css -pygments_style = tango diff --git a/vendor/virtualenv-1.7/setup.py b/vendor/virtualenv-1.7/setup.py deleted file mode 100644 index 6e6cdd88..00000000 --- a/vendor/virtualenv-1.7/setup.py +++ /dev/null @@ -1,58 +0,0 @@ -import sys, os -try: - from setuptools import setup - kw = {'entry_points': - """[console_scripts]\nvirtualenv = virtualenv:main\n""", - 'zip_safe': False} -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 = {} - 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', - '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 - ) diff --git a/vendor/virtualenv-1.7/tests/test_virtualenv.py b/vendor/virtualenv-1.7/tests/test_virtualenv.py deleted file mode 100644 index 3752e155..00000000 --- a/vendor/virtualenv-1.7/tests/test_virtualenv.py +++ /dev/null @@ -1,50 +0,0 @@ -import virtualenv -from mock import patch, Mock - - -def test_version(): - """Should have a version string""" - assert virtualenv.virtualenv_version == "1.7", "Should have version" - - -@patch('os.path.exists') -def test_resolve_interpreter_with_absolute_path(mock_exists): - """Should return absolute path if given and exists""" - mock_exists.return_value = True - virtualenv.is_executable = Mock(return_value=True) - - exe = virtualenv.resolve_interpreter("/usr/bin/python42") - - 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") - - -@patch('os.path.exists') -def test_resolve_intepreter_with_nonexistant_interpreter(mock_exists): - """Should exit when with absolute path if not exists""" - mock_exists.return_value = False - - try: - virtualenv.resolve_interpreter("/usr/bin/python42") - assert False, "Should raise exception" - except SystemExit: - pass - - mock_exists.assert_called_with("/usr/bin/python42") - - -@patch('os.path.exists') -def test_resolve_intepreter_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) - - try: - virtualenv.resolve_interpreter("/usr/bin/python42") - assert False, "Should raise exception" - except SystemExit: - pass - - mock_exists.assert_called_with("/usr/bin/python42") - virtualenv.is_executable.assert_called_with("/usr/bin/python42") diff --git a/vendor/virtualenv-1.7/virtualenv.egg-info/PKG-INFO b/vendor/virtualenv-1.7/virtualenv.egg-info/PKG-INFO deleted file mode 100644 index cd83aa0e..00000000 --- a/vendor/virtualenv-1.7/virtualenv.egg-info/PKG-INFO +++ /dev/null @@ -1,906 +0,0 @@ -Metadata-Version: 1.0 -Name: virtualenv -Version: 1.7 -Summary: Virtual Python Environment builder -Home-page: http://www.virtualenv.org -Author: Jannis Leidel, Carl Meyer and Brian Rosner -Author-email: python-virtualenv@groups.google.com -License: MIT -Description: - - Status and License - ------------------ - - ``virtualenv`` is a successor to `workingenv - `_, and an extension - of `virtual-python - `_. - - It was written by Ian Bicking, sponsored by the `Open Planning - Project `_ and is now maintained by a - `group of developers `_. - It is licensed under an - `MIT-style permissive license `_. - - You can install it with ``pip install virtualenv``, or the `latest - development version `_ - 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 - `_ or `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 `_ - 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_``. 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 `_ library installed. - - PyPy Support - ~~~~~~~~~~~~ - - Beginning with virtualenv version 1.5 `PyPy `_ 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 - `_. - - 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 - `_ or `mod_wsgi `_ - 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 - `_ (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 - `_ - 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 `_ 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 - `_. - - * `Blog announcement - `_. - - * Doug Hellmann wrote a description of his `command-line work flow - using virtualenv (virtualenvwrapper) - `_ - including some handy scripts to make working with multiple - environments easier. He also wrote `an example of using virtualenv - to try IPython - `_. - - * Chris Perkins created a `showmedo video including virtualenv - `_. - - * `Using virtualenv with mod_wsgi - `_. - - * `virtualenv commands - `_ 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 `_ - 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 - `_ 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 - `_ - (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 `_. - * 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! - -Keywords: setuptools deployment installation distutils -Platform: UNKNOWN -Classifier: Development Status :: 4 - Beta -Classifier: Intended Audience :: Developers -Classifier: License :: OSI Approved :: MIT License -Classifier: Programming Language :: Python :: 2 -Classifier: Programming Language :: Python :: 2.4 -Classifier: Programming Language :: Python :: 2.5 -Classifier: Programming Language :: Python :: 2.6 -Classifier: Programming Language :: Python :: 2.7 -Classifier: Programming Language :: Python :: 3 -Classifier: Programming Language :: Python :: 3.1 -Classifier: Programming Language :: Python :: 3.2 diff --git a/vendor/virtualenv-1.7/virtualenv.egg-info/SOURCES.txt b/vendor/virtualenv-1.7/virtualenv.egg-info/SOURCES.txt deleted file mode 100644 index b0735013..00000000 --- a/vendor/virtualenv-1.7/virtualenv.egg-info/SOURCES.txt +++ /dev/null @@ -1,38 +0,0 @@ -AUTHORS.txt -HACKING -LICENSE.txt -MANIFEST.in -setup.py -virtualenv.py -bin/rebuild-script.py -bin/refresh-support-files.py -docs/Makefile -docs/conf.py -docs/index.txt -docs/make.bat -docs/news.txt -docs/_theme/nature/theme.conf -docs/_theme/nature/static/nature.css_t -docs/_theme/nature/static/pygments.css -scripts/virtualenv -tests/__init__.py -tests/test_virtualenv.py -virtualenv.egg-info/PKG-INFO -virtualenv.egg-info/SOURCES.txt -virtualenv.egg-info/dependency_links.txt -virtualenv.egg-info/entry_points.txt -virtualenv.egg-info/not-zip-safe -virtualenv.egg-info/top_level.txt -virtualenv_support/__init__.py -virtualenv_support/activate.bat -virtualenv_support/activate.csh -virtualenv_support/activate.fish -virtualenv_support/activate.sh -virtualenv_support/deactivate.bat -virtualenv_support/distribute-0.6.24.tar.gz -virtualenv_support/distutils.cfg -virtualenv_support/pip-1.0.2.tar.gz -virtualenv_support/setuptools-0.6c11-py2.4.egg -virtualenv_support/setuptools-0.6c11-py2.5.egg -virtualenv_support/setuptools-0.6c11-py2.6.egg -virtualenv_support/setuptools-0.6c11-py2.7.egg \ No newline at end of file diff --git a/vendor/virtualenv-1.7/virtualenv.py b/vendor/virtualenv-1.7/virtualenv.py deleted file mode 100755 index 5b4951db..00000000 --- a/vendor/virtualenv-1.7/virtualenv.py +++ /dev/null @@ -1,2102 +0,0 @@ -#!/usr/bin/env python -"""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 base64 -import sys -import os -import optparse -import re -import shutil -import logging -import tempfile -import zlib -import errno -import distutils.sysconfig -from distutils.util import strtobool - -try: - import subprocess -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 -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') -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 - default_storage_dir = os.path.join(user_dir, 'virtualenv') -else: - default_storage_dir = os.path.join(user_dir, '.virtualenv') -default_config_file = os.path.join(default_storage_dir, 'virtualenv.ini') - -if is_pypy: - expected_exe = 'pypy' -elif is_jython: - expected_exe = 'jython' -else: - expected_exe = 'python' - - -REQUIRED_MODULES = ['os', 'posix', 'posixpath', 'nt', 'ntpath', 'genericpath', - 'fnmatch', 'locale', 'encodings', 'codecs', - 'stat', 'UserDict', 'readline', 'copy_reg', 'types', - 're', 'sre', 'sre_parse', 'sre_constants', 'sre_compile', - 'zlib'] - -REQUIRED_FILES = ['lib-dynload', 'config'] - -majver, minver = sys.version_info[:2] -if majver == 2: - if minver >= 6: - 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']) - 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. - 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", - ]) - -if is_pypy: - # these are needed to correctly display the exceptions that may happen - # during the bootstrap - REQUIRED_MODULES.extend(['traceback', 'linecache']) - -class Logger(object): - - """ - Logging object for use in command-line script. Allows ranges of - levels, to avoid some redundancy of displayed information. - """ - - DEBUG = logging.DEBUG - INFO = logging.INFO - NOTIFY = (logging.INFO+logging.WARN)/2 - WARN = WARNING = logging.WARN - ERROR = logging.ERROR - FATAL = logging.FATAL - - LEVELS = [DEBUG, INFO, NOTIFY, WARN, ERROR, FATAL] - - def __init__(self, consumers): - self.consumers = consumers - self.indent = 0 - self.in_progress = None - self.in_progress_hanging = False - - 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) - def fatal(self, msg, *args, **kw): - self.log(self.FATAL, msg, *args, **kw) - def log(self, level, msg, *args, **kw): - if args: - if kw: - raise TypeError( - "You may give positional or keyword arguments, not both") - args = args or kw - rendered = None - for consumer_level, consumer in self.consumers: - if self.level_matches(level, consumer_level): - if (self.in_progress_hanging - and consumer in (sys.stdout, sys.stderr)): - self.in_progress_hanging = False - sys.stdout.write('\n') - sys.stdout.flush() - if rendered is None: - if args: - rendered = msg % args - else: - rendered = msg - rendered = ' '*self.indent + rendered - if hasattr(consumer, 'write'): - consumer.write(rendered+'\n') - else: - consumer(rendered) - - def start_progress(self, msg): - assert not self.in_progress, ( - "Tried to start_progress(%r) while in_progress %r" - % (msg, self.in_progress)) - if self.level_matches(self.NOTIFY, self._stdout_level()): - sys.stdout.write(msg) - sys.stdout.flush() - self.in_progress_hanging = True - else: - self.in_progress_hanging = False - self.in_progress = msg - - def end_progress(self, msg='done.'): - assert self.in_progress, ( - "Tried to end_progress without start_progress") - if self.stdout_level_matches(self.NOTIFY): - if not self.in_progress_hanging: - # Some message has been printed out since start_progress - sys.stdout.write('...' + self.in_progress + msg + '\n') - sys.stdout.flush() - else: - sys.stdout.write(msg + '\n') - sys.stdout.flush() - self.in_progress = None - self.in_progress_hanging = False - - def show_progress(self): - """If we are in a progress scope, and no log messages have been - shown, write out another '.'""" - if self.in_progress_hanging: - sys.stdout.write('.') - sys.stdout.flush() - - def stdout_level_matches(self, level): - """Returns true if a message at this level will go to stdout""" - return self.level_matches(level, self._stdout_level()) - - def _stdout_level(self): - """Returns the level that stdout runs at""" - for level, consumer in self.consumers: - if consumer is sys.stdout: - return level - return self.FATAL - - def level_matches(self, level, consumer_level): - """ - >>> l = Logger([]) - >>> l.level_matches(3, 4) - False - >>> l.level_matches(3, 2) - True - >>> l.level_matches(slice(None, 3), 3) - False - >>> l.level_matches(slice(None, 3), 2) - True - >>> l.level_matches(slice(1, 3), 1) - True - >>> l.level_matches(slice(2, 3), 1) - False - """ - if isinstance(level, slice): - start, stop = level.start, level.stop - if start is not None and start > consumer_level: - return False - if stop is not None and stop <= consumer_level: - return False - return True - else: - return level >= consumer_level - - #@classmethod - def level_for_integer(cls, level): - levels = cls.LEVELS - if level < 0: - return levels[0] - if level >= len(levels): - 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)]) - -def mkdir(path): - if not os.path.exists(path): - logger.info('Creating %s', path) - os.makedirs(path) - else: - logger.info('Directory %s already exists', path) - -def copyfileordir(src, dest): - if os.path.isdir(src): - shutil.copytree(src, dest, True) - else: - shutil.copy2(src, dest) - -def copyfile(src, dest, symlink=True): - if not os.path.exists(src): - # Some bad symlink in the src - logger.warn('Cannot find file %s (bad symlink)', src) - return - if os.path.exists(dest): - 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)) - 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'): - logger.info('Symlinking %s', dest) - try: - os.symlink(srcpath, dest) - except (OSError, NotImplementedError): - logger.info('Symlinking failed, copying to %s', dest) - copyfileordir(src, dest) - else: - logger.info('Copying to %s', dest) - copyfileordir(src, dest) - -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() - return - else: - f = open(dest, 'rb') - c = f.read() - f.close() - if c != content: - 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() - else: - logger.info('Content %s already in place', dest) - -def rmtree(dir): - if os.path.exists(dir): - logger.notify('Deleting tree %s', dir) - shutil.rmtree(dir) - else: - logger.info('Do not need to delete %s; already gone', dir) - -def make_exe(fn): - if hasattr(os, 'chmod'): - oldmode = os.stat(fn).st_mode & 0xFFF # 0o7777 - newmode = (oldmode | 0x16D) & 0xFFF # 0o555, 0o7777 - os.chmod(fn, newmode) - 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) - -def file_search_dirs(): - here = os.path.dirname(os.path.abspath(__file__)) - 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: - import virtualenv - except ImportError: - pass - else: - 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): - """ - Custom help formatter for use in ConfigOptionParser that updates - the defaults before expanding them, allowing them to show up correctly - in the help listing - """ - def expand_default(self, option): - if self.parser is not None: - self.parser.update_defaults(self.parser.defaults) - return optparse.IndentedHelpFormatter.expand_default(self, option) - - -class ConfigOptionParser(optparse.OptionParser): - """ - Custom option parser which updates its defaults by by checking the - configuration files and environmental variables - """ - def __init__(self, *args, **kwargs): - self.config = ConfigParser.RawConfigParser() - self.files = self.get_config_files() - self.config.read(self.files) - optparse.OptionParser.__init__(self, *args, **kwargs) - - def get_config_files(self): - config_file = os.environ.get('VIRTUALENV_CONFIG_FILE', False) - if config_file and os.path.exists(config_file): - return [config_file] - return [default_config_file] - - def update_defaults(self, defaults): - """ - Updates the given defaults with values from the config files and - the environ. Does a little special handling for certain types of - options (lists). - """ - # Then go and look for the other sources of configuration: - config = {} - # 1. config files - config.update(dict(self.get_config_section('virtualenv'))) - # 2. environmental variables - config.update(dict(self.get_environ_vars())) - # Then set the options with those values - for key, val in config.items(): - key = key.replace('_', '-') - if not key.startswith('--'): - key = '--%s' % key # only prefer long opts - option = self.get_option(key) - if option is not None: - # ignore empty values - if not val: - continue - # handle multiline configs - if option.action == 'append': - val = val.split() - else: - option.nargs = 1 - if option.action in ('store_true', 'store_false', '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) - sys.exit(3) - defaults[option.dest] = val - return defaults - - def get_config_section(self, name): - """ - Get a section of a configuration - """ - if self.config.has_section(name): - return self.config.items(name) - return [] - - def get_environ_vars(self, prefix='VIRTUALENV_'): - """ - Returns a generator with all environmental vars with prefix VIRTUALENV - """ - for key, val in os.environ.items(): - if key.startswith(prefix): - yield (key.replace(prefix, '').lower(), val) - - def get_default_values(self): - """ - Overridding to make updating the defaults after instantiation of - the option parser possible, update_defaults() does the dirty work. - """ - if not self.process_default_values: - # Old, pre-Optik 1.5 behaviour. - return optparse.Values(self.defaults) - - defaults = self.update_defaults(self.defaults.copy()) # ours - for option in self._get_all_options(): - default = defaults.get(option.dest) - if isinstance(default, basestring): - opt_str = option.get_opt_string() - defaults[option.dest] = option.check_value(opt_str, default) - return optparse.Values(defaults) - - -def main(): - parser = ConfigOptionParser( - version=virtualenv_version, - usage="%prog [OPTIONS] DEST_DIR", - formatter=UpdatingDefaultsHelpFormatter()) - - parser.add_option( - '-v', '--verbose', - action='count', - dest='verbose', - default=0, - help="Increase verbosity") - - parser.add_option( - '-q', '--quiet', - action='count', - dest='quiet', - default=0, - help='Decrease verbosity') - - parser.add_option( - '-p', '--python', - dest='python', - metavar='PYTHON_EXE', - help='The Python interpreter to use, e.g., --python=python2.5 will use the python2.5 ' - 'interpreter to create the new environment. The default is the interpreter that ' - 'virtualenv was installed with (%s)' % sys.executable) - - parser.add_option( - '--clear', - dest='clear', - action='store_true', - help="Clear out the non-root install and start from scratch") - - 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") - - 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") - - parser.add_option( - '--unzip-setuptools', - dest='unzip_setuptools', - action='store_true', - help="Unzip Setuptools or Distribute 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') - - parser.add_option( - '--distribute', - dest='use_distribute', - action='store_true', - help='Use Distribute instead of Setuptools. Set environ variable ' - 'VIRTUALENV_DISTRIBUTE to make it the default ') - - default_search_dirs = file_search_dirs() - parser.add_option( - '--extra-search-dir', - dest="search_dirs", - action="append", - 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.") - - parser.add_option( - '--never-download', - dest="never_download", - action="store_true", - help="Never download anything from the network. Instead, virtualenv will fail " - "if local distributions of setuptools/distribute/pip are not present.") - - parser.add_option( - '--prompt=', - dest='prompt', - help='Provides an alternative prompt prefix for this environment') - - if 'extend_parser' in globals(): - extend_parser(parser) - - options, args = parser.parse_args() - - global logger - - if 'adjust_options' in globals(): - adjust_options(options, args) - - verbosity = options.verbose - options.quiet - 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() - interpreter = resolve_interpreter(options.python) - if interpreter == sys.executable: - logger.warn('Already using interpreter %s' % interpreter) - else: - logger.notify('Running virtualenv with interpreter %s' % interpreter) - env['VIRTUALENV_INTERPRETER_RUNNING'] = 'true' - file = __file__ - if file.endswith('.pyc'): - file = file[:-1] - 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() - sys.exit(2) - if len(args) > 1: - print('There must be only one argument: DEST_DIR (you gave %s)' % ( - ' '.join(args))) - parser.print_help() - sys.exit(2) - - home_dir = args[0] - - 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') - sys.exit(3) - - if 'PYTHONHOME' in os.environ: - logger.warn('PYTHONHOME is set. You *must* activate the virtualenv before using it') - del os.environ['PYTHONHOME'] - - if options.relocatable: - 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) - 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): - cmd_parts = [] - for part in cmd: - if len(part) > 45: - part = part[:20]+"..."+part[-20:] - if ' ' in part or '\n' in part or '"' in part or "'" in part: - part = '"%s"' % part.replace('"', '\\"') - if hasattr(part, 'decode'): - try: - part = part.decode(sys.getdefaultencoding()) - except UnicodeDecodeError: - part = part.decode(sys.getfilesystemencoding()) - cmd_parts.append(part) - cmd_desc = ' '.join(cmd_parts) - if show_stdout: - stdout = None - else: - stdout = subprocess.PIPE - logger.debug("Running command %s" % cmd_desc) - if extra_env or remove_from_env: - env = os.environ.copy() - if extra_env: - env.update(extra_env) - if remove_from_env: - for varname in remove_from_env: - env.pop(varname, None) - else: - env = None - try: - proc = subprocess.Popen( - cmd, stderr=subprocess.STDOUT, stdin=None, stdout=stdout, - cwd=cwd, env=env) - except Exception: - e = sys.exc_info()[1] - logger.fatal( - "Error %s while executing command %s" % (e, cmd_desc)) - raise - all_output = [] - if stdout is not None: - stdout = proc.stdout - encoding = sys.getdefaultencoding() - fs_encoding = sys.getfilesystemencoding() - while 1: - line = stdout.readline() - try: - line = line.decode(encoding) - except UnicodeDecodeError: - line = line.decode(fs_encoding) - if not line: - break - line = line.rstrip() - all_output.append(line) - if filter_stdout: - level = filter_stdout(line) - if isinstance(level, tuple): - level, line = level - logger.log(level, line) - if not logger.stdout_level_matches(level): - logger.show_progress() - else: - logger.info(line) - else: - proc.communicate() - proc.wait() - if proc.returncode: - if raise_on_returncode: - if all_output: - logger.notify('Complete output from command %s:' % cmd_desc) - logger.notify('\n'.join(all_output) + '\n----------------------------------------') - raise OSError( - "Command %s failed with error code %s" - % (cmd_desc, proc.returncode)) - else: - logger.warn( - "Command %s had error code %s" - % (cmd_desc, proc.returncode)) - - -def create_environment(home_dir, site_packages=False, clear=False, - unzip_setuptools=False, use_distribute=False, - prompt=None, search_dirs=None, never_download=False): - """ - Creates a new environment in ``home_dir``. - - If ``site_packages`` is true, then the global ``site-packages/`` - directory will be on the path. - - If ``clear`` is true (default False) then the environment will - first be cleared. - """ - home_dir, lib_dir, inc_dir, bin_dir = path_locations(home_dir) - - py_executable = os.path.abspath(install_python( - home_dir, lib_dir, inc_dir, bin_dir, - site_packages=site_packages, clear=clear)) - - 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) - - install_pip(py_executable, search_dirs=search_dirs, never_download=never_download) - - install_activate(home_dir, bin_dir, prompt) - -def path_locations(home_dir): - """Return the path locations for the environment (where libraries are, - where scripts go, etc)""" - # 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': - # 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: - try: - import win32api - except ImportError: - 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/') - sys.exit(3) - home_dir = win32api.GetShortPathName(home_dir) - lib_dir = join(home_dir, 'Lib') - inc_dir = join(home_dir, 'Include') - bin_dir = join(home_dir, 'Scripts') - elif is_jython: - lib_dir = join(home_dir, 'Lib') - inc_dir = join(home_dir, 'Include') - bin_dir = join(home_dir, 'bin') - elif is_pypy: - lib_dir = home_dir - inc_dir = join(home_dir, 'include') - bin_dir = join(home_dir, 'bin') - else: - lib_dir = join(home_dir, 'lib', py_version) - inc_dir = join(home_dir, 'include', py_version + abiflags) - bin_dir = join(home_dir, 'bin') - return home_dir, lib_dir, inc_dir, bin_dir - - -def change_prefix(filename, dst_prefix): - prefixes = [sys.prefix] - - if sys.platform == "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"))) - - if hasattr(sys, 'real_prefix'): - prefixes.append(sys.real_prefix) - prefixes = list(map(os.path.abspath, prefixes)) - filename = os.path.abspath(filename) - for src_prefix in prefixes: - if filename.startswith(src_prefix): - _, relpath = filename.split(src_prefix, 1) - 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): - import imp - for modname in REQUIRED_MODULES: - if modname in sys.builtin_module_names: - logger.info("Ignoring built-in bootstrap module: %s" % modname) - continue - try: - f, filename, _ = imp.find_module(modname) - except ImportError: - logger.info("Cannot import bootstrap module: %s" % modname) - else: - if f is not None: - f.close() - dst_filename = change_prefix(filename, dst_prefix) - copyfile(filename, dst_filename) - if filename.endswith('.pyc'): - pyfile = filename[:-1] - if os.path.exists(pyfile): - copyfile(pyfile, dst_filename[:-1]) - - -def install_python(home_dir, lib_dir, inc_dir, bin_dir, site_packages, clear): - """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') - return - - if clear: - rmtree(lib_dir) - ## FIXME: why not delete it? - ## Maybe it should delete everything with #!/path/to/venv/python in it - logger.notify('Not deleting %s', bin_dir) - - if hasattr(sys, 'real_prefix'): - logger.notify('Using real prefix %r' % sys.real_prefix) - prefix = sys.real_prefix - else: - prefix = sys.prefix - mkdir(lib_dir) - fix_lib64(lib_dir) - fix_local_scheme(home_dir) - stdlib_dirs = [os.path.dirname(os.__file__)] - if sys.platform == 'win32': - stdlib_dirs.append(join(os.path.dirname(stdlib_dirs[0]), 'DLLs')) - elif sys.platform == 'darwin': - stdlib_dirs.append(join(stdlib_dirs[0], 'site-packages')) - if hasattr(os, 'symlink'): - logger.info('Symlinking Python bootstrap modules') - else: - logger.info('Copying Python bootstrap modules') - logger.indent += 2 - try: - # copy required files... - for stdlib_dir in stdlib_dirs: - if not os.path.isdir(stdlib_dir): - continue - 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)) - # ...and modules - copy_required_modules(home_dir) - finally: - logger.indent -= 2 - mkdir(join(lib_dir, 'site-packages')) - import site - site_filename = site.__file__ - if site_filename.endswith('.pyc'): - site_filename = site_filename[:-1] - elif site_filename.endswith('$py.class'): - site_filename = site_filename.replace('$py.class', '.py') - site_filename_dst = change_prefix(site_filename, home_dir) - site_dir = os.path.dirname(site_filename_dst) - writefile(site_filename_dst, SITE_PY) - writefile(join(site_dir, 'orig-prefix.txt'), prefix) - 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) - else: - logger.debug('No include dir %s' % stdinc_dir) - - # pypy never uses exec_prefix, just ignore it - if sys.exec_prefix != prefix and not is_pypy: - if sys.platform == 'win32': - 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)) - - if is_jython: - # Jython has either jython-dev.jar and javalib/ dir, or just - # jython.jar - for name in 'jython-dev.jar', 'javalib', 'jython.jar': - src = join(prefix, name) - if os.path.exists(src): - copyfile(src, join(home_dir, name)) - # XXX: registry should always exist after Jython 2.5rc1 - src = join(prefix, 'registry') - if os.path.exists(src): - copyfile(src, join(home_dir, 'registry'), symlink=False) - copyfile(join(prefix, 'cachedir'), join(home_dir, 'cachedir'), - symlink=False) - - mkdir(bin_dir) - py_executable = join(bin_dir, os.path.basename(sys.executable)) - if 'Python.framework' in prefix: - if re.search(r'/Python(?:-32|-64)*$', py_executable): - # The name of the python executable is not quite what - # we want, rename it. - py_executable = os.path.join( - os.path.dirname(py_executable), 'python') - - logger.notify('New %s executable in %s', expected_exe, py_executable) - 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': - 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')) - if is_pypy: - # make a symlink python --> pypy-c - python_executable = os.path.join(os.path.dirname(py_executable), 'python') - logger.info('Also created executable %s' % python_executable) - copyfile(py_executable, python_executable) - - 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': - # python2.4 gives an extension of '.4' :P - secondary_exe += py_executable_ext - if os.path.exists(secondary_exe): - logger.warn('Not overwriting existing %s script %s (you must use %s)' - % (expected_exe, secondary_exe, py_executable)) - else: - logger.notify('Also creating executable in %s' % secondary_exe) - 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') - shutil.copy(original_python, py_executable) - - # Copy the framework's dylib into the virtual - # environment - virtual_lib = os.path.join(home_dir, '.Python') - - if os.path.exists(virtual_lib): - os.unlink(virtual_lib) - copyfile( - os.path.join(prefix, 'Python'), - virtual_lib) - - # 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]) - 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' % ( - 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) -"""] - logger.info('Testing executable with %s %s "%s"' % tuple(cmd)) - try: - proc = subprocess.Popen(cmd, - stdout=subprocess.PIPE) - proc_stdout, proc_stderr = proc.communicate() - except OSError: - e = sys.exc_info()[1] - if e.errno == errno.EACCES: - logger.fatal('ERROR: The executable %s could not be run: %s' % (py_executable, e)) - sys.exit(100) - else: - raise e - - proc_stdout = proc_stdout.strip().decode("utf-8") - proc_stdout = os.path.normcase(os.path.abspath(proc_stdout)) - norm_home_dir = os.path.normcase(os.path.abspath(home_dir)) - if hasattr(norm_home_dir, 'decode'): - norm_home_dir = norm_home_dir.decode(sys.getfilesystemencoding()) - if proc_stdout != norm_home_dir: - logger.fatal( - 'ERROR: The executable %s is not functioning' % py_executable) - logger.fatal( - 'ERROR: It thinks sys.prefix is %r (should be %r)' - % (proc_stdout, norm_home_dir)) - logger.fatal( - 'ERROR: virtualenv is not compatible with this system or executable') - if sys.platform == 'win32': - 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)') - sys.exit(100) - else: - logger.info('Got sys.prefix result: %r' % proc_stdout) - - pydistutils = os.path.expanduser('~/.pydistutils.cfg') - if os.path.exists(pydistutils): - logger.notify('Please make sure you remove any previous custom paths from ' - 'your %s file.' % pydistutils) - ## FIXME: really this should be calculated earlier - 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 - else: - files = {'activate': ACTIVATE_SH} - - # suppling activate.fish in addition to, not instead of, the - # bash script support. - files['activate.fish'] = ACTIVATE_FISH - - # same for csh/tcsh support... - files['activate.csh'] = ACTIVATE_CSH - - - - files['activate_this.py'] = ACTIVATE_THIS - home_dir = os.path.abspath(home_dir) - if hasattr(home_dir, 'decode'): - home_dir = home_dir.decode(sys.getfilesystemencoding()) - vname = os.path.basename(home_dir) - for name, content in files.items(): - content = content.replace('__VIRTUAL_PROMPT__', prompt or '') - content = content.replace('__VIRTUAL_WINPROMPT__', prompt or '(%s)' % vname) - content = content.replace('__VIRTUAL_ENV__', home_dir) - content = content.replace('__VIRTUAL_NAME__', vname) - content = content.replace('__BIN_NAME__', os.path.basename(bin_dir)) - writefile(os.path.join(bin_dir, name), content) - -def install_distutils(home_dir): - distutils_path = change_prefix(distutils.__path__[0], home_dir) - mkdir(distutils_path) - ## FIXME: maybe this prefix setting should only be put in place if - ## there's a local distutils.cfg with a prefix setting? - home_dir = os.path.abspath(home_dir) - ## FIXME: this is breaking things, removing for now: - #distutils_cfg = DISTUTILS_CFG + "\n[install]\nprefix=%s\n" % 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): - """ - Platforms that use the "posix_local" install scheme (like Ubuntu with - Python 2.7) need to be given an additional "local" location, sigh. - """ - try: - import sysconfig - except ImportError: - pass - else: - 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): - """ - 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')) - -def resolve_interpreter(exe): - """ - If the executable given isn't an absolute path, search $PATH for the interpreter - """ - 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) - break - if not os.path.exists(exe): - logger.fatal('The executable %s (from --python=%s) does not exist' % (exe, exe)) - raise SystemExit(3) - if not is_executable(exe): - logger.fatal('The executable %s (from --python=%s) is not executable' % (exe, exe)) - raise SystemExit(3) - return exe - -def is_executable(exe): - """Checks a file is executable""" - return os.access(exe, os.X_OK) - -############################################################ -## Relocating the environment: - -def make_environment_relocatable(home_dir): - """ - Makes the already-existing environment use relative paths, and takes out - the #!-based environment selection in scripts. - """ - home_dir, lib_dir, inc_dir, bin_dir = path_locations(home_dir) - activate_this = os.path.join(bin_dir, 'activate_this.py') - if not os.path.exists(activate_this): - 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_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'] - -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)) - # 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) - 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() - if not lines: - logger.warn('Script %s is an empty file' % filename) - continue - if not lines[0].strip().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: - logger.info('Script %s has already been made relative' % filename) - else: - logger.warn('Script %s cannot be made relative (it\'s not a normal script that starts with %s)' - % (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() - -def fixup_pth_and_egg_link(home_dir, sys_path=None): - """Makes .pth and .egg-link files use relative paths""" - home_dir = os.path.normcase(os.path.abspath(home_dir)) - if sys_path is None: - sys_path = sys.path - for path in sys_path: - if not path: - path = '.' - if not os.path.isdir(path): - continue - path = os.path.normcase(os.path.abspath(path)) - if not path.startswith(home_dir): - logger.debug('Skipping system (non-environment) directory %s' % path) - continue - for filename in os.listdir(path): - filename = os.path.join(path, filename) - if filename.endswith('.pth'): - if not os.access(filename, os.W_OK): - logger.warn('Cannot write .pth file %s, skipping' % filename) - else: - fixup_pth_file(filename) - if filename.endswith('.egg-link'): - if not os.access(filename, os.W_OK): - logger.warn('Cannot write .egg-link file %s, skipping' % filename) - else: - fixup_egg_link(filename) - -def fixup_pth_file(filename): - lines = [] - prev_lines = [] - f = open(filename) - prev_lines = f.readlines() - f.close() - for line in prev_lines: - line = line.strip() - if (not line or line.startswith('#') or line.startswith('import ') - or os.path.abspath(line) != line): - lines.append(line) - else: - new_value = make_relative_path(filename, line) - if line != new_value: - logger.debug('Rewriting path %s as %s (in %s)' % (line, new_value, filename)) - lines.append(new_value) - if lines == prev_lines: - 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() - -def fixup_egg_link(filename): - f = open(filename) - link = f.read().strip() - f.close() - 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() - -def make_relative_path(source, dest, dest_is_directory=True): - """ - Make a filename relative, where the filename is dest, and it is - being referred to from the filename source. - - >>> make_relative_path('/usr/share/something/a-file.pth', - ... '/usr/share/another-place/src/Directory') - '../another-place/src/Directory' - >>> make_relative_path('/usr/share/something/a-file.pth', - ... '/home/user/src/Directory') - '../../../home/user/src/Directory' - >>> make_relative_path('/usr/share/a-file.pth', '/usr/share/') - './' - """ - source = os.path.dirname(source) - if not dest_is_directory: - dest_filename = os.path.basename(dest) - dest = os.path.dirname(dest) - dest = os.path.normpath(os.path.abspath(dest)) - source = os.path.normpath(os.path.abspath(source)) - dest_parts = dest.strip(os.path.sep).split(os.path.sep) - source_parts = source.strip(os.path.sep).split(os.path.sep) - while dest_parts and source_parts and dest_parts[0] == source_parts[0]: - dest_parts.pop(0) - source_parts.pop(0) - full_parts = ['..']*len(source_parts) + dest_parts - if not dest_is_directory: - full_parts.append(dest_filename) - if not full_parts: - # Special case for the current directory (otherwise it'd be '') - return './' - return os.path.sep.join(full_parts) - - - -############################################################ -## Bootstrap script creation: - -def create_bootstrap_script(extra_text, python_version=''): - """ - 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): - 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. - - If you provide something like ``python_version='2.4'`` then the - script will start with ``#!/usr/bin/env python2.4`` 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() - py_exe = 'python%s' % python_version - content = (('#!/usr/bin/env %s\n' % py_exe) - + '## WARNING: This file is generated\n' - + content) - return content.replace('##EXT' 'END##', extra_text) - -##EXTEND## - -def convert(s): - b = base64.b64decode(s.encode('ascii')) - return zlib.decompress(b).decode('utf-8') - -##file site.py -SITE_PY = convert(""" -eJzVPP1z2zaWv/OvwMqTIZXKdD66nR2n7o2TOK3v3MTbpLO5dT06SoIk1hTJEqQV7c3d337vAwAB -kvLHdvvDaTKxRAIPDw/vGw8YjUanZSnzhdgUiyaTQsmkmq9FmdRrJZZFJep1Wi0Oy6Sqd/B0fpOs -pBJ1IdROxdgqDoKnv/MTPBWf1qkyKMC3pKmLTVKn8yTLdiLdlEVVy4VYNFWar0Sap3WaZOk/oEWR -x+Lp78cgOM8FzDxLZSVuZaUArhLFUlzu6nWRi6gpcc7P4z8nL8cToeZVWtbQoNI4A0XWSR3kUi4A -TWjZKCB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TBNhhPiHX2LtHkrVIlhoEshH/EZgdq53Eirqs5iFKMnkOmqZTtr3Xq -djvPTWZT4S3NT5aVLgurMPUWI07BRVYqkQrmtCKohNY8qu9EdACoT6ki0a66XxVF4f9AQ3W38yO5 -mWmZmIIpnDFrbXakvKWeZhLwhvrbUH8fahhqD0YUcBDJjEBMQwiznE4y5QbHrbhHBOnUAYzb2tVN -jJa65e+eE2Ya30E2GurxUP8ssA6e/wOnvo3V78d3vTcvMB3n7l3iX1JXWqk= -""") - -##file activate.csh -ACTIVATE_CSH = convert(""" -eJx9U11vmzAUffevOCVRu+UB9pws29Kl0iq1aVWllaZlcgxciiViItsQdb9+xiQp+dh4QOB7Pu49 -XHqY59IgkwVhVRmLmFAZSrGRNkdgykonhFiqSCRW1sJSmJg8wCDT5QrucRCyHn6WFRKhVGmhKwVp -kUpNiS3emup3TY6XIn7DVNQyJUwlrgthJD6n/iCNv72uhCzCpFx9CRkThRQGKe08cWXJ9db/yh/u -pvzl9mn+PLnjj5P5D1yM8QmXlzBkSdXwZ0H/BBc0mEo5FE5qI2jKhclHOOvy9HD/OO/6YO1mX9vx -sY0H/tPIV0dtqel0V7iZvWyNg8XFcBA0ToEqVeqOdNUEQFvN41SumAv32VtJrakQNSmLWmgp4oJM -yDoBHgoydtoEAs47r5wHHnUal5vbJ8oOI+9wI86vb2d8Nrm/4Xy4RZ8R85E4uTZPB5EZPnTaaAGu -E59J8BE2J8XgrkbLeXMlVoQxznEYFYY8uFFdxsKQRx90Giwx9vSueHP1YNaUSFG4vTaErNSYuBOF -lXiVyXa9Sy3JdClEyK1dD6Nos9mEf8iKlOpmqSNTZnYjNEWiUYn2pKNB3ttcLJ3HmYYXy6Un76f7 -r8rRsC1TpTJj7f19m5sUf/V3Ir+x/yjtLu8KjLX/CmN/AcVGUUo= -""") - -##file activate.bat -ACTIVATE_BAT = convert(""" -eJyFUkEKgzAQvAfyhz0YaL9QEWpRqlSjWGspFPZQTevFHOr/adQaU1GaUzI7Mzu7ZF89XhKkEJS8 -qxaKMMsvboQ+LxxE44VICSW1gEa2UFaibqoS0iyJ0xw2lIA6nX5AHCu1jpRsv5KRjknkac9VLVug -sX9mtzxIeJDE/mg4OGp47qoLo3NHX2jsMB3AiDht5hryAUOEifoTdCXbSh7V0My2NMq/Xbh5MEjU -ZT63gpgNT9lKOJ/CtHsvT99re3pX303kydn4HeyOeAg5cjf2EW1D6HOPkg9NGKhu -""") - -##file deactivate.bat -DEACTIVATE_BAT = convert(""" -eJxzSE3OyFfIT0vj4spMU0hJTcvMS01RiPf3cYkP8wwKCXX0iQ8I8vcNCFHQ4FIAguLUEgWIgK0q -FlWqXJpcICVYpGzx2BAZ4uHv5+Hv6wq1BWINXBTdKriEKkI1DhW2QAfhttcxxANiFZCBbglQSJUL -i2dASrm4rFz9XLgAwJNbyQ== -""") - -##file distutils-init.py -DISTUTILS_INIT = convert(""" -eJytV92L4zYQf/dfMU0ottuse7RvC6FQrg8Lxz2Ugz4si9HacqKuIxlJ2ST313dG8odkO9d7aGBB -luZLv/nNjFacOqUtKJMIvzK3cXlhWgp5MDBsqK5SNYftsBAGpLLA4F1oe2Ytl+9wUvW55TswCi4c -KibhbFDSglXQCFmDPXIwtm7FawLRbwtPzg2T9gf4gupKv4GS0N262w7V0NvpbCy8cvTo3eAus6C5 -ETU3ICQZX1hFTw/dzR6V/AW1RCN4/XAtbsVXqIXmlVX6liS4lOzEYY9QFB2zx6LfoSNjz1a0pqT9 -QOIfJWQ2E888NEVZNqLlZZnvIB0NpHkimlFdKn2iRRY7yGG/CCJb6Iz280d34SFXBS2yEYPNF0Q7 -yM7oCjpWvbEDQmnhRwOs6zjThpKE8HogwRAgraqYFZgGZvzmzVh+mgz9vskT3hruwyjdFcqyENJw -bbMPO5jdzonxK68QKT7B57CMRRG5shRSWDTX3dI8LzRndZbnSWL1zfvriUmK4TcGWSnZiEPCrxXv -bM+sP7VW2is2WgWXCO3sAu3Rzysz3FiNCA8WPyM4gb1JAAmCiyTZbhFjWx3h9SzauuRXC9MFoVbc -yNTCm1QXOOIfIn/g1kGMhDUBN72hI5XCBQtIXQw8UEEdma6Jaz4vJIJ51Orc15hzzmu6TdFp3ogr -Aof0c98tsw1SiaiWotHffk3XYCkqdToxWRfTFXqgpg2khcLluOHMVC0zZhLKIomesfSreUNNgbXi -Ky9VRzwzkBneNoGQyyvGjbsFQqOZvpWIjqH281lJ/jireFgR3cPzSyTGWzQpDNIU+03Fs4XKLkhp -/n0uFnuF6VphB44b3uWRneSbBoMSioqE8oeF0JY+qTvYfEK+bPLYdoR4McfYQ7wMZj39q0kfP8q+ -FfsymO0GzNlPh644Jje06ulqHpOEQqdJUfoidI2O4CWx4qOglLye6RrFQirpCRXvhoRqXH3sYdVJ -AItvc+VUsLO2v2hVAWrNIfVGtkG351cUMNncbh/WdowtSPtCdkzYFv6mwYc9o2Jt68ud6wectBr8 -hYAulPSlgzH44YbV3ikjrulEaNJxt+/H3wZ7bXSXje/YY4tfVVrVmUstaDwwOBLMg6iduDB0lMVC -UyzYx7Ab4kjCqdViEJmDcdk/SKbgsjYXgfMznUWcrtS4z4fmJ/XOM1LPk/iIpqass5XwNbdnLb1Y -8h3ERXSWZI6rZJxKs1LBqVH65w0Oy4ra0CBYxEeuOMbDmV5GI6E0Ha/wgVTtkX0+OXvqsD02CKLf -XHbeft85D7tTCMYy2Njp4DJP7gWJr6paVWXZ1+/6YXLv/iE0M90FktiI7yFJD9e7SOLhEkkaMTUO -azq9i2woBNR0/0eoF1HFMf0H8ChxH/jgcB34GZIz3Qn4/vid+VEamQrOVqAPTrOfmD4MPdVh09tb -8dLLjvh/61lEP4yW5vJaH4vHcevG8agXvzPGoOhhXNncpTr99PTHx6e/UvffFLaxUSjuSeP286Dw -gtEMcW1xKr/he4/6IQ6FUXP+0gkioHY5iwC9Eyx3HKO7af0zPPe+XyLn7fAY78k4aiR387bCr5XT -5C4rFgwLGfMvJuAMew== -""") - -##file distutils.cfg -DISTUTILS_CFG = convert(""" -eJxNj00KwkAMhfc9xYNuxe4Ft57AjYiUtDO1wXSmNJnK3N5pdSEEAu8nH6lxHVlRhtDHMPATA4uH -xJ4EFmGbvfJiicSHFRzUSISMY6hq3GLCRLnIvSTnEefN0FIjw5tF0Hkk9Q5dRunBsVoyFi24aaLg -9FDOlL0FPGluf4QjcInLlxd6f6rqkgPu/5nHLg0cXCscXoozRrP51DRT3j9QNl99AP53T2Q= -""") - -##file activate_this.py -ACTIVATE_THIS = convert(""" -eJyNUlGL2zAMfvevEBlHEujSsXsL9GGDvW1jD3sZpQQ3Ua7aJXawnbT595Ocpe0dO5ghseVP+vRJ -VpIkn2cYPZknwAvWLXWYhRP5Sk4baKgOWRWNqtpdgTyH2Y5wpq5Tug406YAgKEzkwqg7NBPwR86a -Hk0olPopaK0NHJHzYQPnE5rI0o8+yBUwiBfyQcT8mMPJGiAT0A0O+b8BY4MKJ7zPcSSzHaKrSpJE -qeDmUgGvVbPCS41DgO+6xy/OWbfAThMn/OQ9ukDWRCSLiKzk1yrLjWapq6NnvHUoHXQ4bYPdrsVX -4lQMc/q6ZW975nmSK+oH6wL42a9H65U6aha342Mh0UVDzrD87C1bH73s16R5zsStkBZDp0NrXQ+7 -HaRnMo8f06UBnljKoOtn/YT+LtdvSyaT/BtIv9KR60nF9f3qmuYKO4//T9ItJMsjPfgUHqKwCZ3n -xu/Lx8M/UvCLTxW7VULHxB1PRRbrYfvWNY5S8it008jOjcleaMqVBDnUXcWULV2YK9JEQ92OfC96 -1Tv4ZicZZZ7GpuEpZbbeQ7DxquVx5hdqoyFSSmXwfC90f1Dc7hjFs/tK99I0fpkI8zSLy4tSy+sI -3vMWehjQNJmE5VePlZbL61nzX3S93ZcfDqznnkb9AZ3GWJU= -""") - -if __name__ == '__main__': - main() - -## TODO: -## Copy python.exe.manifest -## Monkeypatch distutils.sysconfig diff --git a/vendor/virtualenv-1.7/virtualenv_support/__init__.py b/vendor/virtualenv-1.7/virtualenv_support/__init__.py deleted file mode 100644 index e69de29b..00000000 diff --git a/vendor/virtualenv-1.7/virtualenv_support/activate.bat b/vendor/virtualenv-1.7/virtualenv_support/activate.bat deleted file mode 100644 index 9d4d6bf1..00000000 --- a/vendor/virtualenv-1.7/virtualenv_support/activate.bat +++ /dev/null @@ -1,31 +0,0 @@ -@echo off -set VIRTUAL_ENV=__VIRTUAL_ENV__ - -if not defined PROMPT ( - set PROMPT=$P$G -) - -if defined _OLD_VIRTUAL_PROMPT ( - set PROMPT=%_OLD_VIRTUAL_PROMPT% -) - -if defined _OLD_VIRTUAL_PYTHONHOME ( - set PYTHONHOME=%_OLD_VIRTUAL_PYTHONHOME% -) - -set _OLD_VIRTUAL_PROMPT=%PROMPT% -set PROMPT=__VIRTUAL_WINPROMPT__ %PROMPT% - -if defined PYTHONHOME ( - set _OLD_VIRTUAL_PYTHONHOME=%PYTHONHOME% - set PYTHONHOME= -) - -if defined _OLD_VIRTUAL_PATH set PATH=%_OLD_VIRTUAL_PATH%; goto SKIPPATH - -set _OLD_VIRTUAL_PATH=%PATH% - -:SKIPPATH -set PATH=%VIRTUAL_ENV%\__BIN_NAME__;%PATH% - -:END diff --git a/vendor/virtualenv-1.7/virtualenv_support/activate.fish b/vendor/virtualenv-1.7/virtualenv_support/activate.fish deleted file mode 100644 index fcb31d8e..00000000 --- a/vendor/virtualenv-1.7/virtualenv_support/activate.fish +++ /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/vendor/virtualenv-1.7/virtualenv_support/deactivate.bat b/vendor/virtualenv-1.7/virtualenv_support/deactivate.bat deleted file mode 100644 index a575a94c..00000000 --- a/vendor/virtualenv-1.7/virtualenv_support/deactivate.bat +++ /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/vendor/virtualenv-1.7/virtualenv_support/distribute-0.6.24.tar.gz b/vendor/virtualenv-1.7/virtualenv_support/distribute-0.6.24.tar.gz deleted file mode 100644 index 654fb50f..00000000 Binary files a/vendor/virtualenv-1.7/virtualenv_support/distribute-0.6.24.tar.gz and /dev/null differ diff --git a/vendor/virtualenv-1.7/virtualenv_support/pip-1.0.2.tar.gz b/vendor/virtualenv-1.7/virtualenv_support/pip-1.0.2.tar.gz deleted file mode 100644 index 15dbdd1a..00000000 Binary files a/vendor/virtualenv-1.7/virtualenv_support/pip-1.0.2.tar.gz and /dev/null differ diff --git a/vendor/virtualenv-1.7/virtualenv_support/setuptools-0.6c11-py2.4.egg b/vendor/virtualenv-1.7/virtualenv_support/setuptools-0.6c11-py2.4.egg deleted file mode 100644 index b2c15924..00000000 Binary files a/vendor/virtualenv-1.7/virtualenv_support/setuptools-0.6c11-py2.4.egg and /dev/null differ diff --git a/vendor/virtualenv-1.7/virtualenv_support/setuptools-0.6c11-py2.5.egg b/vendor/virtualenv-1.7/virtualenv_support/setuptools-0.6c11-py2.5.egg deleted file mode 100644 index b004539d..00000000 Binary files a/vendor/virtualenv-1.7/virtualenv_support/setuptools-0.6c11-py2.5.egg and /dev/null differ diff --git a/vendor/virtualenv-1.7/virtualenv_support/setuptools-0.6c11-py2.6.egg b/vendor/virtualenv-1.7/virtualenv_support/setuptools-0.6c11-py2.6.egg deleted file mode 100644 index 3c72d15b..00000000 Binary files a/vendor/virtualenv-1.7/virtualenv_support/setuptools-0.6c11-py2.6.egg and /dev/null differ diff --git a/vendor/virtualenv-1.7/virtualenv_support/setuptools-0.6c11-py2.7.egg b/vendor/virtualenv-1.7/virtualenv_support/setuptools-0.6c11-py2.7.egg deleted file mode 100644 index 8a51424a..00000000 Binary files a/vendor/virtualenv-1.7/virtualenv_support/setuptools-0.6c11-py2.7.egg and /dev/null differ