VibecoderMcSwaggins commited on
Commit
4b245e3
Β·
1 Parent(s): e70a3b7

fix: align pre-commit hook versions with CI

Browse files

BREAKING: 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.4
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.10.0
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) == 1
141
- ), f"Expected exactly one complete event, got {len(complete_events)}"
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
- example[1] == "advanced" for example in demo.examples
11
- ), "Expected at least one example to be 'advanced' mode"
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
- accordion.label == "βš™οΈ Mode & API Key (Free tier works!)"
19
- ), "Accordion label not updated to 'βš™οΈ Mode & API Key (Free tier works!)'"
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
- orchestrator_radio, gr.Radio
30
- ), "Expected first additional input to be gr.Radio"
31
- assert (
32
- orchestrator_radio.info == expected_info
33
- ), "Orchestrator Mode info text not updated correctly"
 
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
+ )