Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 2.1k
Update importlib.metadata typings for 3.10#7331
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
Merged
JelleZijlstra
merged 19 commits into
python:master
from
itaisteinherz:feature/importlib-metadata-updatesFeb 25, 2022
Uh oh!
There was an error while loading. Please reload this page.
Merged
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
32b37e8
Fix importlib_metadata.metadata typings
itaisteinherz 3f301ec
Update importlib_metadata.metadata.entry_points() typings
itaisteinherz 6395541
Fixup method signature
itaisteinherz 10f183e
Some fixes
itaisteinherz 200fba5
Add missing type hint
itaisteinherz 87f2ea7
Add back `EntryPoints`
itaisteinherz bfc08ce
Revert incorrect change
itaisteinherz a10cced
Improvements
itaisteinherz 1f5cd36
CR improvements
itaisteinherz 590cd18
Merge branch 'master' into feature/importlib-metadata-updates
srittau 888abb9
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] b7b5a99
Restore property lost during merge
srittau 04fc42a
CR improvements
itaisteinherz e149789
Add missing ellipsis
itaisteinherz c761e96
Ignore some errors
itaisteinherz 08e2c31
Mention specific attributes and types instead of `params`
itaisteinherz 1ba3666
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 55a29da
Fix annotation of keyword-only arguments
itaisteinherz c21677d
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,7 @@ | ||
| import abc | ||
| import pathlib | ||
| import sys | ||
| from _typeshed import StrPath | ||
| from _typeshed import Self, StrPath | ||
| from collections.abc import Mapping | ||
| from email.message import Message | ||
| from importlib.abc import MetaPathFinder | ||
| @@ -61,7 +61,56 @@ class EntryPoint(_EntryPointBase): | ||
| def attr(self) -> str: ... | ||
| if sys.version_info >= (3, 10): | ||
| dist: ClassVar[Distribution | None] | ||
| def matches(self, **params: Any) -> bool: ... # undocumented | ||
| def matches( | ||
| self, | ||
| *, | ||
| name: str = ..., | ||
| value: str = ..., | ||
| group: str = ..., | ||
| module: str = ..., | ||
| attr: str = ..., | ||
| extras: list[str] = ..., | ||
itaisteinherz marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| ) -> bool: ... # undocumented | ||
| if sys.version_info >= (3, 10): | ||
| class EntryPoints(list[EntryPoint]): # use as list is deprecated since 3.10 | ||
| # int argument is deprecated since 3.10 | ||
| def __getitem__(self, item: int | str) -> EntryPoint: ... # type: ignore[override] | ||
| def select( | ||
| self, | ||
| *, | ||
| name: str = ..., | ||
| value: str = ..., | ||
| group: str = ..., | ||
| module: str = ..., | ||
| attr: str = ..., | ||
| extras: list[str] = ..., | ||
| ) -> EntryPoints: ... | ||
| @property | ||
| def names(self) -> set[str]: ... | ||
| @property | ||
| def groups(self) -> set[str]: ... | ||
| class SelectableGroups(dict[str, EntryPoints]): # use as dict is deprecated since 3.10 | ||
| @classmethod | ||
| def load(cls: type[Self], eps: Iterable[EntryPoint]) -> Self: ... | ||
| @property | ||
| def groups(self) -> set[str]: ... | ||
| @property | ||
| def names(self) -> set[str]: ... | ||
| @overload | ||
| def select(self: Self) -> Self: ... # type: ignore[misc] | ||
| @overload | ||
| def select( | ||
| self, | ||
| *, | ||
| name: str = ..., | ||
| value: str = ..., | ||
| group: str = ..., | ||
| module: str = ..., | ||
| attr: str = ..., | ||
| extras: list[str] = ..., | ||
| ) -> EntryPoints: ... | ||
| class PackagePath(pathlib.PurePosixPath): | ||
| def read_text(self, encoding: str = ...) -> str: ... | ||
| @@ -94,13 +143,21 @@ class Distribution: | ||
| ) -> Iterable[Distribution]: ... | ||
| @staticmethod | ||
| def at(path: StrPath) -> PathDistribution: ... | ||
| @property | ||
| def metadata(self) -> Message: ... | ||
| if sys.version_info >= (3, 10): | ||
| @property | ||
| def metadata(self) -> PackageMetadata: ... | ||
| @property | ||
| def entry_points(self) -> EntryPoints: ... | ||
| else: | ||
| @property | ||
| def metadata(self) -> Message: ... | ||
| @property | ||
| def entry_points(self) -> list[EntryPoint]: ... | ||
| @property | ||
| def version(self) -> str: ... | ||
| @property | ||
| def entry_points(self) -> list[EntryPoint]: ... | ||
| @property | ||
| def files(self) -> list[PackagePath] | None: ... | ||
| @property | ||
| def requires(self) -> list[str] | None: ... | ||
| @@ -137,8 +194,20 @@ def distributions(*, context: DistributionFinder.Context) -> Iterable[Distributi | ||
| def distributions( | ||
| *, context: None = ..., name: str | None = ..., path: list[str] = ..., **kwargs: Any | ||
| ) -> Iterable[Distribution]: ... | ||
| def metadata(distribution_name: str) -> Message: ... | ||
| if sys.version_info >= (3, 10): | ||
| def metadata(distribution_name: str) -> PackageMetadata: ... | ||
| @overload | ||
| def entry_points() -> SelectableGroups: ... # type: ignore[misc] | ||
| @overload | ||
| def entry_points( | ||
| *, name: str = ..., value: str = ..., group: str = ..., module: str = ..., attr: str = ..., extras: list[str] = ... | ||
| ) -> EntryPoints: ... | ||
| else: | ||
| def metadata(distribution_name: str) -> Message: ... | ||
| def entry_points() -> dict[str, list[EntryPoint]]: ... | ||
| def version(distribution_name: str) -> str: ... | ||
| def entry_points() -> dict[str, tuple[EntryPoint, ...]]: ... | ||
| def files(distribution_name: str) -> list[PackagePath] | None: ... | ||
| def requires(distribution_name: str) -> list[str] | None: ... | ||
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.