script to clone virtualenvs.
virtualenv cloning script.
A script for cloning a non-relocatable virtualenv.
Virtualenv provides a way to make virtualenv's relocatable which could then be
copied as we wanted. However making a virtualenv relocatable this way breaks
the no-site-packages isolation of the virtualenv as well as other aspects that
come with relative paths and
/usr/bin/env shebangs that may be undesirable.
Also, the .pth and .egg-link rewriting doesn't seem to work as intended. This attempts to overcome these issues and provide a way to easily clone an existing virtualenv.
It performs the following:
updates the hardcoded
VIRTUAL_ENVvariable in the activate script to the new repo location. (
--relocatabledoesn't touch this)
updates the shebangs of the various scripts in bin to the new Python if they pointed to the old Python. (version numbering is retained.)
it can also change
/usr/bin/env pythonshebangs to be absolute too, though this functionality is not exposed at present.
sys.pathof the cloned virtualenv and if any of the paths are from the old environment it finds any
.egglink files within sys.path located in the new environment and makes sure any absolute paths to the old environment are updated to the new environment.
finally it double checks
sys.pathagain and will fail if there are still paths from the old environment present.
NOTE: This script requires Python 2.7 or 3.4+
Release history Release notifications | RSS feed
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
|Filename, size||File type||Python version||Upload date||Hashes|
|Filename, size virtualenv_clone-0.5.4-py2.py3-none-any.whl (6.6 kB)||File type Wheel||Python version py2.py3||Upload date||Hashes View|
|Filename, size virtualenv-clone-0.5.4.tar.gz (6.2 kB)||File type Source||Python version None||Upload date||Hashes View|
Hashes for virtualenv_clone-0.5.4-py2.py3-none-any.whl