poetry environment discovery on Linux (#47100)
Closes #47098 The root cause of this issue is related to how `Poetry` (and the upstream `pet-poetry` library) handles path hashing. While perhaps it's an upstream behavior, we can easily fix it on the Zed side. The related code are https://github.com/zed-industries/zed/blob/7ce845210d3af82a57a7518e0abe8c167d60cc6a/crates/languages/src/python.rs#L1181-L1211 In my debugging, I found that `worktree_root` takes the form `/home/user/project`, but `config.workspace_directories` often ends up as `/home/user/project/`(with a trailing slash). Normally this wouldn't be an issue, but `Poetry` generates environment names based on the hash of the absolute path. Since the hashes for `/home/user/project` and `/home/user/project/` are different, `pet-poetry` fails to find the environment. The fix is straightforward: we just need to ensure the trailing `/` is removed so the hashes match. Release Notes: - Fixed poetry environment not discovered on linux
Zed
Welcome to Zed, a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
Installation
On macOS, Linux, and Windows you can download Zed directly or install Zed via your local package manager (macOS/Linux/Windows).
Other platforms are not yet available:
- Web (tracking issue)
Developing Zed
Contributing
See CONTRIBUTING.md for ways you can contribute to Zed.
Also... we're hiring! Check out our jobs page for open roles.
Licensing
License information for third party dependencies must be correctly provided for CI to pass.
We use cargo-about to automatically comply with open source licenses. If CI is failing, check the following:
- Is it showing a
no license specifiederror for a crate you've created? If so, addpublish = falseunder[package]in your crate's Cargo.toml. - Is the error
failed to satisfy license requirementsfor a dependency? If so, first determine what license the project has and whether this system is sufficient to comply with this license's requirements. If you're unsure, ask a lawyer. Once you've verified that this system is acceptable add the license's SPDX identifier to theacceptedarray inscript/licenses/zed-licenses.toml. - Is
cargo-aboutunable to find the license for a dependency? If so, add a clarification field at the end ofscript/licenses/zed-licenses.toml, as specified in the cargo-about book.
Sponsorship
Zed is developed by Zed Industries, Inc., a for-profit company.
If you’d like to financially support the project, you can do so via GitHub Sponsors. Sponsorships go directly to Zed Industries and are used as general company revenue. There are no perks or entitlements associated with sponsorship.