Here’s a teeny tiny convenience. The basic idea is that you can use virtualenv’s bin directory for more than just Python conveniences: it gives you temporary PATH changes too, which can be convenient for switching between the Go and Python implementations of Juju.

While we’re in the transition state between the legacy, Python-based, system-installed Juju and the golang, from source Juju Core, we sometimes want to switch back and forth between the two definitions of “juju.” I’ve followed the Juju Core instructions to add the Go bin to my path, so that’s the juju that “wins” normally.

If you want easy access to Python Juju, you can just make a symlink from “pyjuju” to the system’s juju. That works fine for some stories.

However, it is inconvenient for using old workflows, such as testing our charms with jujujitsu, which expects “juju” to be the legacy Python Juju implementation. For this, I made a virtualenv with the –system-site-packages flag, installed the Python dependencies that hacking the charm needs (see the charm’s HACKING document), and then added a “juju” symlink to the system’s Python-based juju in the virtualenv bin. Now if I source the virtualenv’s bin/activate, I have all the dependencies I need for testing, plus “juju” is the Python implementation.