An Emacs package that adds projectile and/or persp-mode-based Python virtual
environment tracking to pyvenv, and more.
- Initialize terminals so that they automatically enable the local
venv (implemented for
termandvterm) - Add
CONDA_PREFIXandCONDA_DEFAULT_ENVvariables to the environment - Activate
comintbuffers within theprojectile-determined project root directory - Start and restart Python inferior processes in a way that preserves the
pyvenvvenv settings and prevents the cursor from jumping - Make interactive Python sessions project-specific by adding
projectileproject names topython-modeprocess names - Make
flycheckuse theprojectileproject directory
This mode augments pyvenv-tracking-mode by only changing the virtual
environment when the projectile project changes (and has a different
virtual environment).
Currently, the approach used relies on the availability of pyvenv-workon
values within in each projects’ .dir-locals.el, so each project must have
those set.
This mode sets the virtual environment when a persp-mode perspective is
activated.
When projectile is set to use persp-mode-scoped projects via
=proj-persp-extras= and pyvenv-projectile-tracking-mode is enabled, this
mode effectively enables persp-mode-based virtual environment scopes. In
other words, your current persp-mode perspective determines which virtual
environment is activate.
Just enable the minor modes:
(pyvenv-extras-mode +1)
(pyvenv-projectile-tracking-mode +1)
(pyvenv-persp-tracking-mode +1)Use your favorite approach to installing Emacs packages from GitHub.
Here’s an example of one:
(quelpa
'(pyvenv-extras
:fetcher git
:url "https://github.com/brandonwillard/pyvenv-extras.git"))To use as a Cask dependency:
(depends-on "pyvenv-extras"
:git "https://github.com/brandonwillard/pyvenv-extras.git"
:branch "master")