make sure we call check_auto in CI#45775
Conversation
|
Part of the problem is that the Makefile has too many targets that do the same things. I will make sure we de-dupe. WIll add more commits here |
|
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. |
b4bb3ed to
28794b1
Compare
|
[For maintainers] Suggested jobs to run (before merge) run-slow: auto |
|
run-slow: auto |
|
This comment contains models: ["models/auto"] |
Cyrilvallez
left a comment
There was a problem hiding this comment.
Thanks! make fix-repo used to do less though no?
| is_natural = model_type == module_name | ||
| # If we already recorded a natural match for this model_type, don't let a | ||
| # non-natural one overwrite it — the natural class is the canonical owner. | ||
| if model_type in natural_types and not is_natural: | ||
| continue | ||
|
|
Fix thanks for spotting. recap:
|
zucchini-nlp
left a comment
There was a problem hiding this comment.
approving for the check-auto, for the rest it'd be great to check-in with YihDar i believe. Can you also run-slow: maskformer to be sure ?
|
run-slow: maskformer |
|
This comment contains models: ["models/maskformer"] |
Cyrilvallez
left a comment
There was a problem hiding this comment.
Alright, thanks! Trusting you that the skips based on the --fix flag work! If you can confirm before merge please to be sure! 🙏🏻
| # In --fix mode, drop checkers that have no fix capability (fix_args is None) so | ||
| # they don't print bogus "(0.00s)" lines or inflate the final pass count. Print | ||
| # one transparency line listing what we're skipping. | ||
| if args.fix: | ||
| not_fixable = [n for n in names if CHECKERS[n][3] is None] | ||
| if not_fixable: | ||
| names = [n for n in names if CHECKERS[n][3] is not None] | ||
| print( | ||
| f"Skipping {len(not_fixable)} check-only checker(s) in fix mode: {', '.join(not_fixable)}\n", | ||
| flush=True, | ||
| ) |
There was a problem hiding this comment.
Trusting you that this work (not 100% sure how args are forwarded here), but could you just drop the print please? It's expected to skip them, so not warranting any print
There was a problem hiding this comment.
It's under args.fix, so keep a message here makes sense IMO.
Also it's a check utility (unlike modeling or loading code), so should not cause "a lot of warning" as we saw before.
There was a problem hiding this comment.
this will generate a single line at the top, not adding all the checks in details, see an example:
(venv) m5 ➜transformers git:(tarek-fix-check-aut) ✗ make fix-repo
Skipping 9 check-only checker(s) in fix mode: types, modeling_structure, imports, import_complexity, repo, inits, config_docstrings, config_attributes, update_metadata
✓ Ruff linting (0.09s)
$ ruff check examples tests src utils scripts .circleci/create_circleci_config.py benchmark benchmark_v2 setup.py conftest.py --fix --exclude
All checks passed!
✓ Ruff formatting (0.03s)
$ ruff format examples tests src utils scripts .circleci/create_circleci_config.py benchmark benchmark_v2 setup.py conftest.py --exclude
4293 files left unchanged
✓ Import ordering (0.04s)
$ python utils/custom_init_isort.py
✓ Sort auto mappings (0.03s)
$ python utils/sort_auto_mappings.py
✓ Generate auto mappings (4.00s)
$ python utils/check_auto.py --fix_and_overwrite
✓ Copied code consistency (5.24s)
$ python utils/check_copies.py --fix_and_overwrite
✓ Modular file conversions (2.44s)
$ python utils/check_modular_conversion.py --fix_and_overwrite
✓ Documentation table of contents (0.08s)
$ python utils/check_doc_toc.py --fix_and_overwrite
✓ Modeling rules documentation (0.05s)
$ python utils/check_modeling_rules_doc.py --rules-toml utils/rules.toml --fix_and_overwrite
✓ Docstring formatting (7.30s)
$ python utils/check_docstrings.py --fix_and_overwrite
✓ Dummy objects (0.02s)
$ python utils/check_dummies.py --fix_and_overwrite
✓ Pipeline type hints (2.59s)
$ python utils/check_pipeline_typing.py --fix_and_overwrite
✓ Doctest list (0.02s)
$ python utils/check_doctest_list.py --fix_and_overwrite
✓ Model dates (0.51s)
$ python utils/add_dates.py
✓ Dependency versions table (0.12s)
$ python setup.py deps_table_update
running deps_table_update
All 15 checks passed in 22.56s.
@tarekziade, since you already got 2 ✅ + you are the author of these new "make / checker" stuffs, I believe in you too. But if you prefer me to take a look on specific points, let me know. |
|
Last run in CI, see |
* make sure we call check_auto in CI * make sure we never drift again * improved the script so it actually displays what differs * make sure we pick the natural one first * added test coverage for check_auto * oops reverted this one by accident * keep it simple * fix-repo is only 15 checks * improved fix vs non-fix check runs
What does this PR do?
per #45774 we did not run check_auto in the CI
Commit 0e15778 ("Dynamic auto mapping" PR #45018, Apr 16 2026) is the one that created
utils/check_auto.pyin the first place. In that same commit, the Makefile was changed so that:auto_mappingsentry renamed tosort_auto_mappingsi.e., they kept running only the simple alphabetical sorter(
utils/sort_auto_mappings.py), which doesn't have the tempfile bug.auto_mappingsentry (the buggycheck_auto.pyregenerator) was added only tocheck-repoandfix-repo; both local-developer-only targets.So the buggy regenerator has never had CI coverage since it was introduced. Before PR #45018, the auto_mappings name in CI referred to the old simple sort script. It wasn't dropped from CI; it was effectively replaced under a different name when the new dynamic mechanism was bolted on.
The current PR fixes it by: