pip: declare click, which typer no longer pulls in (#7504)

unsloth_cli/commands/start.py imports click at module scope, and
unsloth_cli/__init__.py imports that module, so every unsloth command needs
it. typer carried click through 0.19 and dropped it in 0.27, and the declared
floor is typer>=0.12.0, so a fresh resolve gets none. The wheel still works
today only because huggingface_hub requires click<9,>=8.4.2, which is luck
rather than a declaration.

Verified on a wheel built from a dependency list without that transitive
provider: every command, including `unsloth --help`, died with
ModuleNotFoundError for click. Same class as the structlog gap in #7493, so
the drift test covers both now.
This commit is contained in:
Daniel Han 2026-07-27 06:50:10 -07:00 committed by GitHub
commit 2bea7862ef
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 7 additions and 2 deletions

View file

@ -17,8 +17,9 @@ REPO_ROOT = pathlib.Path(__file__).resolve().parents[3]
PYPROJECT = REPO_ROOT / "pyproject.toml"
STUDIO_TXT = REPO_ROOT / "studio" / "backend" / "requirements" / "studio.txt"
# Imported at module scope by the studio.backend chain every CLI command walks.
CORE_RUNTIME_PACKAGES = ("structlog",)
# Imported at module scope by the chain every CLI command walks: structlog via
# studio.backend, click via unsloth_cli/commands/start.py.
CORE_RUNTIME_PACKAGES = ("structlog", "click")
def _load_pyproject() -> dict: