zed
zed copied to clipboard
Support for poetry, pipenv
Check for existing issues
- [ ] Completed
Is your feature request related to a problem?
Primary issue: zed-industries/zed#5524
This issue answers the core venv structure, but displays problem with real build tools. Problem in build tools, that are used with python development. In python development we have:
All of them creating virtual environment, that Zed doesn't see. And there is no option to activate any of them. I read through the issue, that I mentioned, but there is still no decision about that. Manual configuration in config folder doesn't seem like good decision at all.
Describe the solution you'd like
I think that there is three ways of solution. There is no way of configuration, I see only hard wrap around these tools.
Solution through confing file
Maybe here need to add documentation about manual configuration through the file of workspace. I think, that We need in something like
// .zed/settings.json
{
"python": {
"venv": "$HOME/.venv/pretty-project-52331fds/",
"tool": "pipenv" // | "poetry" | "pip"
},
...
}
This is might be useful in any cases. This could help with fast loading of workspaces and sharing configuration with teammates.
Solution through selecting with menu
See mockups in bottom section. Selecting through menu might be more user friendly than manual configuration.
Just selecting item
See mockups in bottom section. I would like to see this way also. It is also good approach of how to activate virtual environment.
If applicable, add mockups / screenshots to help present your vision of the feature
Example of UI with selecting of env

Selecting Python tool

I forgot to mention solution, that might help for developers of Zig. I don't know the API of the application, but suggest this code to work fine, I guess.
For Tools I suggest to have some sort of wrap, that might be helpful. You possibly need to wrap all of them in such way:
#[derive(Debug)]
pub struct Pipenv impl LanguageTool {
pub fn loadLibraries(ctx: WorkspaceCtx) {
// Here goes workspace context loading with libraries
}
pub fn configureLSP(lsp: LanguageServer) {
// Configure LSP
}
}
This might work, but don't know for real or not. Probably loading of workspace tools, like additional linters, package managers and other things are not supported here, but I just guess it might work
Hey @AssertionBit, wanted to thank you for the amount of detail you put into this feature request. I would love it if we could support Poetry. For anyone who isn't a Python dev, Poetry to Python is what Cargo is to Rust.
It would also be helpful to to have support for miniconda, mamba, and micromamba, which are frequently used in the machine learning space.
UP
Any updates on this? Not being able to use venvs with zed is a bummer...
Any updates on this? Not being able to use venvs with zed is a bummer...
basically makes it unusable for any serious programming, such a shame.
Any updates on this? Not being able to use venvs with zed is a bummer...
You actually are able to using virtual environments, just not in the ideal way that is supposedly planned to be based on this issue.
You can create a pyrightconfig.json in the root of your project and set the venvPath and venv keys to the json file setting their respective paths.
For example:
{
"venvPath": "/Users/biscoito/Library/Caches/pypoetry/virtualenvs",
"venv": "/Users/biscoito/Library/Caches/pypoetry/virtualenvs/project-4LmRIiew-py3.12"
}
And also, bumping this since native support and detection for virtual environments would be such a cool implementation for those who use Python frequently and switch projects frequently.
Any updates on this? Not being able to use venvs with zed is a bummer...
You actually are able to using virtual environments, just not in the ideal way that is supposedly planned to be based on this issue.
You can create a
pyrightconfig.jsonin the root of your project and set thevenvPathandvenvkeys to the json file setting their respective paths.For example:
{ "venvPath": "/Users/biscoito/Library/Caches/pypoetry/virtualenvs", "venv": "/Users/biscoito/Library/Caches/pypoetry/virtualenvs/project-4LmRIiew-py3.12" }And also, bumping this since native support and detection for virtual environments would be such a cool implementation for those who use Python frequently and switch projects frequently.
Here's the issue for that request:
- https://github.com/zed-industries/zed/issues/7646