[Internal] Fix ty type-checking errors after latest release#3978
Merged
hanouticelina merged 3 commits intomainfrom Mar 26, 2026
Merged
[Internal] Fix ty type-checking errors after latest release#3978hanouticelina merged 3 commits intomainfrom
ty type-checking errors after latest release#3978hanouticelina merged 3 commits intomainfrom
Conversation
|
It looks like you've updated code related to model or dataset cards in this PR. Some content is duplicated among the following files. Please make sure that everything stays consistent.
|
|
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
Wauplin
approved these changes
Mar 26, 2026
Contributor
Wauplin
left a comment
There was a problem hiding this comment.
Too bad we can't use type ignore[code] anymore but honestly pretty fine with me like this^^
Thanks for handling it!
Contributor
Author
|
failing tests are unrelated |
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.
tyv0.0.25 (released 2026-03-24) introduced a breaking change:# type: ignore[code]comments with mypy-specific codes (e.g.arg-type) are no longer treated as blanket suppressions byty. Previously,tyignored the code in brackets and suppressed all errors on the line. Now it only suppresses errors matching its own codes, so all existing# type: ignore[mypy-code]comments stopped working forty.Changes
# type: ignore[mypy-code]with bare# type: ignoreon affected lines — this is the only form both checkers respect.import importlib.utilinserialization/_torch.pyto fix a newpossibly-missing-submodulewarning.buckets,cache,repos,models,datasets,jobs,webhooks,_cli_utils)._async_client.pyviamake style.Both
uvx ty check srcandmypy srcpass.Investigation and fixes done by Claude Code (Codex failed on this)
Note
Medium Risk
Mostly mechanical typing/comment changes, but it also tweaks CLI argument types and the
hf repos settings --gatedvalue mapping, which could impact command-line parsing and repo settings updates if incorrect.Overview
Updates the codebase to be compatible with
tyv0.0.25 by replacing many mypy-specific# type: ignore[...]suppressions with bare# type: ignoreacross inference, upload, filesystem, dataclass, and provider code.Tightens CLI typing:
hf repos create/duplicatenow type--flavor/--storageasSpaceHardware/SpaceStorage(and the generated CLI docs now enumerate valid values),make_expand_properties_parseris made generic over allowed expand strings, andhf repos settingsadjusts how--gated falseis converted before callingupdate_repo_settings. Also addsimport importlib.utilto silence a new submodule warning and regenerates_async_client.py.Written by Cursor Bugbot for commit a2e0cff. This will update automatically on new commits. Configure here.