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

pkg_resources: Updates from upstream typing merge #11455

Merged
merged 26 commits into from
Mar 8, 2024

Conversation

Avasam
Copy link
Sponsor Collaborator

@Avasam Avasam commented Feb 20, 2024

So why even complete pkg_resources in the first place, if it's considered deprecated in favor of importlib.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.

This comment has been minimized.

This comment has been minimized.

@Avasam Avasam marked this pull request as draft February 20, 2024 08:08

This comment has been minimized.

This comment has been minimized.

This comment has been minimized.

@Avasam Avasam marked this pull request as ready for review February 28, 2024 01:35

This comment has been minimized.

@Avasam
Copy link
Sponsor Collaborator Author

Avasam commented Feb 28, 2024

Self-reviewing the amount of changes in 1 file, I'll put this back as draft and split it up in smaller chunks.

@Avasam Avasam marked this pull request as draft February 28, 2024 05:34

This comment has been minimized.

This comment has been minimized.

This comment has been minimized.

This comment has been minimized.

@Avasam Avasam changed the title pkg_resources (setuptools): Make stubtest-complete and pyright-strict pkg_resources (setuptools): Make pyright-strict Mar 7, 2024
@Avasam Avasam changed the title pkg_resources (setuptools): Make pyright-strict pkg_resources (setuptools): Updates from upstream typing merge Mar 8, 2024

This comment has been minimized.

@Avasam Avasam marked this pull request as ready for review March 8, 2024 04:27
@Avasam Avasam changed the title pkg_resources (setuptools): Updates from upstream typing merge pkg_resources: Updates from upstream typing merge Mar 8, 2024

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: ...
Copy link
Sponsor Collaborator Author

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: ...
Copy link
Sponsor Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

github-actions bot commented Mar 8, 2024

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

Copy link
Collaborator

@srittau srittau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@srittau srittau merged commit af84d2f into python:main Mar 8, 2024
43 checks passed
@Avasam Avasam deleted the strict-setuptools.pkg_resources branch March 8, 2024 16:01
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 this pull request may close these issues.

None yet

3 participants