Open mankoff opened 2 years ago
FWIW, I have a function in my config that auto-switches the activated conda environment at the workspace level (I'm using persp-mode):
(defun +workspaces-save-conda-env (&rest _args)
;; Save current conda environment to a persp parameter
(set-persp-parameter 'conda-env conda-env-current-name)
)
(defun +workspaces-activate-conda-env (&rest _)
;; Restore and activate conda environment
(conda-env-deactivate)
(when-let* ((state (persp-parameter 'conda-env)))
(conda-env-activate (persp-parameter 'conda-env))
))
(add-hook 'persp-before-deactivate-functions #'+workspaces-save-conda-env)
(add-hook 'persp-activated-functions #'+workspaces-activate-conda-env)
I guess it would be possible to have something like that at the buffer level?
conda-env-autoactivate-mode
should do this, but we don't handle the multiple Python sessions -- the inferior Python is handled separately and isn't conda env aware yet. Would love a PR or help making this happen, though!
I seem to have
conda.el
working well for one Python session at a time. Is it possible to configure conda.el to support multiple sessions?I'd like to open
proj.py
in folderproj
that usesENV1
. Maybe start a Python session. Maybe not. Then also openproj.py
(same file name?) in folderproj
(same folder name? Different path?) that usesENV2
. Then from eitherproj.py
start Python, and toggle between them, and have each running in their own inferior*Python-ENV*
buffer.Is this possible with
conda.el
?