mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-08-10 01:42:29 +08:00
Remove setuptools/pkg_resources (#13369)
This commit is contained in:
@@ -1,14 +1,19 @@
|
||||
from abc import abstractmethod
|
||||
from collections.abc import Iterable
|
||||
from threading import Lock
|
||||
from typing import Any, ClassVar, Literal, Protocol, TypeVar
|
||||
from typing import Any, ClassVar, Literal, Protocol, TypeVar, type_check_only
|
||||
from typing_extensions import Self
|
||||
|
||||
from fanstatic.compiler import Compiler, Minifier
|
||||
from fanstatic.core import Library
|
||||
from fanstatic.injector import InjectorPlugin
|
||||
from pkg_resources import EntryPoint
|
||||
|
||||
# Used to be pkg_resources.EntryPoint, but any EntryPoint-like class with a `load` method works
|
||||
@type_check_only
|
||||
class _EntryPoint(Protocol):
|
||||
def load(self) -> Any: ... # Can be any attribute in the module
|
||||
|
||||
@type_check_only
|
||||
class _HasName(Protocol):
|
||||
@property
|
||||
def name(self) -> str: ...
|
||||
@@ -24,7 +29,7 @@ class Registry(dict[str, _NamedT]):
|
||||
def __init__(self, items: Iterable[_NamedT] = ()) -> None: ...
|
||||
def add(self, item: _NamedT) -> None: ...
|
||||
def load_items_from_entry_points(self) -> None: ...
|
||||
def make_item_from_entry_point(self, entry_point: EntryPoint) -> Any: ...
|
||||
def make_item_from_entry_point(self, entry_point: _EntryPoint) -> Any: ...
|
||||
@classmethod
|
||||
def instance(cls) -> Self: ...
|
||||
|
||||
|
||||
Reference in New Issue
Block a user