Skip to content

Commit 83725c1

Browse files
committed
ci: fix clean music test environment
1 parent 15962e7 commit 83725c1

3 files changed

Lines changed: 21 additions & 8 deletions

File tree

pyproject.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -442,6 +442,9 @@ test = [
442442
"transformers>=4.57.0",
443443
"torch==2.11.0",
444444
"scikit-learn>=1.4.0",
445+
"mido>=1.3.0",
446+
"music21==9.9.2; python_version == '3.10'",
447+
"music21==10.5.0; python_version >= '3.11' and python_version < '3.13'",
445448
]
446449

447450
[tool.hatch.metadata]

tests/test_muscriptor_cli.py

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ def test_transcribe_help_exposes_model_capabilities_without_custom_sources():
5757
result = runner.invoke(cli.app, ["transcribe", "--help"])
5858

5959
assert result.exit_code == 0, result.stdout
60+
help_text = unstyle(result.stdout)
6061
for option in (
6162
"--model",
6263
"--device",
@@ -70,15 +71,16 @@ def test_transcribe_help_exposes_model_capabilities_without_custom_sources():
7071
"--preview-mode",
7172
"--instruments",
7273
):
73-
assert option in result.stdout
74-
assert "--soundfont" not in result.stdout
75-
assert "PATH|URL" not in result.stdout
74+
assert option in help_text
75+
assert "--soundfont" not in help_text
76+
assert "PATH|URL" not in help_text
7677

7778

7879
def test_batch_help_has_complete_batch_surface():
7980
result = runner.invoke(cli.app, ["batch", "--help"])
8081

8182
assert result.exit_code == 0, result.stdout
83+
help_text = unstyle(result.stdout)
8284
for option in (
8385
"--output-dir",
8486
"--format",
@@ -90,11 +92,11 @@ def test_batch_help_has_complete_batch_surface():
9092
"--fail-fast",
9193
"--notes",
9294
):
93-
assert option in result.stdout
94-
assert "--soundfont" not in result.stdout
95-
assert "--overwrite" not in result.stdout
96-
assert "5-second audio" in result.stdout
97-
assert "chunks per" in result.stdout
95+
assert option in help_text
96+
assert "--soundfont" not in help_text
97+
assert "--overwrite" not in help_text
98+
assert "5-second audio" in help_text
99+
assert "chunks per" in help_text
98100

99101

100102
def _install_single_backend(monkeypatch, calls: list[str]) -> None:

tests/test_muscriptor_dependencies.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,14 @@ def test_muscriptor_extra_is_pinned_and_uses_shared_torch_profile():
3434
assert all(not item.startswith(("mido", "music21")) for item in extras["musvit-onnx"])
3535

3636

37+
def test_ci_test_group_includes_music_export_runtime():
38+
project = _project()
39+
music_export = set(project["project"]["optional-dependencies"]["music-export"])
40+
test_dependencies = set(project["dependency-groups"]["test"])
41+
42+
assert music_export <= test_dependencies
43+
44+
3745
def test_muscriptor_extra_conflicts_with_native_paddle_stack():
3846
conflicts = _project()["tool"]["uv"]["conflicts"]
3947
conflicting_extras = [

0 commit comments

Comments
 (0)