Skip to main content

switch virtualenvs with a python context manager

Project description

Example

>>> from virtualenvcontext import VirtualenvContext
>>> try:
>>>     import kitchen
>>> except ImportError as e:
>>>     print "kitchen is definitely not installed in system-python"
>>> with VirtaulenvContext("my-venv"):
>>>     import kitchen
>>>     print "But it *is* installed in my virtualenv"
>>> try:
>>>     import kitchen
>>> except ImportError as e:
>>>     print "But once I exit that block, I lose my powers again..."

Caveat:

It expects that you’re using virtualenvwrapper but you should be anyways.

Get this project:

Source: http://github.com/ralphbean/virtualenvcontext/

pypi: http://pypi.python.org/pypi/virtualenvcontext/

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

virtualenvcontext-0.1.2.tar.gz (2.7 kB view details)

Uploaded Source

File details

Details for the file virtualenvcontext-0.1.2.tar.gz.

File metadata

File hashes

Hashes for virtualenvcontext-0.1.2.tar.gz
Algorithm Hash digest
SHA256 13d33f5e0b6fae1c1fd9b6929205e128dc094a80581017d6d61911c8add92d99
MD5 2621b33bb5c27fc969b2e0fa999f8f4a
BLAKE2b-256 ef6058a4f07a97c27c81bc059afc2455cf3630f1df61a492b328ff4c8b1da02d

See more details on using hashes here.

Supported by

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