mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-01-24 20:12:08 +08:00
Upgrade black version (#7089)
This commit is contained in:
@@ -91,6 +91,7 @@ if sys.version_info >= (3, 7):
|
||||
else:
|
||||
@abstractmethod
|
||||
def is_resource(self, name: str) -> bool: ...
|
||||
|
||||
@abstractmethod
|
||||
def contents(self) -> Iterator[str]: ...
|
||||
|
||||
@@ -173,6 +174,7 @@ if sys.version_info >= (3, 9):
|
||||
def read_bytes(self) -> bytes: ...
|
||||
@abstractmethod
|
||||
def read_text(self, encoding: str | None = ...) -> str: ...
|
||||
|
||||
class TraversableResources(ResourceReader):
|
||||
@abstractmethod
|
||||
def files(self) -> Traversable: ...
|
||||
|
||||
@@ -82,6 +82,7 @@ class FrozenImporter(importlib.abc.MetaPathFinder, importlib.abc.InspectLoader):
|
||||
else:
|
||||
@classmethod
|
||||
def create_module(cls, spec: ModuleSpec) -> types.ModuleType | None: ...
|
||||
|
||||
@staticmethod
|
||||
def exec_module(module: types.ModuleType) -> None: ...
|
||||
|
||||
@@ -106,6 +107,7 @@ class PathFinder:
|
||||
elif sys.version_info >= (3, 8):
|
||||
@classmethod
|
||||
def find_distributions(cls, context: DistributionFinder.Context = ...) -> Iterable[PathDistribution]: ...
|
||||
|
||||
@classmethod
|
||||
def find_spec(
|
||||
cls, fullname: str, path: Sequence[bytes | str] | None = ..., target: types.ModuleType | None = ...
|
||||
|
||||
@@ -15,10 +15,12 @@ if sys.version_info >= (3, 10):
|
||||
|
||||
if sys.version_info >= (3, 8):
|
||||
class PackageNotFoundError(ModuleNotFoundError): ...
|
||||
|
||||
class _EntryPointBase(NamedTuple):
|
||||
name: str
|
||||
value: str
|
||||
group: str
|
||||
|
||||
class EntryPoint(_EntryPointBase):
|
||||
pattern: ClassVar[Pattern[str]]
|
||||
def load(self) -> Any: ... # Callable[[], Any] or an importable module
|
||||
@@ -32,6 +34,7 @@ if sys.version_info >= (3, 8):
|
||||
if sys.version_info >= (3, 10):
|
||||
dist: ClassVar[Distribution | None]
|
||||
def matches(self, **params: Any) -> bool: ... # undocumented
|
||||
|
||||
class PackagePath(pathlib.PurePosixPath):
|
||||
def read_text(self, encoding: str = ...) -> str: ...
|
||||
def read_binary(self) -> bytes: ...
|
||||
@@ -40,10 +43,12 @@ if sys.version_info >= (3, 8):
|
||||
hash: FileHash | None
|
||||
size: int | None
|
||||
dist: Distribution
|
||||
|
||||
class FileHash:
|
||||
mode: str
|
||||
value: str
|
||||
def __init__(self, spec: str) -> None: ...
|
||||
|
||||
class Distribution:
|
||||
@abc.abstractmethod
|
||||
def read_text(self, filename: str) -> str | None: ...
|
||||
@@ -74,24 +79,29 @@ if sys.version_info >= (3, 8):
|
||||
if sys.version_info >= (3, 10):
|
||||
@property
|
||||
def name(self) -> str: ...
|
||||
|
||||
class DistributionFinder(MetaPathFinder):
|
||||
class Context:
|
||||
name: str | None
|
||||
def __init__(self, *, name: str | None = ..., path: list[str] = ..., **kwargs: Any) -> None: ...
|
||||
@property
|
||||
def path(self) -> list[str]: ...
|
||||
|
||||
@abc.abstractmethod
|
||||
def find_distributions(self, context: DistributionFinder.Context = ...) -> Iterable[Distribution]: ...
|
||||
|
||||
class MetadataPathFinder(DistributionFinder):
|
||||
@classmethod
|
||||
def find_distributions(cls, context: DistributionFinder.Context = ...) -> Iterable[PathDistribution]: ...
|
||||
if sys.version_info >= (3, 10):
|
||||
# Yes, this is an instance method that has argumend named "cls"
|
||||
def invalidate_caches(cls) -> None: ... # type: ignore
|
||||
|
||||
class PathDistribution(Distribution):
|
||||
def __init__(self, path: Path) -> None: ...
|
||||
def read_text(self, filename: StrPath) -> str: ...
|
||||
def locate_file(self, path: StrPath) -> PathLike[str]: ...
|
||||
|
||||
def distribution(distribution_name: str) -> Distribution: ...
|
||||
@overload
|
||||
def distributions(*, context: DistributionFinder.Context) -> Iterable[Distribution]: ...
|
||||
|
||||
Reference in New Issue
Block a user