build: replace mypy with Pyrefly for type checking#57
Conversation
Swap the type checker to Pyrefly, matching the setup in Utiligize/assetlife-api. Pyrefly now checks tests/ as well as src/, so two test-only type errors are fixed and one SDK-version-conditional construction gets an ignore comment. mypy's disallow_untyped_defs has no Pyrefly equivalent, so annotation enforcement moves to Ruff's ANN rules (ANN401 ignored for the deliberate Any in the hydration and logging helpers; tests exempt). Co-Authored-By: Claude <noreply@anthropic.com>
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (7)
💤 Files with no reviewable changes (1)
📝 WalkthroughWalkthroughThe project replaces MyPy with Pyrefly for static type checking, updates Ruff and lint workflow configuration, narrows typing guidance to ChangesPyrefly migration
Estimated code review effort: 2 (Simple) | ~10 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
|



Description of PR
Swap the static type checker from mypy to Pyrefly, matching the setup already used in
Utiligize/assetlife-api.pyproject.toml:[tool.mypy]and theonepassword.*ignore_missing_importsoverride are replaced by[tool.pyrefly](project-includes = ["src", "tests"],python-platform = "linux",python-version = "3.12") plus[tool.pyrefly.errors]promotingredundant-cast,redundant-conditionandunused-coroutineto errors. The import override is no longer needed: the 1Password SDK ships type information that Pyrefly resolves..justfile:lintandlint-cinow runuv run pyrefly check --min-severity warnfrom the repo root.mypy>=1.18→pyrefly>=1,<2.disallow_untyped_defshas no Pyrefly equivalent, so annotation enforcement moves to Ruff'sANNrules.ANN401is ignored (the deliberateAnyin the hydration and logging helpers) andtests/is exempt.tests/as well assrc/, which surfaced three issues:OP_TOKENis read with a""default so it isstrrather thanstr | None, themock_vaultkwargs dict is annotateddict[str, Any], and the SDK-version-conditionalVaultOverview(**kwargs)call carries a# pyrefly: ignore[missing-argument]..gitignoremypy cache entries removed;AGENTS.mdtype-hint guidance updated; CHANGELOG entry added.Link to the Jira ticket
No ticket — tooling chore, aligning this repo's type checker with
Utiligize/assetlife-api.How to verify that it worked
No runtime code in
src/configatorchanged, so package behaviour is unaffected.Are the changes in this PR covered by tests run by the CI workflow? - If no, then describe how it was tested below the checkboxes.
🤖 Generated with Claude Code
Summary by CodeRabbit
Changed
Bug Fixes