Remove setuptools/pkg_resources (#13369)

This commit is contained in:
Avasam
2025-03-04 12:11:10 +01:00
committed by GitHub
parent e4a8707e9c
commit 641ca188ef
12 changed files with 23 additions and 746 deletions
+8 -3
View File
@@ -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: ...