chopratejas commited on
Commit
f8221a6
·
1 Parent(s): 0cca386

fix: resolve CI failures

Browse files

- Format feature_extractor.py to pass ruff format check
- Skip uvicorn tests when uvicorn not installed in CI environment
- Exclude experiments/ from pre-commit ruff checks

.pre-commit-config.yaml CHANGED
@@ -4,4 +4,6 @@ repos:
4
  hooks:
5
  - id: ruff
6
  args: [--fix]
 
7
  - id: ruff-format
 
 
4
  hooks:
5
  - id: ruff
6
  args: [--fix]
7
+ exclude: ^experiments/
8
  - id: ruff-format
9
+ exclude: ^experiments/
headroom/prediction/feature_extractor.py CHANGED
@@ -1155,7 +1155,9 @@ class StructuralExtractor(BaseFeatureExtractor):
1155
  delimiters = self.DELIMITER.findall(text)
1156
  features.delimiter_types = list({d[0] for d in delimiters if d})
1157
  features.has_structured_template = (
1158
- features.xml_tag_count > 2 or bool(features.delimiter_types) or features.json_object_count > 0
 
 
1159
  )
1160
 
1161
  # Conversation structure
 
1155
  delimiters = self.DELIMITER.findall(text)
1156
  features.delimiter_types = list({d[0] for d in delimiters if d})
1157
  features.has_structured_template = (
1158
+ features.xml_tag_count > 2
1159
+ or bool(features.delimiter_types)
1160
+ or features.json_object_count > 0
1161
  )
1162
 
1163
  # Conversation structure
tests/test_proxy_scalability.py CHANGED
@@ -224,8 +224,7 @@ class TestWorkerConfiguration:
224
 
225
  def test_uvicorn_workers_parameter(self):
226
  """Test that uvicorn accepts workers parameter."""
227
- # uvicorn.run accepts workers=N for multi-process
228
- import uvicorn
229
 
230
  # Verify the Config class accepts workers
231
  config = uvicorn.Config(
@@ -238,7 +237,7 @@ class TestWorkerConfiguration:
238
 
239
  def test_single_worker_default(self):
240
  """Test that default is single worker (None)."""
241
- import uvicorn
242
 
243
  config = uvicorn.Config(app="app:app")
244
  # Default should be None (single process)
 
224
 
225
  def test_uvicorn_workers_parameter(self):
226
  """Test that uvicorn accepts workers parameter."""
227
+ uvicorn = pytest.importorskip("uvicorn")
 
228
 
229
  # Verify the Config class accepts workers
230
  config = uvicorn.Config(
 
237
 
238
  def test_single_worker_default(self):
239
  """Test that default is single worker (None)."""
240
+ uvicorn = pytest.importorskip("uvicorn")
241
 
242
  config = uvicorn.Config(app="app:app")
243
  # Default should be None (single process)