Package Info

python-virtualenv-clone


Script to clone virtualenvs


Development/Languages/Python

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:

  • copies sys.argv[1] dir to sys.argv[2]

  • updates the hardcoded VIRTUAL_ENV variable in the activate script to the new repo location. (--relocatable doesn'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 python' shebangs to be absolute too, though this functionality is not exposed at present.

  • checks sys.path of the cloned virtualenv and if any of the paths are from the old environment it finds any .pth or .egg-link 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.path again and will fail if there are still paths from the old environment present.


License: MIT
URL: https://github.com/edwardgeorge/virtualenv-clone

Categories

Releases

Package Version Update ID Released Package Hub Version Platforms Subpackages
0.5.4-bp156.3.1 info GA Release 2023-07-22 15 SP6
  • AArch64
  • ppc64le
  • s390x
  • x86-64
  • python3-virtualenv-clone
0.5.4-bp155.2.13 info GA Release 2023-05-22 15 SP5
  • AArch64
  • ppc64le
  • s390x
  • x86-64
  • python3-virtualenv-clone
0.5.4-bp154.1.23 info GA Release 2022-05-09 15 SP4
  • AArch64
  • ppc64le
  • s390x
  • x86-64
  • python3-virtualenv-clone
0.5.4-bp153.1.16 info GA Release 2021-03-06 15 SP3
  • AArch64
  • ppc64le
  • s390x
  • x86-64
  • python2-virtualenv-clone
  • python3-virtualenv-clone
0.5.4-bp152.1.1 info GA Release 2020-04-28 15 SP2
  • AArch64
  • ppc64le
  • s390x
  • x86-64
  • python2-virtualenv-clone
  • python3-virtualenv-clone
0.2.6-bp151.3.1 info GA Release 2019-07-17 15 SP1
  • AArch64
  • ppc64le
  • s390x
  • x86-64
  • python2-virtualenv-clone
  • python3-virtualenv-clone
0.2.6-bp151.2.10 info GA Release 2019-05-18 15 SP1
  • AArch64
  • ppc64le
  • s390x
  • x86-64
  • python2-virtualenv-clone
  • python3-virtualenv-clone
0.2.6-bp150.2.4 info GA Release 2018-07-30 15
  • AArch64
  • ppc64le
  • s390x
  • x86-64
  • python2-virtualenv-clone
  • python3-virtualenv-clone