Aller au contenu
login
arrow_backRetour aux issues
MakazhanAlpamys/Soup #494

The transformers floor is hardcoded in three places and derived from none, so a pin bump silently leaves CI testing an unrelated version

ecoDébutant bug help wanted good first issue

descriptionDescription

#489 added a `transformers-floor` CI job that pins `transformers==4.46.1`. The version is written down in **three** places and derived from none of them: - `.github/constraints/transformers-floor.txt:22` - the version assertion in the `transformers-floor` job (`.github/workflows/ci.yml`) - `tests/test_transformers_floor_compat.py:145` None of them reads `pyproject.toml`. ## Reproduction Change the declared pin and watch the "floor" job keep testing the old number: ``` # pyproject.toml - transformers>=4.36.0,<5.0.0 + transformers>=4.52.0,<5.0.0 ``` `tests/test_transformers_floor_compat.py` stays **green** — it only opens the constraints file and the workflow, never `pyproject.toml`. CI then goes on pinning 4.46.1 and calling it "the floor" while the project's actual floor is 4.52. That is the same class of defect the job was created to prevent: a declared bound that nothing executes. ## Partial mitigation that already exists `tests/test_v0640_part_c.py:738-823` asserts the exact requirement strings, so a pin bump does turn *something* red. But it points at a metadata test, not at the constraints file, so the drift is easy to walk past without realising the floor job is now meaningless. ## Why the value is not simply `pyproject.toml`'s floor Deliberate, and worth preserving: `transformers==4.36.0` **cannot resolve** — `trl 0.14.0` requires `transformers>=4.46.0`, and every file of `transformers 4.46.0` is yanked on PyPI, so 4.46.1 is the lowest installable version. The constraints file documents this and explicitly refuses to relabel 4.55.4 as "the floor". Any fix must keep that honest exception rather than forcing equality. ## Fix path Have `tests/test_transformers_floor_compat.py` parse `transformers>=X` out of `pyproject.toml` and assert: 1. the constraint pin is `>= X` (so it can never be *below* the declared floor), and 2. when the constraint pin is strictly greater than `X`, the constraints file still carries a comment explaining why — so the exception stays documented rather than silently drifting. This repo already has the pattern to copy: `tests/test_requires_python_bound.py` derives the Python bound from the CI matrix instead of restating it. ## Acceptance criteria - [ ] Raising the `transformers` floor in `pyproject.toml` without touching the constraints file fails a named test - [ ] Lowering the constraint pin below the declared floor fails a named test - [ ] The 4.36-is-unresolvable exception still passes, with its reason still required to be documented - [ ] Verified by actually making each mutation and running, not by inspection Small and self-contained. No GPU, no model download.
codeOuvre sur GitHub