Skip to main content

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+

Metadata

Release files for virtualenv-clone 0.5.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for virtualenv-clone 0.5.7
File Size Uploaded Provenance Actions
virtualenv-clone-0.5.7.tar.gz 6.5 kB Without provenance Details for virtualenv-clone-0.5.7.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for virtualenv-clone 0.5.7
File Interpreter ABI Platform Actions
virtualenv_clone-0.5.7-py3-none-any.whl Python 3 none any Details for virtualenv_clone-0.5.7-py3-none-any.whl

Total release size: 13.1 kB

Release files / virtualenv-clone-0.5.7.tar.gz

Download URL virtualenv-clone-0.5.7.tar.gz
Size 6.5 kB
Tags Source
SHA-256 checksum
How to use checksums
418ee935c36152f8f153c79824bb93eaf6f0f7984bae31d3f48f350b9183501a
BLAKE2b-256 checksum
How to use checksums
857649120db3bb8de4073ac199a08dc7f11255af8968e1e14038aee95043fafa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.8.10

Release files / virtualenv_clone-0.5.7-py3-none-any.whl

Download URL virtualenv_clone-0.5.7-py3-none-any.whl
Size 6.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
44d5263bceed0bac3e1424d64f798095233b64def1c5689afa43dc3223caf5b0
BLAKE2b-256 checksum
How to use checksums
21ace07058dc5a6c1b97f751d24f20d4b0ec14d735d77f4a1f78c471d6d13a43
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.8.10

Security for virtualenv-clone 0.5.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page