Repository navigation
MAINT Fix canonical typing - #3064
Open
Roman Lutz (romanlutz) wants to merge 5 commits into
Open
Roman Lutz (romanlutz) wants to merge 5 commits into
Roman Lutz (romanlutz) wants to merge 5 commits into
Conversation
Align test-helper import roots, correct fixture and mock contracts, and preserve decorator signatures without relaxing checker rules. Keep legacy validation and teardown behavior covered. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Observe real SQLITE_BUSY retries before expiring the shared control. Check native busy-timeout settings, cleanup under deadline and cancellation, and successful connection reuse across every analytics projection. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Inspect the request-owned driver while the writer lock is held, so the regression checks the actual setting rather than only configuration calls. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
The existing production-plus-unit typing check fails even when production typing passes. Unresolved test-helper imports account for much of the noise, but fixture annotations, mock return types, signature-erasing decorators, and several real test defects also need correction.
This restores the complete
pyrit tests\unitcheck without weakening checker rules:unit.*andend_to_end.*. Keepmake tyon its existing production-plus-unit scope with locked dependencies and all extras.Production model/scorer APIs, CI hook scope, checker severities, and directory-level overrides are unchanged. Two line-specific ty exemptions retain deliberately invalid positional construction and an intentionally unresolved annotation. Integration, partner-integration, and top-level build-script typing remediation remains separate and was not rerun.
The branch includes
mainthrough0a5abbf99b. Follow-up commitb06f89e5d3addresses a CI failure in the existing SQLite lock-deadline test: the expected timeout occurred, but total elapsed time was 1.26 seconds and failed an unrelated one-second stopwatch assertion. The replacement waits for a realSQLITE_BUSYretry before expiring the shared control, verifies native busy sleeps are disabled and the original timeout is restored, and checks successful connection reuse. It covers all five analytics projections and retains control/task cancellation coverage. Production deadlines and retry behavior are unchanged; the five-second completion wait is a test watchdog, not a production latency guarantee.No breaking runtime API change is intended.
Tests and Documentation
Initial implementation validation in this worktree used Python 3.13.13, uv 0.11.8, ty 0.0.84, and all extras. These results predate the subsequent main merges and follow-up stabilization:
uv run --frozen --no-sync ty check pyrit --output-format conciseuv run --frozen --no-sync ty check pyrit tests\unit --output-format conciseuv run --frozen --no-sync ruff check $changeduv run --frozen --no-sync ruff format --check $changeduv run --frozen --no-sync -m pytest -n 4 --dist=loadfile -q --disable-warnings $files$filescontains all changed test modulesuv run --frozen --no-sync -m pytest -n 4 --dist=loadfile tests\unit -q --disable-warningsuv run --frozen --extra all --link-mode=copy ty check pyritUV_PYTHONset to the owned Python 3.13 interpreter; no hooks bypassedThe runtime runs used Hugging Face/Transformers/datasets offline settings.
makeis unavailable on this Windows host, so the full-suite command runs the Makefile's four-worker unit-test recipe while retaining the owned all-extras environment.Initial full-suite caveat: The then-unchanged
tests\unit\setup\test_reinitialization.py::test_replacement_precedence_interpolation_empty_and_omissionmocked setting CentralMemory without installing a memory fixture. It passed in isolation without target configuration, but failed when endpoint, key, and model environment variables caused the real target initializer to construct a target. Process-local dummy configuration reproduced the same failure under both the current helper roots and the originalpythonpath=.. This was not a green full-suite result or a clean-HEAD full-suite comparison; the typing implementation left the unrelated fixture issue unchanged. Subsequent main changes include SDK test-isolation work from #3070; the historical result above is not a result for the current PR head.Follow-up stabilization validation for
b06f89e5d3, with process-localUV_PYTHONselecting this worktree's Python 3.13 interpreter:uv run --frozen --extra all --link-mode=copy -m ruff check tests\unit\memory\test_attack_analytics.py tests\unit\memory\test_attack_analytics_lock_retry.pyuv run --frozen --extra all --link-mode=copy -m ruff format --check tests\unit\memory\test_attack_analytics.py tests\unit\memory\test_attack_analytics_lock_retry.pyuv run --frozen --extra all --link-mode=copy ty check pyrituv run --frozen --extra all --link-mode=copy -m ty check pyrit tests\unituv run --frozen --extra all --link-mode=copy -m pytest -n 4 --dist=loadfile -q tests\unit\memory\test_attack_analytics.py tests\unit\memory\test_attack_analytics_lock_retry.py tests\unit\memory\test_attack_analytics_eval_identity.py tests\unit\memory\test_attack_analytics_metadata.py tests\unit\memory\test_sqlite_cancellation.pyCurrent-head GitHub CI has been triggered. A full local unit-suite rerun, live Azure SQL, and expanded typing were not run for this follow-up.
Updated the local development guide to distinguish production, canonical, and expanded typing commands and explain interpreter versus checker target versions. Added tests for typed decorator forwarding/results and optional-task cleanup; retained legacy constructor-alias, negative-input, and cancellation coverage.
JupyText was not run; no notebook or executable documentation example was changed by the typing or stabilization implementation.