Add mcp.types as a permanent alias for mcp_types (#3190)
This commit is contained in:
parent
923341c98a
commit
b7c9a916d6
1 changed files with 467 additions and 364 deletions
|
|
@ -30,6 +30,12 @@ API_DIR = ROOT / "docs" / "api"
|
|||
# it from `src/` would emit the unimportable `mcp-types.mcp_types.*`.
|
||||
PACKAGES = (ROOT / "src" / "mcp", ROOT / "src" / "mcp-types" / "mcp_types")
|
||||
|
||||
# Alias packages that mirror another package's namespaces (`mcp.types` mirrors
|
||||
# `mcp_types`, `mcp.types.version` mirrors `mcp_types.version`): the mirrored
|
||||
# package's pages are the canonical rendering, so an alias, and every module
|
||||
# under it, earns no page of its own.
|
||||
EXCLUDED = frozenset({"mcp.types"})
|
||||
|
||||
_KIND_SECTIONS = {
|
||||
griffe.Kind.MODULE: "Modules",
|
||||
griffe.Kind.CLASS: "Classes",
|
||||
|
|
@ -185,6 +191,8 @@ def generate() -> list[NavItem]:
|
|||
continue
|
||||
|
||||
ident = ".".join(parts)
|
||||
if any(ident == e or ident.startswith(f"{e}.") for e in EXCLUDED):
|
||||
continue
|
||||
documented.add(ident)
|
||||
stubs[API_DIR / doc_path] = _stub(parts[-1], f"::: {ident}")
|
||||
pages[ident] = API_DIR / doc_path
|
||||
|
|
|
|||
Loading…
Reference in a new issue