Skip to content

Commit bcf38c4

Browse files
authored
Merge branch 'main' into dependabot/uv/torchvision-0.27.0
2 parents 033e15c + 2e9f57f commit bcf38c4

4 files changed

Lines changed: 55 additions & 62 deletions

File tree

.github/scripts/update_constraint_deps.py

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -167,25 +167,29 @@ def main() -> int:
167167
# 2. Try updating >= floors in regular dependency arrays
168168
if dep_indices:
169169
any_changed = False
170-
skip_reasons = []
170+
has_floor = False
171171
for idx in dep_indices:
172172
new_line, changed, reason = update_constraint(lines[idx], args.dependency_name, args.dependency_version)
173173
if changed:
174174
lines[idx] = new_line
175175
any_changed = True
176+
has_floor = True
176177
print(f"UPDATED (dependencies): {reason}")
177-
else:
178-
skip_reasons.append(reason)
178+
elif "no >= lower bound" not in reason:
179+
has_floor = True
180+
print(f"SKIP (dependencies): {reason}")
179181
if any_changed:
180182
pyproject_path.write_text("".join(lines))
181183
print("updated=true")
182-
else:
183-
for r in skip_reasons:
184-
print(f"SKIP (dependencies): {r}")
184+
return 0
185+
if has_floor:
185186
print("updated=false")
186-
return 0
187+
return 0
188+
# Found in dependencies but no >= floor anywhere — fall through to
189+
# add to constraint-dependencies so the version floor is tracked somewhere
187190

188-
# 3. Not found anywhere — add to constraint-dependencies
191+
# 3. Not found in constraint-dependencies, and either not in regular deps
192+
# or present without a >= floor — add to constraint-dependencies
189193
lines, changed, reason = insert_constraint(lines, args.dependency_name, args.dependency_version)
190194
if not changed:
191195
print(f"SKIP: {reason}")

.github/workflows/commit-constraint-updates.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ jobs:
187187
repository: ${{ steps.pr-info.outputs.head_repo }}
188188
ref: ${{ steps.pr-info.outputs.head_ref }}
189189
fetch-depth: 0
190-
token: ${{ github.token }}
190+
token: ${{ secrets.RELEASE_PAT }}
191191

192192
- name: Restore artifacts after checkout
193193
if: steps.download-update.outputs.skip != 'true' && steps.changes.outputs.skip != 'true' && steps.pr-info.outputs.skip != 'true' && steps.pr-info.outputs.is_fork_pr != 'true'
@@ -222,7 +222,7 @@ jobs:
222222
id: commit
223223
if: steps.download-update.outputs.skip != 'true' && steps.changes.outputs.skip != 'true' && steps.pr-info.outputs.skip != 'true'
224224
env:
225-
GH_TOKEN: ${{ steps.pr-info.outputs.is_fork_pr == 'true' && secrets.RELEASE_PAT || github.token }}
225+
GH_TOKEN: ${{ secrets.RELEASE_PAT }}
226226
PR_NUMBER: ${{ steps.pr-info.outputs.pr_number }}
227227
HEAD_REPO: ${{ steps.pr-info.outputs.head_repo }}
228228
HEAD_REF: ${{ steps.pr-info.outputs.head_ref }}
@@ -260,7 +260,8 @@ jobs:
260260
fi
261261
else
262262
echo "Pushing to same-repo PR branch: $HEAD_REF"
263-
git push origin "HEAD:${HEAD_REF}"
263+
git push "https://x-access-token:${GH_TOKEN}@github.com/${BASE_REPO}.git" \
264+
"HEAD:${HEAD_REF}"
264265
echo "Successfully pushed constraint updates"
265266
echo "pushed=true" >> "$GITHUB_OUTPUT"
266267
fi

pyproject.toml

Lines changed: 7 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -341,22 +341,6 @@ convention = "google"
341341
"benchmarking/**/*.py" = ["D101", "S104", "S110", "S311"] # Ignore docstring and security rules for benchmarking scripts
342342
"client-sdks/**/*.py" = ["D101", "S110", "S112", "S113"] # Ignore docstring and security rules for client SDKs
343343
"scripts/**/*.py" = ["D101", "S110", "S112", "S603", "S607"] # Ignore docstring and security rules for scripts
344-
"src/ogx/providers/inline/scoring/basic/utils/ifeval_support.py" = [
345-
"RUF001",
346-
]
347-
"src/ogx/providers/inline/scoring/basic/utils/ifeval_checkers_core.py" = [
348-
"RUF001",
349-
]
350-
"src/ogx/providers/inline/scoring/basic/utils/ifeval_checkers_format.py" = [
351-
"RUF001",
352-
]
353-
"src/ogx/providers/inline/scoring/basic/utils/ifeval_word_list.py" = [
354-
"RUF001",
355-
]
356-
"src/ogx/providers/inline/scoring/basic/scoring_fn/fn_defs/regex_parser_multiple_choice_answer.py" = [
357-
"RUF001",
358-
"PLE2515",
359-
]
360344
"src/ogx/apis/**/__init__.py" = [
361345
"F403",
362346
] # Using import * is acceptable (or at least tolerated) in an __init__.py of a package API
@@ -396,30 +380,26 @@ exclude = [
396380
# All files now have type annotations! 🎉
397381
#
398382
# ============================================================================
399-
# Section 2: Files that need strict typing issues fixed (109 files)
383+
# Section 2: Files that need strict typing issues fixed (91 files)
400384
# ============================================================================
401385
# These files have some type hints but fail strict type checking due to
402386
# incomplete annotations, Any usage, or other strict mode violations.
403387
#
404-
# Core files (4 files)
405-
"^src/ogx/core/server/quota\\.py$",
388+
# Core files (3 files)
406389
"^src/ogx/core/server/routes\\.py$",
407390
"^src/ogx/core/server/server\\.py$",
408391
"^src/ogx/core/store/registry\\.py$",
409-
# CLI files (8 files)
392+
# CLI files (7 files)
410393
"^src/ogx/cli/stack/_list_deps\\.py$",
411394
"^src/ogx/cli/stack/list_apis\\.py$",
412395
"^src/ogx/cli/stack/list_deps\\.py$",
413396
"^src/ogx/cli/stack/list_providers\\.py$",
414397
"^src/ogx/cli/stack/run\\.py$",
415398
"^src/ogx/cli/stack/utils\\.py$",
416399
"^src/ogx/cli/subcommand\\.py$",
417-
"^src/ogx/cli/utils\\.py$",
418-
# Providers - Inline (27 files)
400+
# Providers - Inline (22 files)
419401
"^src/ogx/providers/inline/batches/reference/__init__\\.py$",
420402
"^src/ogx/providers/inline/batches/reference/batches\\.py$",
421-
"^src/ogx/providers/inline/eval/builtin/__init__\\.py$",
422-
"^src/ogx/providers/inline/eval/builtin/eval\\.py$",
423403
"^src/ogx/providers/inline/file_processor/pypdf/__init__\\.py$",
424404
"^src/ogx/providers/inline/file_processor/pypdf/adapter\\.py$",
425405
"^src/ogx/providers/inline/file_processor/pypdf/pypdf\\.py$",
@@ -440,10 +420,7 @@ exclude = [
440420
"^src/ogx/providers/inline/vector_io/qdrant/__init__\\.py$",
441421
"^src/ogx/providers/inline/vector_io/sqlite_vec/__init__\\.py$",
442422
"^src/ogx/providers/inline/vector_io/sqlite_vec/sqlite_vec\\.py$",
443-
# Providers - Remote (43 files)
444-
"^src/ogx/providers/remote/eval/nvidia/__init__\\.py$",
445-
"^src/ogx/providers/remote/eval/nvidia/config\\.py$",
446-
"^src/ogx/providers/remote/eval/nvidia/eval\\.py$",
423+
# Providers - Remote (40 files)
447424
"^src/ogx/providers/remote/files/openai/__init__\\.py$",
448425
"^src/ogx/providers/remote/files/s3/__init__\\.py$",
449426
"^src/ogx/providers/remote/inference/anthropic/__init__\\.py$",
@@ -484,30 +461,19 @@ exclude = [
484461
"^src/ogx/providers/remote/vector_io/infinispan/infinispan\\.py$",
485462
"^src/ogx/providers/remote/vector_io/oci/__init__\\.py$",
486463
"^src/ogx/providers/remote/vector_io/oci/oci26ai\\.py$",
487-
# Providers - Utils (26 files)
464+
# Providers - Utils (15 files)
488465
"^src/ogx/providers/utils/bedrock/client\\.py$",
489466
"^src/ogx/providers/utils/bedrock/config\\.py$",
490467
"^src/ogx/providers/utils/bedrock/refreshable_boto_session\\.py$",
491-
"^src/ogx/providers/utils/common/data_schema_validator\\.py$",
492468
"^src/ogx/providers/utils/common/data_url\\.py$",
493-
"^src/ogx/providers/utils/datasetio/url_utils\\.py$",
494469
"^src/ogx/providers/utils/inference/embedding_mixin\\.py$",
495470
"^src/ogx/providers/utils/inference/inference_store\\.py$",
496471
"^src/ogx/providers/utils/inference/model_registry\\.py$",
497472
"^src/ogx/providers/utils/inference/openai_compat\\.py$",
498473
"^src/ogx/providers/utils/inference/openai_mixin\\.py$",
499474
"^src/ogx/providers/utils/inference/prompt_adapter\\.py$",
500-
"^src/ogx/providers/utils/kvstore/kvstore\\.py$",
501-
"^src/ogx/providers/utils/kvstore/postgres/postgres\\.py$",
502-
"^src/ogx/providers/utils/kvstore/redis/redis\\.py$",
503475
"^src/ogx/providers/utils/memory/vector_store\\.py$",
504476
"^src/ogx/providers/utils/responses/responses_store\\.py$",
505-
"^src/ogx/providers/utils/scheduler\\.py$",
506-
"^src/ogx/providers/utils/scoring/aggregation_utils\\.py$",
507-
"^src/ogx/providers/utils/scoring/base_scoring_fn\\.py$",
508-
"^src/ogx/providers/utils/telemetry/dataset_mixin\\.py$",
509-
"^src/ogx/providers/utils/telemetry/trace_protocol\\.py$",
510-
"^src/ogx/providers/utils/telemetry/tracing\\.py$",
511477
"^src/ogx/providers/utils/tools/mcp\\.py$",
512478
"^src/ogx/providers/utils/tools/ttl_dict\\.py$",
513479
"^src/ogx/providers/utils/vector_io/vector_utils\\.py$",
@@ -519,7 +485,7 @@ exclude = [
519485
"^src/ogx/testing/api_recorder\\.py$",
520486
#
521487
# ============================================================================
522-
# Directory Excludes (35 directories)
488+
# Directory Excludes (19 directories)
523489
# ============================================================================
524490
# These are entire directories excluded from type checking. Files within
525491
# these directories need to be analyzed individually and moved to Section 1
@@ -528,23 +494,13 @@ exclude = [
528494
# Core directories
529495
"^src/ogx/core/routers/",
530496
"^src/ogx/core/routing_tables/",
531-
# Provider directories - Inline
532-
"^src/ogx/providers/inline/datasetio/localfs/",
533-
"^src/ogx/providers/inline/scoring/basic/",
534-
"^src/ogx/providers/inline/scoring/braintrust/",
535-
"^src/ogx/providers/inline/scoring/llm_as_judge/",
536497
# Provider directories - Remote
537-
"^src/ogx/providers/remote/agents/sample/",
538-
"^src/ogx/providers/remote/datasetio/huggingface/",
539-
"^src/ogx/providers/remote/datasetio/nvidia/",
540498
"^src/ogx/providers/remote/inference/bedrock/",
541499
"^src/ogx/providers/remote/inference/nvidia/",
542500
"^src/ogx/providers/remote/inference/oci/",
543501
"^src/ogx/providers/remote/inference/passthrough/",
544502
"^src/ogx/providers/remote/inference/runpod/",
545-
546503
"^src/ogx/providers/remote/inference/watsonx/",
547-
"^src/ogx/providers/remote/post_training/nvidia/",
548504
"^src/ogx/providers/remote/tool_runtime/bing_search/",
549505
"^src/ogx/providers/remote/tool_runtime/brave_search/",
550506
"^src/ogx/providers/remote/tool_runtime/model_context_protocol/",

tests/unit/test_update_constraint_deps.py

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,10 @@
5454
]
5555
5656
[dependency-groups]
57+
dev = [
58+
"ruff",
59+
"black",
60+
]
5761
test = [
5862
"google-genai>=1.69.0",
5963
]
@@ -455,6 +459,34 @@ def test_bare_dep_falls_through_to_constraint(self, tmp_path):
455459
assert "aiohttp>=3.14.0" in content
456460
assert "CVE-2026-34514" in content
457461

462+
def test_bare_dep_no_constraint_adds_to_constraints(self, tmp_path):
463+
"""A dep without a >= floor in dependencies and not in constraint-dependencies
464+
gets added to constraint-dependencies."""
465+
pyproject = tmp_path / "pyproject.toml"
466+
pyproject.write_text(SAMPLE_PYPROJECT)
467+
468+
result = subprocess.run(
469+
[
470+
"python3",
471+
str(_script_path),
472+
"--dependency-name",
473+
"ruff",
474+
"--dependency-version",
475+
"0.12.0",
476+
"--pyproject",
477+
str(pyproject),
478+
],
479+
capture_output=True,
480+
text=True,
481+
)
482+
assert result.returncode == 0
483+
assert "updated=true" in result.stdout
484+
assert "ADDED" in result.stdout
485+
content = pyproject.read_text()
486+
assert '"ruff>=0.12.0"' in content
487+
# Original bare "ruff" in dev deps should be untouched
488+
assert ' "ruff",\n' in content
489+
458490
def test_missing_pyproject_returns_error(self, tmp_path):
459491
result = subprocess.run(
460492
[

0 commit comments

Comments
 (0)