Skip to content

PS-1717: bump pyrefly to 1.3.2 and type check against python 3.10 - #21

Merged
stephen-kintsugi merged 4 commits into
mainfrom
task/PS-1717/pyrefly-1-3-2
Oct 14, 2026
Merged

stephen-kintsugi merged 4 commits into
mainfrom
task/PS-1717/pyrefly-1-3-2

Conversation

@stephen-kintsugi

@stephen-kintsugi stephen-kintsugi commented Oct 7, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

This repo type-checked with Pyrefly 1.1.1, aimed it at Python 3.12 even though the package supports Python 3.10 and later, and used a pre-commit hook id that does not run against the project venv. It now uses Pyrefly 1.3.2, targets Python 3.10, and runs the pyrefly-typecheck-system hook like the other Python repos.

  • pyrefly dev dependency ~=1.1.1 to ~=1.3.2; poetry.lock regenerated with Poetry 2.5.1
  • [tool.pyrefly] python-version 3.12.0 to 3.10.0. This repo is a published library (python >=3.10), so Pyrefly targets the lowest supported Python to catch syntax and APIs that consumers on 3.10 cannot use. Services target their repo minor instead.
  • pre-commit hook pyrefly-check (rev 1.1.1) replaced by pyrefly-typecheck-system (rev 0.0.1, system language, always_run)
  • [tool.ruff.lint] now states select = ["E4","E7","E9","F","I","UP","B","SIM","C4"] explicitly instead of extend-select, because Ruff 0.16.0 widened its default rule set and extend-select alone differs across Ruff versions. ruff check and ruff format --check report no new findings.
  • Package version 0.3.6 to 0.3.7 in pyproject.toml and squawk_alembic/__init__.py, which CI requires on every code-changing PR. Merging to main makes the auto-tag and release jobs tag v0.3.7 and publish a GitHub Release, so consumers pinning by tag can adopt it.
  • Pyrefly 1.3.2 reports 0 errors, so no code changes or baseline. Published package support (python >=3.10, CI matrix 3.10 to 3.14) is unchanged.

Jira

PS-1717

Tests

Ran locally: pre-commit run --all-files (all hooks pass, including Pyrefly), pytest -q (49 passed), pyrefly check (0 errors). CI runs the same checks plus the 3.10 to 3.14 test matrix.

Document Checklist

N/A

🤖 Generated with Claude Code


Note

Low Risk
Tooling and version bumps only; no runtime or business-logic changes.

Overview
Upgrades Pyrefly from 1.1.1 to 1.3.2 and sets [tool.pyrefly] python-version to 3.10.0 so type checking matches the package’s minimum supported Python instead of 3.12.

Pre-commit now uses the pyrefly-typecheck-system hook (with always_run) instead of pyrefly-check, aligned with other Python repos. Ruff lint rules are pinned via an explicit select list so behavior stays stable across Ruff 0.16’s wider defaults. poetry.lock is regenerated under Poetry 2.5.1, and the package is bumped to 0.3.7 with no source changes beyond the version constant.

Reviewed by Cursor Bugbot for commit a9b7ea1. Bugbot is set up for automated code reviews on this repo. Configure here.

Aligns type checking with the org Pyrefly pin and the repo Python minor used by pre-commit. The hook id pyrefly-check is replaced by pyrefly-typecheck-system so the project venv is used.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
AI-Tool: Claude Code CLI
AI-Model: claude-sonnet-5-5
AI-Reasoning: medium
stephen-kintsugi and others added 2 commits October 8, 2026 00:26
Ruff 0.16.0 widened its default rule set, so extend-select alone enforces different rules on different Ruff versions.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
AI-Tool: Claude Code CLI
AI-Model: claude-sonnet-5-5
AI-Reasoning: medium
CI requires every code-changing PR to bump the package version in pyproject.toml and __init__.py.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
AI-Tool: Claude Code CLI
AI-Model: claude-sonnet-5-5
AI-Reasoning: medium
cursor[bot]
cursor Bot previously approved these changes Oct 8, 2026

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Risk Assessment: Very Low

Assessed from the actual diff (344a11b...6f5c4d8), not the PR description:

  • .pre-commit-config.yaml — swaps the pyrefly-check hook (rev 1.1.1, language: system) for pyrefly-typecheck-system (rev 0.0.1) with always_run: true. Dev-tooling config only; no runtime library behavior changes.
  • pyproject.toml — dev dependency bump (pyrefly ~=1.1.1 → ~=1.3.2), ruff lint set made explicit (extend-select → select, same rule families plus E4/E7/E9), pyrefly python-version 3.12.0 → 3.13.0, package version bump to 0.3.7. None of this alters shipped code paths.
  • squawk_alembic/__init__.py — version string only.
  • poetry.lock — regenerated lockfile mirroring the pyproject change.

Blast radius: dev/pre-commit tooling and release metadata; reversibility is trivial (revert one commit set); no shared-resource pressure, no schema, no core logic, no import-linter changes.

Gates checked: no production code changed (test-coverage gate N/A — tooling/config only); no importlinter.toml changes; no active approval on the latest commit; codeowner review requests (mbertrand-kintsugi, michael-kintsugi) are informational routing and do not block approval.

defaults:
  risk_level: Very Low
  review_required: false
  reviewers: []
  action_taken: approved
  rationale: >-
    Diff is confined to pre-commit hook config, dev dependency/lockfile bumps, an explicit
    ruff rule list, a pyrefly target-version change, and version-string bumps. No production
    logic, schema, security boundary, or shared-resource behavior is touched, and the change
    is trivially reversible.
Open in Web View Automation 

Sent by Cursor Automation: Assign PR reviewers & Assess Risk & Approve if Safe

@mbertrand-kintsugi mbertrand-kintsugi left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The hook rev 0.0.1 is a real tag of facebook/pyrefly-pre-commit, and at that tag pyrefly-typecheck-system uses language: system, so the hook still runs the Poetry-installed pyrefly 1.3.2. Lockfile, Ruff select list and Python 3.13 target match the diff, and CI is green.

This repo is a published hook package supporting python >=3.10, so Pyrefly targets the lowest supported version to catch syntax and APIs that 3.10 consumers cannot use.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
AI-Tool: Claude Code CLI
AI-Model: claude-sonnet-5-5
AI-Reasoning: medium
@stephen-kintsugi stephen-kintsugi changed the title PS-1717: bump pyrefly to 1.3.2 and target python 3.13 PS-1717: bump pyrefly to 1.3.2 and type check against python 3.10 Oct 8, 2026

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Risk Assessment: Very Low (re-approved after new commit)

Re-evaluated the incremental diff since the previous approval (6f5c4d8 → a9b7ea1): a single line in pyproject.toml changing the Pyrefly type-check target from python-version = "3.13.0" to "3.10.0".

Assessed from the actual diff, not the PR description:

  • pyproject.toml — one-line tooling config change; Pyrefly's python-version is a type-checker target knob only (targeting the 3.10 floor is stricter for checking, not looser). No runtime library behavior, schema, security boundary, or shared-resource impact. Trivially reversible (revert one value).
  • Full PR diff remains confined to .pre-commit-config.yaml (pre-commit hook config), pyproject.toml (dev dependency bump, explicit ruff rule list, version bump), squawk_alembic/__init__.py (version string only), and the regenerated poetry.lock.

Gates checked: no production code changed (test-coverage gate N/A — tooling/config only); no importlinter.toml changes; no active approval on the latest commit; codeowner review requests (mbertrand-kintsugi, michael-kintsugi) are informational routing and do not block approval.

defaults:
  risk_level: Very Low
  review_required: false
  reviewers: []
  action_taken: approved
  rationale: >-
    Incremental commit is a one-line Pyrefly target-version config change in pyproject.toml,
    a trivially reversible dev-tooling knob with no production logic or shared-resource impact.
    Full PR diff remains tooling/config/lockfile/version-string only.
Open in Web View Automation 

Sent by Cursor Automation: Assign PR reviewers & Assess Risk & Approve if Safe

@mbertrand-kintsugi mbertrand-kintsugi left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Pyrefly target now matches the lowest supported Python (3.10).

@stephen-kintsugi
stephen-kintsugi merged commit fc5f138 into main Oct 14, 2026
10 checks passed
@stephen-kintsugi
stephen-kintsugi deleted the task/PS-1717/pyrefly-1-3-2 branch October 14, 2026 18:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants