Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

uv add --editable . package isn't recognized by static analysis #11488

Closed
tonydavis629 opened this issue Feb 13, 2025 · 5 comments
Closed

uv add --editable . package isn't recognized by static analysis #11488

tonydavis629 opened this issue Feb 13, 2025 · 5 comments
Labels
external The problem is with another package or dependency (not uv) question Asking for clarification or support

Comments

@tonydavis629
Copy link

tonydavis629 commented Feb 13, 2025

Summary

Following this issue #3898, I'm trying to understand how to make pylance see local packages installed with uv add --editable. The package itself works fine, it's just the vscode/pylance static analysis that cannot find the package.

I have the current setting in my pyproject.toml:

[tool.uv]
config-settings = { editable_mode = "compat" }

I also tried including that setting in the package's pyproject.toml to no effect.

I understand there's some turmoil generally caused by PEP660 microsoft/pylance-release#3473 but as far as I understand uv is supposed to be PEP660 compatible? Is this still an upstream issue? Or am I doing something wrong?

Platform

Linux 5.14.0-427.33.1.el9_4.x86_64 x86_64 GNU/Linux

Version

uv 0.5.31

Python version

python 3.12.7

@tonydavis629 tonydavis629 added the bug Something isn't working label Feb 13, 2025
@konstin
Copy link
Member

konstin commented Feb 13, 2025

PEP 660 is very unopinionated about how the editable installation works. uv is PEP 660 compatible, it installs whatever the build backend gives it, and this layout is a decision made by setuptools (pypa/setuptools#3518). uv can't really do anything here, it has to respect what the build backend does. One option is to switch to different build backend with a different editable behavior.

@konstin konstin added question Asking for clarification or support external The problem is with another package or dependency (not uv) and removed bug Something isn't working labels Feb 13, 2025
@zanieb
Copy link
Member

zanieb commented Feb 13, 2025

See also #10946 (comment)

@zanieb
Copy link
Member

zanieb commented Feb 13, 2025

I am surprised this isn't working with the compat mode though.

@charliermarsh
Copy link
Member

You might just need to restart Pylance or something after installing.

@tonydavis629
Copy link
Author

tonydavis629 commented Feb 13, 2025

I'm not sure what I did but pylance started to find it suddenly after I edited my package. I'm pretty confused, but it does seem to work, just maybe not super reliably.

You might just need to restart Pylance or something after installing.

Yeah I tried that initially but didn't help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
external The problem is with another package or dependency (not uv) question Asking for clarification or support
Projects
None yet
Development

No branches or pull requests

4 participants