-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
pkg_resources
: Updates from upstream typing merge
#11455
Conversation
This comment has been minimized.
This comment has been minimized.
…Avasam/typeshed into strict-setuptools.pkg_resources
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Add _EntryPoint alias
This comment has been minimized.
This comment has been minimized.
…-setuptools.pkg_resources
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Self-reviewing the amount of changes in 1 file, I'll put this back as draft and split it up in smaller chunks. |
…-setuptools.pkg_resources
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
…Avasam/typeshed into strict-setuptools.pkg_resources
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
pkg_resources
(setuptools): Make stubtest-complete and pyright-strictpkg_resources
(setuptools): Make pyright-strict
…-setuptools.pkg_resources
pkg_resources
(setuptools): Make pyright-strictpkg_resources
(setuptools): Updates from upstream typing merge
This comment has been minimized.
This comment has been minimized.
This reverts commit a8cdbb2.
pkg_resources
(setuptools): Updates from upstream typing mergepkg_resources
: Updates from upstream typing merge
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
@@ -260,11 +259,11 @@ def get_provider(moduleOrReq: str) -> IResourceProvider: ... | |||
def get_provider(moduleOrReq: Requirement) -> Distribution: ... | |||
|
|||
class IMetadataProvider(Protocol): | |||
def has_metadata(self, name: str) -> bool | None: ... | |||
def has_metadata(self, name: str) -> bool: ... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -326,9 +325,9 @@ class NullProvider: | |||
def get_resource_stream(self, manager: ResourceManager, resource_name) -> BytesIO: ... | |||
def get_resource_string(self, manager: ResourceManager, resource_name): ... | |||
def has_resource(self, resource_name) -> bool: ... | |||
def has_metadata(self, name: str) -> bool | None: ... | |||
def has_metadata(self, name: str) -> bool: ... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
So why even complete
pkg_resources
in the first place, if it's considered deprecated in favor ofimportlib.resources
,importlib.metadata
and their backports?Because I've started merging the stubs directly into the setuptools repo, with the goal of being able to take it out of typeshed. And in doing so, found a lot of improvements to the typeshed stubs. At that point I was a few changes away from completing it, so here it is.
This also allowed me to cross-validate a handful of annotations, and I'll use the typeshed stubs as the reference for an upcoming PR that finishes typing
pkg_resources
upstream.