GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — commitizen/commitizen/cz/__init__.py at master · commitizen-tools/commitizen Expand file tree/ Copy path__init__.pyMore file actions 43 lines (33 loc) · 1.28 KB / Copy path__init__.pyFile metadata and controls43 lines (33 loc) · 1.28 KB 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 from __future__ import annotations import importlib import pkgutil import warnings from collections.abc import Iterable from importlib import metadata from typing import TYPE_CHECKING if TYPE_CHECKING: from collections.abc import Iterable from commitizen.cz.base import BaseCommitizen def discover_plugins( path: Iterable[str] | None = None, ) -> dict[str, type[BaseCommitizen]]: """Discover commitizen plugins on the path Args: path (Path, optional): If provided, 'path' should be either None or a list of paths to look for modules in. If path is None, all top-level modules on sys.path.. Defaults to None. Returns: Dict[str, Type[BaseCommitizen]]: Registry with found plugins """ for _, name, _ in pkgutil.iter_modules(path): if name.startswith("cz_"): mod = importlib.import_module(name) if hasattr(mod, "discover_this"): warnings.warn( UserWarning( f"Legacy plugin '{name}' has been ignored: please expose it the 'commitizen.plugin' entrypoint" ) ) return { ep.name: ep.load() for ep in metadata.entry_points(group="commitizen.plugin") } registry: dict[str, type[BaseCommitizen]] = discover_plugins() |
| You are visitor 01402520 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |