File tree Expand file tree Collapse file tree 2 files changed +22
-5
lines changed
Expand file tree Collapse file tree 2 files changed +22
-5
lines changed Original file line number Diff line number Diff line change 4545from .wrap_modes import WrapModes
4646from .wrap_modes import from_string as wrap_mode_from_string
4747
48- if sys .version_info < (3 , 10 ): # pragma: no cover
49- from importlib_metadata import entry_points
50- else :
51- from importlib .metadata import entry_points
52-
5348if TYPE_CHECKING :
49+ if sys .version_info < (3 , 10 ): # pragma: no cover
50+ EntryPoints = Any
51+ else :
52+ from importlib .metadata import EntryPoints
53+
5454 tomllib : Any
5555else :
5656 if sys .version_info >= (3 , 11 ):
@@ -937,4 +937,17 @@ def _as_bool(value: str) -> bool:
937937 raise ValueError (f"invalid truth value { value } " )
938938
939939
940+ def entry_points (group : str ) -> "EntryPoints" :
941+ """Call entry_point after lazy loading it.
942+
943+ TODO: The reason for lazy loading here are unknown.
944+ """
945+ if sys .version_info < (3 , 10 ): # pragma: no cover
946+ from importlib_metadata import entry_points
947+ else :
948+ from importlib .metadata import entry_points
949+
950+ return entry_points (group = group )
951+
952+
940953DEFAULT_CONFIG = Config ()
Original file line number Diff line number Diff line change @@ -180,6 +180,10 @@ allow_untyped_defs = true
180180allow_incomplete_defs = true
181181allow_untyped_calls = true
182182
183+ [[tool .mypy .overrides ]]
184+ module = " importlib_metadata.*"
185+ ignore_missing_imports = true
186+
183187[tool .ruff ]
184188line-length = 100
185189lint.select = [
You can’t perform that action at this time.
0 commit comments