necaris / conda.el

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

Is there a reason not to get the user's config by default if it exists? #139

Open naupaka opened 1 year ago

naupaka commented 1 year ago

https://github.com/necaris/conda.el/blob/2af92fead0e24b9cae7d0c5b446177694fc8a77e/conda.el#L193

Thanks for the great work on this. I am wondering why this is commented out by default. I've run into a tricky issue where org-roam requires ripgrep with pcre2 support, which isn't in the conda version of ripgrep, but it is in the homebrew version or the compiled version via cargo. So, the easy solution is to stop conda from activating the base environment by default, and then just activate a specific environment for use when working on a coding project. The way to do this is with conda config --set auto_activate_base false, which gets stored to the .condarc file.

So all is good now in a terminal, but not in GUI emacs or eshell in GUI emacs.

After some digging around, I found you have a function to read the condarc, but it's not run by default, those it seems like it probably should be?

In any event -- this isn't really a bug, but I'm wondering if there is a downside to getting the user's conda config? E.g. what might I unexpectedly break by doing this?

I've fixed my issue by adding the following to my config.org (using doom emacs with the +conda option to python).

(after! conda
  (conda--get-config))
necaris commented 1 year ago

@naupaka doing things the way you have -- in (after! in Doom -- should be just fine! In fact, that's the way I have it set up myself!

The reason that (conda--get-config) is commented out is that I was concerned caching the configuration at load time might mess things up, if there are environment variables or other things that need to be set first.

naupaka commented 1 year ago

Thanks for letting me know! You can close this issue -- I thought adding it would help other folks find it if they are running to the same problem even if it's not a bug.

naupaka commented 1 year ago

Perhaps a small note in the readme might help people see that this is an option.

necaris commented 1 year ago

I'll do that -- thank you!

On Fri, Dec 23, 2022 at 8:07 PM Naupaka Zimmerman @.***> wrote:

Perhaps a small note in the readme might help people see that this is an option.

— Reply to this email directly, view it on GitHub https://github.com/necaris/conda.el/issues/139#issuecomment-1364429068, or unsubscribe https://github.com/notifications/unsubscribe-auth/AADQPYOLTALBVRVXDAAWFS3WOZEG5ANCNFSM6AAAAAATDXM34Y . You are receiving this because you commented.Message ID: <necaris/conda. @.***>