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: Types from assignments and aliases #11511

Merged

Conversation

Avasam
Copy link
Collaborator

@Avasam Avasam commented Feb 29, 2024

Extracted from #11455
Updated types that are either simplified or improved by using an assignement

@@ -248,7 +326,7 @@ class NullProvider:
def metadata_listdir(self, name: str) -> list[str]: ...
def run_script(self, script_name: str, namespace: dict[str, Any]) -> None: ...

# Doesn't actually extend NullProvider
# Doesn't actually extend NullProvider, solves a typing issue in pytype_test.py
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

idk if that's still true, but that was the original reasoning, where some method returned a Distribution which was missing a property that NullProvider has.

This comment has been minimized.

@Avasam Avasam changed the title pkg_resoruces: Types from assignments and aliases pkg_resources: Types from assignments and aliases Feb 29, 2024
def get_supported_platform() -> str: ...
def compatible_platforms(provided: str | None, required: str | None) -> bool: ...
def get_default_cache() -> str: ...
def get_importer(path_item: str) -> _Importer: ...
Copy link
Member

Choose a reason for hiding this comment

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

You also removed this on another PR, not sure why.

Otherwise this PR looks good.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It's a re-import, (moved all the way to the top of the file).

Both PRs touched it because this change was relevant to both (it's now an import alias and it removes the _Importer class)

Copy link
Member

Choose a reason for hiding this comment

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

Ah right, I missed that.

Copy link
Contributor

github-actions bot commented Mar 1, 2024

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

@JelleZijlstra JelleZijlstra merged commit 696333c into python:main Mar 1, 2024
45 checks passed
@Avasam Avasam deleted the pkg_resources-types-from-assignement branch March 1, 2024 23:40
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.

2 participants