Skip to content

46: narrow requires-python to >=3.11 to match tested floor - #74

Merged
wjduenow merged 2 commits into
devfrom
46-python-version-reconciliation
May 11, 2026
Merged

46: narrow requires-python to >=3.11 to match tested floor#74
wjduenow merged 2 commits into
devfrom
46-python-version-reconciliation

Conversation

@wjduenow

@wjduenow wjduenow commented May 11, 2026

Copy link
Copy Markdown
Owner

Closes #46.

Summary

  • pyproject.toml: requires-python = ">=3.10"">=3.11". Brings the advertised floor in lockstep with [tool.pyright].pythonVersion = "3.11" and .github/workflows/ci.yml's python-version: "3.11".
  • .claude/rules/python-build.md: new § "Python version: advertised floor matches the tested floor (issue scaffolding: reconcile pyright pythonVersion with requires-python #46)" — records the decision, names the three concrete divergence sources (match exhaustiveness, PEP 604 stringification, PEP 695 slip-ins), and reserves the v0.3 matrix-widening path.
  • README.md: install step now states "SignalForge requires Python 3.11+" so PyPI / GitHub readers see the support promise before they pip install.

Picked Option A from the issue (narrow the floor) over Option B (widen pyright/CI to a 3.10 matrix). Cheaper, clearer support promise, and operators needing 3.10 can pin to a 3.10-compatible patch release.

Validation

  • ruff check . — clean.
  • ruff format --check . — clean.
  • pyright — 0 errors, 0 warnings.
  • pytest under Python 3.13 — only the 6 pre-existing symlink-loop failures (CPython 3.13's Path.resolve() no longer raises RuntimeError on cycles; same failures on origin/dev head); CI on 3.11 will pass.

A side observation worth mentioning: my local miniconda Python is 3.10.10, and pip refused the editable install against the new floor (Package 'signalforge-dbt' requires a different Python: 3.10.10 not in '>=3.11'). That's the failure mode the issue called out — the prior >=3.10 floor was an aspirational claim that no CI job had ever exercised. The new floor now fails loud on the right interpreter.

Test plan

  • CI passes on dev branch checks.
  • pip install -e ".[dev]" succeeds on a Python 3.11+ interpreter.
  • pip install -e ".[dev]" rejects with a clear error on Python 3.10.

🤖 Generated with Claude Code

Summary by CodeRabbit

Release Notes

  • Documentation

    • Updated installation prerequisites to reflect Python 3.11+ requirement
    • Added guidance on Python version alignment across tooling
  • Chores

    • Updated minimum supported Python version to 3.11

Review Change Stack

pyright `pythonVersion` and CI `python-version` both pin 3.11; the
wheel's `requires-python = ">=3.10"` advertised a 3.10 support
promise that no type-check or test job exercised. Narrow the floor
to 3.11 so what we advertise matches what we test.

Picked Option A from the issue (cheaper of two paths) — operators
needing 3.10 can pin to a 3.10-compatible patch release; v0.2 can
revisit if real users report.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented May 11, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

🗂️ Base branches to auto review (3)
  • feature/.*
  • bug/.*
  • hotfix/.*

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: d780c9b5-0bdf-4636-84c9-837a3ea9acc1

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

The PR raises the project's minimum Python version requirement from 3.10 to 3.11 across build configuration, user documentation, and internal guidelines. This aligns the advertised package compatibility (requires-python) with the Python version tested in CI and type-checked by Pyright, closing a divergence where users on Python 3.10 could install but never had their path tested.

Changes

Python 3.11+ Requirement

Layer / File(s) Summary
Build Configuration
pyproject.toml
requires-python constraint changed from >=3.10 to >=3.11.
User-Facing Installation Guide
README.md
Install section now explicitly states Python 3.11+ as a prerequisite before clone and development install instructions.
Developer Build Guidelines
.claude/rules/python-build.md
New "Python version" section documents that requires-python, Pyright pythonVersion, and CI interpreter must all match at 3.11, explains the deprecation of the 3.10 floor (absence of 3.10 CI/Pyright coverage created hidden incompatibility), and provides instructions for maintaining version alignment during future CI matrix expansion. Reference section updated to cite issue #46.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~5 minutes

Poem

🐰 A version aligned at three-point-one,
No more broken dreams when tests run.
Pyright and CI now in harmony true,
The floor is set, and the path is through! ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically references issue #46 and summarizes the main change: narrowing the Python version floor to 3.11 to match the tested and type-checked floor.
Linked Issues check ✅ Passed The PR successfully implements all coding requirements from issue #46: requires-python raised to >=3.11, pyright pythonVersion aligns at 3.11, and documentation added to .claude/rules/python-build.md explaining the decision and reconciliation.
Out of Scope Changes check ✅ Passed All three file changes (pyproject.toml, .claude/rules/python-build.md, README.md) are directly scoped to issue #46's objective of reconciling the Python version floor across project metadata, tooling, and documentation.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Comment @coderabbitai help to get the list of available commands and usage tips.

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@wjduenow

Copy link
Copy Markdown
Owner Author

@CodeRabbit review

@wjduenow
wjduenow requested a review from Copilot May 11, 2026 22:02
@coderabbitai

coderabbitai Bot commented May 11, 2026

Copy link
Copy Markdown
✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Copilot AI 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.

Pull request overview

Aligns SignalForge’s advertised minimum Python version with what CI and type checking actually exercise, resolving issue #46 by moving the supported floor to Python 3.11+ and documenting the decision.

Changes:

  • Bumped requires-python from >=3.10 to >=3.11 in packaging metadata.
  • Updated the README install instructions to explicitly state Python 3.11+ is required.
  • Added a decision record in .claude/rules/python-build.md explaining the “advertised floor matches tested floor” policy.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
README.md Documents Python 3.11+ requirement in the install section.
pyproject.toml Raises the package’s advertised minimum Python version to 3.11.
.claude/rules/python-build.md Records the rationale/decision and future guidance for keeping version floors in sync.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread pyproject.toml
Comment thread pyproject.toml
…/StrEnum

Two Copilot review comments on PR #74:

- `[tool.ruff].target-version` was still `py310` and out of sync with the
  new 3.11 floor; bumping it surfaced 21 UP017 (`datetime.UTC` alias) and
  1 UP042 (`StrEnum`) modernization opportunities the previous floor was
  masking. Auto-fixed the UP017 set and switched `SamplingMode` to
  :class:`enum.StrEnum` (the 3.10-compat `str + Enum` mixin is no longer
  needed).
- Stale 3.10-floor rationale in `safety/models.py` and `safety/test_models.py`
  docstrings updated to point at the new history (issue #46).

`str(SamplingMode.X)` now returns the bare value (`"schema-only"`) rather
than the dotted form. No production code paths exercise `str()` on the
enum (Pydantic `model_dump_json` uses `.value`; loggers go through
`json.dumps`); pinned by the existing tests.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@wjduenow

Copy link
Copy Markdown
Owner Author

PR Review Summary

Fixed (2 items)

File Line Issue Commit
pyproject.toml 41 [tool.ruff].target-version was py310, stale relative to the new 3.11 floor — bumped to py311. Surfaced 22 latent UP-rule modernizations (21 datetime.UTC + 1 StrEnum) the prior floor was masking; all addressed in the same commit. 03514d1
src/signalforge/safety/models.py, tests/safety/test_models.py module + class docstrings Stale "3.10 floor" rationale on SamplingMode removed. Also switched the implementation from str + Enum to enum.StrEnum (the 3.10-compat reason no longer applies); str(SamplingMode.X) now returns the bare value but no production code paths exercise str() on the enum (Pydantic model_dump_json uses .value, loggers go through json.dumps). Pinned by existing tests. 03514d1

False Positives (0 items)

None — both comments were correct.

Validation: ruff check / ruff format --check / pyright clean; 1648 tests pass (the same 6 pre-existing symlink-loop failures on Python 3.13 that exist on dev head, unrelated to this PR).

@wjduenow
wjduenow merged commit ca22c5a into dev May 11, 2026
2 checks passed
@wjduenow
wjduenow deleted the 46-python-version-reconciliation branch May 11, 2026 23:23
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.

3 participants