Repository navigation
Conversation
anth-volk
added this pull request to stack #755
October 13, 2026 11:40
2 tasks done
anth-volk
force-pushed
the
ruff-typing-imports
branch
from
October 13, 2026 16:56
18fae4c to
f651387
Compare
anth-volk
force-pushed
the
ruff-typing-imports
branch
2 times, most recently
from
October 14, 2026 14:23
047a2a7 to
26ef5ec
Compare
Select TC and move imports used only in annotations under TYPE_CHECKING. Pydantic evaluates model annotations and FastAPI evaluates endpoint annotations at runtime, so ruff.toml lists the runtime-evaluated model base classes (every project base, since ruff only checks direct bases) and the FastAPI/APIRouter route decorators. scripts/rules matches policyengine-api. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
anth-volk
force-pushed
the
ruff-typing-imports
branch
from
October 14, 2026 14:47
26ef5ec to
6c25653
Compare
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.
Fixes #772
Same-Repository Draft PR Check
PolicyEngine/policyengine-sim-api, not a personal fork.Summary
Phase 1 step 1.8, group 2: typing-only imports. Stacked on #765.
ruff.tomlgainsTC, and 146 fixes move annotation-only imports underTYPE_CHECKING.[lint.flake8-type-checking]lists:pydantic.BaseModel,pydantic.RootModel, and every project model base class that other models inherit from: 10 across the contract,policyengine-fastapiand executor packages.FastAPI/APIRouterroute decorators. Pydantic and FastAPI evaluate these annotations at runtime.scripts/rulesis byte-identical with policyengine-api.Testing
All seven projects' test suites pass:
ruff check .passes with 0.15.22 and 0.16.8, andsrcformatting is unchanged.🤖 Generated with Claude Code