Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,15 @@
"torch_213": "torchvision~=0.28.0",
}

# Extra install pins applied per transformers matrix entry (installed after the base
# ``.[all,dev-test]`` install to constrain that env).
TRANSFORMERS_VERSIONS = {
"tf_latest": "transformers~=5.14.0",
"tf_min": "transformers~=4.57.0",
"tf_latest": ("transformers~=5.14.0",),
# transformers 4.57 caps ``huggingface_hub<1.0``, but ``diffusers>=0.40`` requires
# ``huggingface_hub>=1.23``. Bound diffusers to a hub<1.0-compatible release so this env
# stays internally consistent; otherwise diffusers' pipeline import fails and diffusers
# models silently misroute to the LLM path on export.
"tf_min": ("transformers~=4.57.0", "diffusers<0.40"),
}


Expand All @@ -63,9 +69,9 @@ def _cov_args():
def unit(session, torch_ver, tf_ver):
"""Unit tests — parametrized over torch and transformers versions."""
session.install(TORCH_VERSIONS[torch_ver], "-e", ".[all,dev-test]")
tf_pin = TRANSFORMERS_VERSIONS[tf_ver]
if tf_pin:
session.install(tf_pin)
tf_pins = TRANSFORMERS_VERSIONS[tf_ver]
if tf_pins:
session.install(*tf_pins)
Comment on lines +72 to +74

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[SUGGESTION] The if tf_pins: guard is now provably dead — every value in TRANSFORMERS_VERSIONS is a non-empty tuple, and nox.parametrize on line 67 only ever passes keys of that dict, so tf_pins can't be empty. (It was equally vestigial before as a string, but this PR rewrites the line.) CONTRIBUTING's "Remove dead code" applies; dropping it makes the two-step install read as one intent.

Suggested change
tf_pins = TRANSFORMERS_VERSIONS[tf_ver]
if tf_pins:
session.install(*tf_pins)
session.install(*TRANSFORMERS_VERSIONS[tf_ver])

Non-blocking — the current form is harmless.

session.run("python", "-m", "pytest", "tests/unit", *_cov_args(), env=_CPU_ONLY_ENV)


Expand Down
Loading