Package: venvs
venvsis a tool for configuring, in a single file, a set of
virtualenvs, which packages to install into each, and any binaries to
make globally available from within.InstallationThe usual:$ pip install venvsUsageThe best way to usevenvsis by creating a file named~/.local/share/virtualenvs/virtualenvs.toml. Here’s an example of what goes
in it:[virtualenv.development]
install = [
    "pudb",
    "twisted",
]
link = ["trial"]

[virtualenv.app]
install = ["$DEVELOPMENT/myapp"]After creating the above, runningvenvs convergewill create 2
virtualenvs, one called “development” withpudband twisted installed
into it and trial linked from within it onto yourPATH, and a second
called “app” installing the corresponding directory.For a more intricate example, have a look atmy own virtualenvs.toml.That’s about all you need to know. If you insist on reading further
though, venvs has an older, not-very-recommended mutable interface
which allows you to create virtualenvs in a central location without
tracking them in a config file (or converging them). For that, usage
is similar tomkvirtualenv, althoughvenvspasses arguments
directly through tovirtualenv:$venvscreatenameofvenv---ppypywill create a virtual environment in an appropriate platform-specific
data directory, or in the directory specified byWORKON_HOMEfor
compatibility withvirtualenvwrapper.Single-Purpose VirtualenvsA common use case for virtualenvs is for single-purpose installations, e.g.:“I want to install fabric and give it its own virtualenv so that its
dependencies can be independently upgraded, all while still being able to use
thefabbinary globally”.venvssupports a--linkoption for this use case:$venvscreate-ifabric--linkfabwill create a virtualenv for fabric (in the same normal location), but will
symlink thefabbinary from within the virtualenv into your~/.local/bindirectory.(You may have heard ofpipsiwhich is a
similar tool for this use case, but with less customization than I would have
liked.)Temporary VirtualenvsI also findmktmpenvuseful for quick testing. To support its use case,venvscurrently supports a different but similar style of temporary
virtualenv.Invoking:$ venv=$(venvs temporary)in your shell will create (or re-create) a global temporary virtualenv,
and print itsbin/subdirectory (which in this case will be then
stored in thevenvvariable). It can subsequently be used by, e.g.:$ $venv/pythonor:$ $venv/pip ...et cetera.You may prefer using:$ cd $(venvs temporary)as your temporary venv workflow if you’re into that sort of thing instead.The global virtualenv is cleared each time you invokevenvs temporary.
Unless you care, unlikevirtualenvwrapper’smktmpenv, there’s no
need to care about cleaning it up, whenever it matters for the next
time, it will be cleared and overwritten.venvsmay support the more similar “traditional” one-use virtualenv in the
future, but given that it does not activate virtualenvs by default (see below),
the current recommendation for this use case would be to simply use thevirtualenvbinary directly.The 5 Minute TutorialBesides thevenvsfor named-virtualenv creation andvenvs temporaryfor temporary-virtualenv creation described above:$ venvs find name foowill output (to standard output) the path to a virtualenv with the given name
(see also--existing-only), and:$ venvs remove foowill remove it.There are a number of other slight variants, see the--helpinformation for
each of the three binaries.Real documentation to come (I hope)Why don’t I usevirtualenvwrapper?virtualenvwrapperis great! I’ve used it for a few years. But I’ve
slowly settled on a much smaller subset of its functionality that I like
to use. Specifically:I don’t like activating virtualenvs.virtualenvs are magical and hacky enough on their own, and piling
activation on top just makes things even more messy for me, especially
when moving around between different projects in a shell.  Some people
usecdtricks to solve this, but I just want simplicity.I don’t need project support.I’ve never attached a project to a virtualenv. I just use a naming
convention, naming the virtualenv with the name of the repo (with simple
coercion), and then usingdynamic directory expansion in my shellto handle association.Basically, I just want a thing that is managing a central repository of
virtualenvs for me. So that’s whatvenvsdoes.