Skip to content

Commit 4265fa7

Browse files
Pigbibiclaudecursoragent
authored
ci(deps): use QPK pin script and enforce uv lock check (#212)
* ci(deps): use QPK pin script and enforce uv lock check Call canonical check_qpk_pin_consistency from checked-out QPK and fail CI when uv.lock drifts from pyproject/override pins. Co-Authored-By: Claude <noreply@anthropic.com> Co-authored-by: Cursor <cursoragent@cursor.com> * test(ci): assert canonical QPK pin script path in workflow Co-Authored-By: Claude <noreply@anthropic.com> Co-authored-by: Cursor <cursoragent@cursor.com> --------- Co-authored-by: Claude <noreply@anthropic.com> Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 550364f commit 4265fa7

3 files changed

Lines changed: 14 additions & 5 deletions

File tree

.github/workflows/ci.yml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,11 +91,18 @@ jobs:
9191
set -euo pipefail
9292
uv run --no-sync ruff check --exclude external .
9393
94+
- name: Check QPK pin consistency
95+
run: |
96+
set -euo pipefail
97+
uv run --no-sync python external/QuantPlatformKit/scripts/check_qpk_pin_consistency.py \
98+
--root . \
99+
--pin-file external/QuantPlatformKit/QPK_PIN
100+
101+
- name: Ensure uv.lock matches pyproject.toml
102+
run: uv lock --check
103+
94104
- name: Run tests
95105
run: uv run --no-sync python -m pytest -q
96106

97-
- name: Check QPK pin consistency
98-
run: uv run --no-sync python scripts/check_qpk_pin_consistency.py
99-
100107
- name: Build package
101108
run: uv run --no-sync python -m build

tests/test_dependency_pin_guard.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,5 +61,6 @@ def test_dependency_pin_guard_is_blocking_in_ci() -> None:
6161
next_step = workflow.find("\n - name:", step_start + 1)
6262
step = workflow[step_start : next_step if next_step != -1 else len(workflow)]
6363

64-
assert "uv run --no-sync python scripts/check_qpk_pin_consistency.py" in step
64+
assert "external/QuantPlatformKit/scripts/check_qpk_pin_consistency.py" in step
65+
assert "--pin-file external/QuantPlatformKit/QPK_PIN" in step
6566
assert "continue-on-error" not in step

tests/test_uv_dependency_workflow.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ def test_ci_docker_and_env_sync_use_uv_lock() -> None:
2121
assert "uv sync --frozen --extra test" in ci
2222
assert "uv pip check" in ci
2323
assert "uv run --no-sync ruff check --exclude external ." in ci
24-
assert "uv run --no-sync python scripts/check_qpk_pin_consistency.py" in ci
24+
assert "external/QuantPlatformKit/scripts/check_qpk_pin_consistency.py" in ci
25+
assert "uv lock --check" in ci
2526
assert "uv run --no-sync python -m build" in ci
2627
assert "uv sync --frozen --no-dev" in env_sync
2728
assert "uv run --no-sync python scripts/build_cloud_run_env_sync_plan.py --json" in env_sync

0 commit comments

Comments
 (0)