necaris / conda.el

Emacs helper library (and minor mode) to work with conda environments
MIT License
153 stars 51 forks source link

conda.el, elpy, and python-mode conflicts #159

Open dadinn opened 5 months ago

dadinn commented 5 months ago

I am using Emacs version 29.3.

I have installed conda.el package via straight.el, and used the current main branch HEAD commit: 60e14d1e9793431b91913a5688e278bd91d56224.

This is an minimal example init.el to reproduce the issue:

;; disable package.el
(when (version<= "27.0.0" emacs-version)
  (setq package-enable-at-startup nil))

;; bootstrapping straight.el
(defvar bootstrap-version)
(let ((bootstrap-file
       (expand-file-name
        "straight/repos/straight.el/bootstrap.el"
        (or (bound-and-true-p straight-base-dir)
            user-emacs-directory)))
      (bootstrap-version 7))
  (unless (file-exists-p bootstrap-file)
    (with-current-buffer
        (url-retrieve-synchronously
         "https://raw.githubusercontent.com/radian-software/straight.el/develop/install.el"
         'silent 'inhibit-cookies)
      (goto-char (point-max))
      (eval-print-last-sexp)))
  (load bootstrap-file nil 'nomessage))

;; install use-package
(straight-use-package 'use-package)

(custom-set-variables
 '(straight-use-package-by-default t)
 '(straight-vc-git-default-protocol (quote https)))

(use-package conda
  :after
  (python)
  :config
  (conda-env-initialize-eshell))

(use-package elpy
  :after
  (python)
  :init
  (elpy-enable))

If the :after (python) line is removed in either the conda or elpy config, then both conda-env-initialize-eshell and elpy-enable fails to be loaded correctly. When checking either function on the describe-function interface, it can't find the function definitions in their respective git repositories. The end result is when opening .py files elpy-mode will not get activated. I assume the conda environments would not work either.

Not sure if this is a conda.el related issue exclusively, but something doesn't look OK. At least I've nowhere seen it mentioned that the :after (python) lines are necessary.