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

Add py.typed? #129

Closed
sminnee opened this issue Sep 14, 2022 · 2 comments · Fixed by #135
Closed

Add py.typed? #129

sminnee opened this issue Sep 14, 2022 · 2 comments · Fixed by #135

Comments

@sminnee
Copy link

sminnee commented Sep 14, 2022

Pylance in VSCode doesn't appear to use this package in favour of its built-in typeshed types.

Reading through microsoft/pylance-release#1197 it sounds like any modules marked as py.typed will be used in favour of typeshed types.

In that context, would it make senes to mark this module as py.typed?

@sbdchd
Copy link
Owner

sbdchd commented Sep 14, 2022

Ah interesting, from https://peps.python.org/pep-0561/#stub-only-packages I thought the name -stubs would be enough, but adding a py.typed file couldn't hurt I guess

still feels like a bug on the pylance side of things

@rafsaf
Copy link

rafsaf commented Sep 27, 2022

I would be interested in merging this: #135

Nice spot @sminnee! I can confirm it indeed works (adding py.typed file), had no idea why pylance didn't prefer those stubs (which are much better than bundled ones used to be) over bundled... and I just needed every time to delete bundled django stubs which is a little annoying

Funny thing is, since yesterday MS pylance now use this package for stubs so it's not a problem anymore (unless there are new releases etc) https://github.com/microsoft/pylance-release/blob/main/CHANGELOG.md#2022940-26-september-2022-release

@kodiakhq kodiakhq bot closed this as completed in #135 Sep 28, 2022
kodiakhq bot pushed a commit that referenced this issue Sep 28, 2022
fix #129

vscode pylance needs explicite `py.typed` files to prefer stubs package more over bundled stubs, see https://github.com/microsoft/pylance-release/blob/main/CHANGELOG.md#202153-19-may-2021

note, since yesterday this is somewhat "fixed" because... this package is now used in pylance bundled stubs :D
https://github.com/microsoft/pylance-release/blob/main/CHANGELOG.md#2022940-26-september-2022-release
but still it won't hurt to have it (they can change stubs at any time as they did now)

tested on pylance 2022.09.30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants