-
Notifications
You must be signed in to change notification settings - Fork 765
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
Stub file not found on import but imported package has py.typed #555
Comments
@jp-diegidio thank you for the feedback. Could you please put |
Hi there, I have meanwhile ascertained that it happens with all and only the packages that I install with pip --editable. I am copying a little module that reproduces the problem, as well as the log (all names amended for privacy): # x:\__ROOT__\__PROJ__\Project1\Source\base\module0.py
from project1.ext.module1 import Class1 # gives could not be resolved
Class1(int) # everything fine here
|
Editable installs aren't an area we've fully tested yet: #78 |
OK, I see: I hope this will be fixed soon as this is a totally standard development scenario... Anyway, thanks for now. |
I'm going to close this as a dupe of #78, as that's the real problem with the resolution. |
Neither this is a dupe of that (at best that is a dupe of this), nor there is any resolution there, nor you call me out to test your proposed patch despite the quality of my feedback... Thanks anyway! |
Based on your report and trace information, this problem is a duplicate of #78. Both have the same root cause. Pyright previously didn't handle ".pth" files or symlinks, both of which are commonly used in editable installs. We've recently added support for these, so your problem should be addressed when the next version of pylance is released (next week). If you're still seeing this particular problem, we're happy to re-open the bug and look into it. |
I beg to disagree, most of that discussion is about intellisense: my issue is neither a duplicate of that one, nor, more importantly, on my book I can mark it as closed. You have later changed the title of #78, but in fact I am not against you consolidating there, it just went that way, with a little discomfort from my side but so be it: but I had to complain about the "lack of attention" that I got with the above replies and then with the follow-ups in #78. -- It's a little piece of customer feedback, nothing else: thanks for your reply and I'll look forward to the next release. |
Hello guys, not sure this is a bug or me messing up, anyway here we go:
I have a namespaced package, let's call it
some_ns.ext
, that I install withpip -e
. The code is annotated and I just include a py.typed. Here is thesetup.py
:But when I import in client code as follows:
I still get a
Stub file not found for "some_ns.ext.module1" Pylance (reportMissingTypeStubs)
.I am not sure what I am doing wrong, since, per Pylance's docs as well as per issue #355, I'd expect it to just work.
(If I disable the warning, the rest works just fine, i.e. the imported objects do work, type-check and have intellisense as expected: the issue here seems confined to the
import
line.)(For the chronicle, I also have
python.analysis.useLibraryCodeForTypes = true
andpython.analysis.typeCheckingMode='strict'
in my settings.)Thank you,
Julio
The text was updated successfully, but these errors were encountered: