virtualenv with less hassle
Roff Shell Python Makefile
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
autovenv
docs
scripts
tests
.gitignore
LICENSE
MANIFEST.in
Makefile
README.rst
requirements.txt
setup.py
tox.ini

README.rst

autovenv: virtualenv with less hassle

I don't want to be a product of my environment, I want my environment to be a product of me.

—Frank Costello in The Departed

Virtual environments are great, but they can be a bit annoying to create, manage, and switch between. autovenv takes the annoyance away.

Documentation

Full documentation is at https://autovenv.readthedocs.org.

How It Works

Basically, as long as there's a requirements.txt file in your python project, autovenv will figure out that the folder you're in is a python project, create a virtualenv for that project automatically, and activate/deactivate that virtualenv when you cd in/out of the project folder.

Here's how it works:

Just cd to anywhere within a python project, and autovenv will create a virtual environment for you if you don't have one already:

(as you can see, it also checks that the pip within the virtualenv is up to date)

cd to a different project, it'll switch virtual environments automatically. cd out of a project and it'll deactivate the virtual environment.

autovenv tries to keep things tidy by storing config file, built python versions, and virtual environments in one app directory.

The location of this directory is platform-dependent (only linux it's at ~/.local/share/autovenv).

Locations:

  • <appdir>/config - the config file
  • <appdir>/pyversions - built python versions
  • <appdir>/venvs - virtual environments

Installation

Simply install with pip globally, ie not within a virtual environment:

$ pip install autovenv

and then add the following line to the end of your .bashrc file:

source `which autovenv.sh`

or if you're using fish:

source which autovenv.fish

That's it.