Files
computer-playbook/cli/make/__init__.py
T
kevinveenbirkenbachandClaude Opus 5 a6861da0ed fix(cli): re-export only what a package shim's module defines
Nine package shims listed dir(__main__) and lifted every public name into
the package namespace, so each of them re-exported its imports. pathlib.Path
became a member of nine packages, and sphinx found five targets for a bare
Path annotation: 320 ambiguous cross-references in the documentation build,
down to 10 with this change.

public_names() honours a declared __all__ verbatim and otherwise keeps the
names whose __module__ is the module itself. Nine call sites shared the same
expression, so it lives in one place now.

This narrows a package's public surface: __all__ shrinks and the shim no
longer carries its imports. Every importer in the repository pulls a locally
defined symbol - EXIT_NO_SUCH_APPLICATION_ROLE, find_application_ids,
build_mappings, output_graph - and none pulls Path or Any.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-25 18:40:07 +02:00

21 lines
564 B
Python

"""Compatibility wrapper.
This package was migrated from a flat module (make.py) to a package layout:
make/__main__.py contains the original implementation.
We re-export the public API so existing imports keep working.
"""
from __future__ import annotations
from pathlib import Path
PROJECT_ROOT: Path = Path(__file__).resolve().parents[2]
from utils.reexport import public_names # noqa: E402
from . import __main__ as _main # noqa: E402
__all__ = public_names(_main) # noqa: PLE0605
globals().update({name: getattr(_main, name) for name in __all__})