Skip to main content

A set of tools for virtualenv

Project description

Build Status Coverage Status PyPI version

virtualenv-tools3

virtualenv-tools3 is a fork of the original virtualenv-tools (now unmaintained) which adds support for Python 3, among other things. Full patch details are below.

yelp patches

yelp4

  • Add python3 support
  • Drop python2.6 support
  • 100% test coverage
  • Removes $VENV/local instead of fixing up symlinks
  • Removed --reinitialize, instead run virtualenv $VENV -p $PYTHON
  • Rewrite .pth files to relative paths

yelp3

  • default output much more concise, added a --verbose option
  • improved fault tolerance, in the case of:
    • corrupt pyc files
    • broken symlinks
    • unexpected directories
  • no-changes-needed is a success case (idempotency exits 0)

yelp1

  • --update now works more generally and reliably (e.g. virtualenv --python=python2.7)

virtualenv-tools

This repository contains scripts we're using at Fireteam for our deployment of Python code. We're using them in combination with salt to build code on one server on a self contained virtualenv and then move that over to the destination servers to run.

Why not virtualenv --relocatable?

For starters: because it does not work. relocatable is very limited in what it does and it works at runtime instead of making the whole thing actually move to the new location. We ran into a ton of issues with it and it is currently in the process of being phased out.

Why would I want to use it?

The main reason you want to use this is for build caching. You have one folder where one virtualenv exists, you install the latest version of your codebase and all extensions in there, then you can make the virtualenv relocate to a target location, put it into a tarball, distribute it to all servers and done!

Example flow:

First time: create the build cache

$ mkdir /tmp/build-cache
$ virtualenv --distribute /tmp/build-cache

Now every time you build:

$ . /tmp/build-cache/bin/activate
$ pip install YourApplication

Build done, package up and copy to whatever location you want to have it.

Once unpacked on the target server, use the virtualenv tools to update the paths and make the virtualenv magically work in the new location. For instance we deploy things to a path with the hash of the commit in:

$ virtualenv-tools --update-path /srv/your-application/<hash>

Compile once, deploy whereever. Virtualenvs are completely self contained. In order to switch the current version all you need to do is to relink the builds.

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_tools3-3.0.0.tar.gz (7.0 kB view details)

Uploaded Source

Built Distribution

virtualenv_tools3-3.0.0-py2.py3-none-any.whl (7.5 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file virtualenv_tools3-3.0.0.tar.gz.

File metadata

  • Download URL: virtualenv_tools3-3.0.0.tar.gz
  • Upload date:
  • Size: 7.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.6

File hashes

Hashes for virtualenv_tools3-3.0.0.tar.gz
Algorithm Hash digest
SHA256 d57ad4a6bfd91bbe5e4ba4f04b41071645db7cce7d8250e8b44e114af9e5674a
MD5 9e2c005dbc34f34f29d9166fa4c078f3
BLAKE2b-256 7a658e85718836e10fb91bb23d70696054f8f1d5db532a280c151d3389233a73

See more details on using hashes here.

File details

Details for the file virtualenv_tools3-3.0.0-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for virtualenv_tools3-3.0.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 8dfbe017a21bf69ccb145570140edf21ea2b39c9e51d42a29320fd83d711c88d
MD5 521d71a0cc4bc3621d570a89976e4e45
BLAKE2b-256 e1a226e4e2cf5a9040412bb29ddbe06927fe0e548fed54b5bcbb959968966f7d

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