Python multi-version wrapper for virtualenv.
Project description
virtualenv-multiver is a wrapper around virtualenv, the standard tool for creating isolated Python environments. It’s built to allow multiple versions of Python to be usable within a single environment. This is really handy when you’re doing development and testing across a range of Python versions, and you don’t want to have to juggle your active environment for every version.
Installation
Simple:
pip install virtualenv-multiver
Usage
Also simple. To create a new virtual environment, just provide the path to that environment and the versions you want installed. For example:
virtualenv-multiver ~/venvs/my-project 2.7 3.6 3.7 3.8
Or:
virtualenv-multiver ~/venvs/my-project pypy pypy3
The resulting virtual environment will include all those versions of Python without any additional configuration.
FAQ
How does this work?
virtualenv-multiver runs through the list of Python versions provided and calls out to virtualenv for each version
After each virtualenv call, it fixes up the tree a bit. This involves:
Ensuring symlinks point to the right place (python2 points to the latest python2.* specified, for instance)
Patching any installed scripts (such as pip3.8) and making sure it points to the correct, versioned interpreter
Moves and patches some binaries and configuration files around to avoid collision issues.
Once done, it sets the top-level symlinks for python2, python3, pip2, pip3, etc. (any that specify a major version) to point to the latest version in that series.
It then sets the generic, version-less ones (python, pip, etc.) to point to the Python 2 versions (if Python 2 is installed), or Python 3 (if not). This helps ensure compatibility with scripts that expect python to mean “Python 2”.
Are all versions of CPython supported?
Yes. Pretty much. It depends on whether virtualenv itself will support the version.
Is PyPY supported?
Yes. Sorta.
PyPy doesn’t cleanly install alongside CPython in a virtual environment, due to CPython and PyPy claiming some of the same files and directories. We only allow PyPy to install independently or alongside another PyPy.
You may have issues even with multiple PyPy installations. They’ll install and run, but will share the same site-packages directory, which is beyond our control for the moment.
If this isn’t a problem for you, go for it. Otherwise, you may want to stick to a standard virtualenv call for those.
How do I report a bug?
You can file an issue on the GitHub issue tracker.
Who uses this?
We use virtualenv-multiver at Beanbag for our Review Board and RBCommons products.
If you use this, let us know and we’ll add you to a list here!
What else do you build?
Lots of things. Check out some of our other open source projects.
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
Built Distributions
File details
Details for the file virtualenv-multiver-2.0.1.tar.gz
.
File metadata
- Download URL: virtualenv-multiver-2.0.1.tar.gz
- Upload date:
- Size: 9.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/44.1.1 requests-toolbelt/0.9.1 tqdm/4.48.0 CPython/2.7.17
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4863b04ce7ed38e35b4112292aad89e63cb2e3b9da1d2ad97740634eef56e794 |
|
MD5 | f26a0110cae58270272931f0ce5b96d7 |
|
BLAKE2b-256 | bf041adf6c26e16829f0967c12962c227fea6245d59fe2617078dd9699243fdf |
File details
Details for the file virtualenv_multiver-2.0.1-py2.py3-none-any.whl
.
File metadata
- Download URL: virtualenv_multiver-2.0.1-py2.py3-none-any.whl
- Upload date:
- Size: 9.0 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/44.1.1 requests-toolbelt/0.9.1 tqdm/4.48.0 CPython/2.7.17
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3e05fb8f1f271cd639c89c4a15b80b332ffdfefb87b07251fa4db4142d53c7f4 |
|
MD5 | d3e3bb306fdb309850393c13808389bf |
|
BLAKE2b-256 | 0892bb435203f5859bde9e6bb4f735b8061c1c0cfc79e7e7ee2a02ac29941c9a |
File details
Details for the file virtualenv_multiver-2.0.1-py2.7.egg
.
File metadata
- Download URL: virtualenv_multiver-2.0.1-py2.7.egg
- Upload date:
- Size: 14.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/44.1.1 requests-toolbelt/0.9.1 tqdm/4.48.0 CPython/2.7.17
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e30019f6b08d73bf657288f229a186a2ae9cc3f861d1df79b7f1ae19a6cec67e |
|
MD5 | ccc8cc44bf0236abc963c1d7fc904893 |
|
BLAKE2b-256 | 3310d8f3a4c61cb9707ea57cecbe9e2ce175497d34218379b07ff648acb688dd |