Repository navigation
pip: declare click, which typer no longer pulls in - #7504
Merged
Merged
Conversation
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.
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
unsloth_cli/commands/start.py:25importsclickat module scope, andunsloth_cli/__init__.py:36imports that module, so everyunslothcommand needs click before it does anything. It is used for real:click.Contextinparse_argsandclick.clear()in the connection output.It was never declared. typer supplied it, until it stopped:
The declared floor is
typer>=0.12.0, so a fresh resolve today installs typer 0.27 and no click. The wheel still works becausehuggingface_hubrequiresclick<9,>=8.4.2, so click arrives transitively. That is luck, not a declaration, and it is the same shape as the structlog gap in #7493: an undeclared import that something else happened to satisfy until it did not.How it showed up
Building a wheel from a dependency list that has typer but not huggingface_hub, and installing it into a fresh venv:
Not one command, all of them, before argument parsing.
Changes
click>=8.0becomes a core dependency.tests/studio/install/test_studio_extra_matches_requirements.pynow checks click alongside structlog, so the next import that a transitive dependency happens to satisfy does not go unnoticed.Testing
Wheel built from this branch: 29 core
Requires-Distentries withclick>=8.0andstructlog>=24.1.0both present,Provides-Extra: studiointact, torch and the rest of the ML stack unchanged. Drift test 4 passed. Fresh install of the fixed wheel:unsloth --helpexits 0 with click 8.4.2.Related: #7493