11from __future__ import annotations
22
3+ import importlib .metadata
34from typing import TYPE_CHECKING , Any , Protocol
45
5- from mdformat ._compat import importlib_metadata
6-
76if TYPE_CHECKING :
87 import argparse
98 from collections .abc import Callable , Mapping
1413
1514
1615def _load_entrypoints (
17- eps : importlib_metadata .EntryPoints ,
16+ eps : importlib . metadata .EntryPoints ,
1817) -> tuple [dict [str , Any ], dict [str , tuple [str , list [str ]]]]:
1918 loaded_ifaces : dict [str , Any ] = {}
2019 dist_versions : dict [str , tuple [str , list [str ]]] = {}
@@ -95,7 +94,7 @@ def __getattr__(name: str) -> Mapping[str, Any]:
9594 """
9695 if name in {"CODEFORMATTERS" , "_CODEFORMATTER_DISTS" }:
9796 formatters , formatter_dists = _load_entrypoints (
98- importlib_metadata .entry_points (group = "mdformat.codeformatter" )
97+ importlib . metadata .entry_points (group = "mdformat.codeformatter" )
9998 )
10099 # Cache the values in this module for next time, so that `__getattr__`
101100 # is only called once per `name`.
@@ -105,7 +104,7 @@ def __getattr__(name: str) -> Mapping[str, Any]:
105104 return formatters if name == "CODEFORMATTERS" else formatter_dists
106105 if name in {"PARSER_EXTENSIONS" , "_PARSER_EXTENSION_DISTS" }:
107106 extensions , extension_dists = _load_entrypoints (
108- importlib_metadata .entry_points (group = "mdformat.parser_extension" )
107+ importlib . metadata .entry_points (group = "mdformat.parser_extension" )
109108 )
110109 # Cache the value in this module for next time, so that `__getattr__`
111110 # is only called once per `name`.
0 commit comments