Skip to main content

script to clone virtualenvs.

Project description

virtualenv cloning script.

Build Status

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.

NOTE: This script requires Python 2.7 or 3.4+

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

virtualenv-clone-0.5.1.tar.gz (6.2 kB view details)

Uploaded Source

Built Distributions

virtualenv_clone-0.5.1-py3-none-any.whl (6.6 kB view details)

Uploaded Python 3

virtualenv_clone-0.5.1-py2.py3-none-any.whl (6.6 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file virtualenv-clone-0.5.1.tar.gz.

File metadata

  • Download URL: virtualenv-clone-0.5.1.tar.gz
  • Upload date:
  • Size: 6.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.29.1 CPython/3.5.3

File hashes

Hashes for virtualenv-clone-0.5.1.tar.gz
Algorithm Hash digest
SHA256 217bd3f0880c9f85672c0bcc9ad9e0354ab7dfa89c2f117e63aa878b4279f5bf
MD5 5a354728528bfc3d4129923a9d8cd45c
BLAKE2b-256 af694bf2faa88f0f158bfcc8d66e270e8dafdda92e22f374cf111bde93924b17

See more details on using hashes here.

File details

Details for the file virtualenv_clone-0.5.1-py3-none-any.whl.

File metadata

  • Download URL: virtualenv_clone-0.5.1-py3-none-any.whl
  • Upload date:
  • Size: 6.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.29.1 CPython/3.5.3

File hashes

Hashes for virtualenv_clone-0.5.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f2a07ed255f3abaceef8c8442512d8cdb2ba9f867e212d8a51680c7790a85033
MD5 245b9b54f8927627d898c83045135bb4
BLAKE2b-256 b3ff161270311f52f6ce6e7a9047d4279755fa3dcb3645ac2554295a626ce508

See more details on using hashes here.

File details

Details for the file virtualenv_clone-0.5.1-py2.py3-none-any.whl.

File metadata

  • Download URL: virtualenv_clone-0.5.1-py2.py3-none-any.whl
  • Upload date:
  • Size: 6.6 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.29.1 CPython/3.5.3

File hashes

Hashes for virtualenv_clone-0.5.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 316c8a05432a7adb5e461709759aca18c51433ffc2c33e2e80c9e51c452d339f
MD5 ab4494b5f54b28660e5a53772303887e
BLAKE2b-256 e3d9d9c56deb483c4d3289a00b12046e41428be64e8236fa210111a1f57cc42d

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page