Giter Club home page Giter Club logo

Comments (3)

HallerPatrick avatar HallerPatrick commented on May 26, 2024

Hey @cnrrobertson!

Glad you like my plugin! By looking at the snippet you provide, you are looking at every python binary found in $HOME, right? This would give me a list of at least 20 different python venvs to choose from. py_lsp tries to find venvs based on a strategy like poetry or venv. So we should add a new condastrategy to it.

So what we would need is a command like conda venvs list, that lists all available venvs that are created through conda. Do you know if there exists such a option with conda? Otherwise I could take a look at it?

Here you can find all existing strategies :)

Greetings Patrick

from py_lsp.nvim.

cnrrobertson avatar cnrrobertson commented on May 26, 2024

Yeah, so the local commands = {'fd --glob -tl python $HOME/mambaforge', 'which -a python', is_home_dir() and '' or 'find . -name python'} is the main search command.

It finds python binaries in my conda directory ($HOME/mambaforge), in whatever is currently activated (which -a python could find a venv, conda environment, or just the system binary), and then if we are NOT in $HOME it looks recursively in the current directory to find any environments. Not particularly efficient, I like your implementation better I think.

Conda does have a command conda env list to see all available venvs. The key difference is that all the environments are stored in a $HOME directory rather than in the project directory. It actually makes them easy to find. Common home directory names are ~/anaconda, ~/condaforge, ~/miniconda3, ~/mambaforge. But they could be named anything, so it might require an additional configuration option to get the directory..

I could write up a strategy for finding conda environments with a new source strategy conda that looks for common names in the home directory and submit a PRif that's helpful? I could also add a new configuration option to explicitly give the conda directory name if you're up for that.

from py_lsp.nvim.

HallerPatrick avatar HallerPatrick commented on May 26, 2024

Ah, haven't noticed the mambaforge directory.

Feel free to write a PR, if you are having any questions just write me!

Thanks in advance! 🚀

from py_lsp.nvim.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.