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: Remove stray Anys and use more Self & NoReturn types #11528

Merged
merged 4 commits into from
Mar 8, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions stubs/setuptools/pkg_resources/__init__.pyi
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import types
import zipimport
from _typeshed import Incomplete
from collections.abc import Callable, Generator, Iterable, Iterator, Mapping, Sequence
from collections.abc import Callable, Generator, Iterable, Iterator, Sequence
from io import BytesIO
from pkgutil import get_importer as get_importer
from re import Pattern
Expand Down Expand Up @@ -265,7 +265,7 @@ class IMetadataProvider(Protocol):
def metadata_listdir(self, name: str) -> list[str]: ...
def get_metadata(self, name: str) -> str: ...
def get_metadata_lines(self, name: str) -> Generator[str, None, None]: ...
def run_script(self, script_name: str, namespace: Mapping[str, object]) -> None: ...
def run_script(self, script_name: str, namespace: dict[str, Any]) -> None: ...

class ResolutionError(Exception): ...

Expand Down Expand Up @@ -333,7 +333,7 @@ class NullProvider:
def metadata_isdir(self, name: str) -> bool: ...
def resource_listdir(self, resource_name) -> list[str]: ...
def metadata_listdir(self, name: str) -> list[str]: ...
def run_script(self, script_name: str, namespace: Mapping[str, object]) -> None: ...
def run_script(self, script_name: str, namespace: dict[str, Any]) -> None: ...
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Taken from

typeshed/stdlib/builtins.pyi

Lines 1330 to 1331 in 35b74bc

__globals: dict[str, Any] | None = None,
__locals: Mapping[str, object] | None = None,


# Doesn't actually extend NullProvider, solves a typing issue in pytype_test.py
class Distribution(NullProvider):
Expand Down
Loading