pip: restore the rich, audio and flash-attn dependencies main declares

This commit is contained in:
Daniel Han 2026-07-29 02:43:18 +00:00
commit e14e2d89bf
3 changed files with 80 additions and 2 deletions

View file

@ -45,15 +45,22 @@ def _stub_torch(monkeypatch, version: str):
def test_torch210_extras_bundle_audio_torch210():
"""The ROCm extras pin torch from the AMD wheel index, which PyPI rejects as a
direct reference, so this branch does not carry them. Check whichever torch 2.10
extras it does define, and require at least one."""
text = PYPROJECT.read_text(encoding = "utf-8")
checked = 0
for extra in (
"cu128-torch2100",
"cu126-ampere-torch2100",
"rocm72-torch2100",
):
match = re.search(rf"^{extra} = \[(.*?)^\]", text, re.MULTILINE | re.DOTALL)
assert match is not None, extra
assert "unsloth[audio-torch210]" in match.group(1)
if match is None:
continue
assert "unsloth[audio-torch210]" in match.group(1), extra
checked += 1
assert checked, "no torch 2.10 extra found to check"
def test_torchcodec_matrix_matches_notebook_validator():