Spaces:
Running
Running
Commit
Β·
4b245e3
1
Parent(s):
e70a3b7
fix: align pre-commit hook versions with CI
Browse filesBREAKING: Pre-commit was using ancient tool versions causing divergence:
- ruff: v0.4.4 β v0.14.7 (10 minor versions behind!)
- mypy: v1.10.0 β v1.19.0 (9 minor versions behind!)
This caused CI to fail because ruff formatting behavior changed
significantly between versions. Now pre-commit and CI use same versions.
Also reformatted 2 test files that had version-specific formatting.
.pre-commit-config.yaml
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
repos:
|
| 2 |
- repo: https://github.com/astral-sh/ruff-pre-commit
|
| 3 |
-
rev: v0.
|
| 4 |
hooks:
|
| 5 |
- id: ruff
|
| 6 |
args: [--fix]
|
|
@@ -9,7 +9,7 @@ repos:
|
|
| 9 |
exclude: ^reference_repos/
|
| 10 |
|
| 11 |
- repo: https://github.com/pre-commit/mirrors-mypy
|
| 12 |
-
rev: v1.
|
| 13 |
hooks:
|
| 14 |
- id: mypy
|
| 15 |
files: ^src/
|
|
|
|
| 1 |
repos:
|
| 2 |
- repo: https://github.com/astral-sh/ruff-pre-commit
|
| 3 |
+
rev: v0.14.7
|
| 4 |
hooks:
|
| 5 |
- id: ruff
|
| 6 |
args: [--fix]
|
|
|
|
| 9 |
exclude: ^reference_repos/
|
| 10 |
|
| 11 |
- repo: https://github.com/pre-commit/mirrors-mypy
|
| 12 |
+
rev: v1.19.0
|
| 13 |
hooks:
|
| 14 |
- id: mypy
|
| 15 |
files: ^src/
|
tests/integration/test_simple_mode_synthesis.py
CHANGED
|
@@ -136,9 +136,9 @@ async def test_partial_synthesis_generation():
|
|
| 136 |
events.append(event)
|
| 137 |
|
| 138 |
complete_events = [e for e in events if e.type == "complete"]
|
| 139 |
-
assert (
|
| 140 |
-
len(complete_events)
|
| 141 |
-
)
|
| 142 |
complete_event = complete_events[0]
|
| 143 |
assert complete_event.data.get("max_reached") is True
|
| 144 |
|
|
|
|
| 136 |
events.append(event)
|
| 137 |
|
| 138 |
complete_events = [e for e in events if e.type == "complete"]
|
| 139 |
+
assert len(complete_events) == 1, (
|
| 140 |
+
f"Expected exactly one complete event, got {len(complete_events)}"
|
| 141 |
+
)
|
| 142 |
complete_event = complete_events[0]
|
| 143 |
assert complete_event.data.get("max_reached") is True
|
| 144 |
|
tests/unit/test_ui_elements.py
CHANGED
|
@@ -6,17 +6,17 @@ from src.app import create_demo
|
|
| 6 |
def test_examples_include_advanced_mode():
|
| 7 |
"""Verify that one example entry uses 'advanced' mode."""
|
| 8 |
demo, _ = create_demo()
|
| 9 |
-
assert any(
|
| 10 |
-
|
| 11 |
-
)
|
| 12 |
|
| 13 |
|
| 14 |
def test_accordion_label_updated():
|
| 15 |
"""Verify the accordion label reflects the new, concise text."""
|
| 16 |
_, accordion = create_demo()
|
| 17 |
-
assert (
|
| 18 |
-
|
| 19 |
-
)
|
| 20 |
|
| 21 |
|
| 22 |
def test_orchestrator_mode_info_text_updated():
|
|
@@ -25,9 +25,9 @@ def test_orchestrator_mode_info_text_updated():
|
|
| 25 |
# Assuming additional_inputs is a list and the Radio is the first element
|
| 26 |
orchestrator_radio = demo.additional_inputs[0]
|
| 27 |
expected_info = "β‘ Simple: Free/Any | π¬ Advanced: OpenAI (Deep Research)"
|
| 28 |
-
assert isinstance(
|
| 29 |
-
|
| 30 |
-
)
|
| 31 |
-
assert (
|
| 32 |
-
|
| 33 |
-
)
|
|
|
|
| 6 |
def test_examples_include_advanced_mode():
|
| 7 |
"""Verify that one example entry uses 'advanced' mode."""
|
| 8 |
demo, _ = create_demo()
|
| 9 |
+
assert any(example[1] == "advanced" for example in demo.examples), (
|
| 10 |
+
"Expected at least one example to be 'advanced' mode"
|
| 11 |
+
)
|
| 12 |
|
| 13 |
|
| 14 |
def test_accordion_label_updated():
|
| 15 |
"""Verify the accordion label reflects the new, concise text."""
|
| 16 |
_, accordion = create_demo()
|
| 17 |
+
assert accordion.label == "βοΈ Mode & API Key (Free tier works!)", (
|
| 18 |
+
"Accordion label not updated to 'βοΈ Mode & API Key (Free tier works!)'"
|
| 19 |
+
)
|
| 20 |
|
| 21 |
|
| 22 |
def test_orchestrator_mode_info_text_updated():
|
|
|
|
| 25 |
# Assuming additional_inputs is a list and the Radio is the first element
|
| 26 |
orchestrator_radio = demo.additional_inputs[0]
|
| 27 |
expected_info = "β‘ Simple: Free/Any | π¬ Advanced: OpenAI (Deep Research)"
|
| 28 |
+
assert isinstance(orchestrator_radio, gr.Radio), (
|
| 29 |
+
"Expected first additional input to be gr.Radio"
|
| 30 |
+
)
|
| 31 |
+
assert orchestrator_radio.info == expected_info, (
|
| 32 |
+
"Orchestrator Mode info text not updated correctly"
|
| 33 |
+
)
|