Skip to content

feat!: require Python 3.10 or later - #69

Merged
arbianst merged 1 commit into
mainfrom
feat/python-3-10
Nov 3, 2026
Merged

arbianst merged 1 commit into
mainfrom
feat/python-3-10

Conversation

@arbianst

@arbianst arbianst commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

Require Python 3.10 or later

Python 3.9 reached end of life in October 2025. Over the last 30 days it accounted for 10 of roughly 22,000 downloads of sentdm, so this changes nothing for almost every user, and it removes the last reason the lockfile carried a second resolution for an old interpreter.

Breaking change: sentdm now declares requires-python = ">= 3.10". Installing on Python 3.9 fails at resolution time instead of at import time.

Changes

  • pyproject.toml: requires-python = ">= 3.10", the 3.9 classifier removed, pyright's pythonVersion at 3.10.
  • .python-version and .devcontainer/Dockerfile default to 3.10.
  • README states the supported range in both places it is mentioned.
  • scripts/test runs its minimum lane on >=3.10.0.
  • uv.lock and requirements-dev.lock re-resolved: the Python 3.9 lane is gone, so aiohttp (the optional sentdm[aiohttp] extra) resolves to 3.14.5, anyio to 4.16.0, multidict to 7.x and pytest to 9.2.0 on every supported version. pytest-asyncio moves to 1.4.1, which no longer imports the event-loop policy that Python 3.14 deprecates, so pytest no longer has to be held below 9.1.

Verification

uv sync --all-extras --locked and ./scripts/lint (pyright, mypy, import check) pass. ./scripts/test passes on every lane it runs: Python 3.10 with Pydantic v2 (472 passed) and Pydantic v1 (459 passed), and Python 3.14 with Pydantic v2 (472 passed).

feat!, so release-please will propose 0.50.0 with this as the headline changelog entry.

🤖 Generated with Claude Code

Python 3.9 reached end of life in October 2025 and is no longer
supported; install the SDK on Python 3.10 or later. The supported
range, the classifiers, the dev container, the README and the test
script move together, and the lockfile no longer carries a separate
resolution for 3.9, so the development dependencies resolve to their
current releases on every supported version. pytest-asyncio moves to
1.4.1 and pytest to 9.2.0.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Comment thread scripts/test
# Note that we need to specify the patch version here so that uv
# won't use unstable (alpha, beta, rc) releases for the tests
PY_VERSION_MIN=">=3.9.0"
PY_VERSION_MIN=">=3.10.0"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔴 Maintainers get a minimum-Python bump that the next generated commit will revert or conflict on, which can block every SDK's release. This hand-written commit edits generator-owned scripts/ and generator-written lines. CLAUDE.md: "Generator-owned, so don't edit them here: ... scripts/" and "Fix generator-owned behaviour at the source." Fix: raise the minimum Python version in the SDK configuration and land it through a generated commit, which covers the 5 sites listed. Same pattern at 5 sites (scripts/test:13, pyproject.toml:20, README.md:6, .devcontainer/Dockerfile:1, .python-version:1).

Why this was flagged

Commit 6aaec21 has no Stainless-Generated-From trailer, so it is a hand-written commit. It changes PY_VERSION_MIN=">=3.10.0" in scripts/test:13, a file CLAUDE.md lists as generator-owned. It also changes generator-written lines: requires-python, the 3.9 classifier and pyright pythonVersion in pyproject.toml, the "Python 3.10+" lines in README.md, the devcontainer VARIANT and .python-version. The pipeline still targets 3.9 at its source. On the next regeneration it either rewrites these lines back to 3.9 and silently restores 3.9 support, or the carried patch conflicts. CLAUDE.md says such a conflict "blocks every SDK's release, not only this one". REVIEW.md asks for both hand edits to generator lines and changes to generator-owned files outside a generated commit to be reported as Important.

Verification: Trigger: the next generated commit from the SDK pipeline, as long as the SDK configuration still targets 3.9. HEAD commit 6aaec21 has no Stainless-Generated-From trailer. It changes scripts/test:13 from PY_VERSION_MIN=">=3.9.0" to PY_VERSION_MIN=">=3.10.0". CLAUDE.md:19-22 says: "The next generated commit rewrites them, and an edit conflicts."

Comment thread .python-version
@@ -1 +1 @@
3.9.18
3.10

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔴 After this merge, CI no longer runs the client.copy() memory-leak regression test on any Python version. Before, the 3.9 lane ran it. Both test_copy_build_request tests are skipped when sys.version_info >= (3, 10) (tests/test_client.py:248, :1151). The 3.10 and 3.14 lanes both match that condition. Fix: keep the test running on at least one supported lane. For example, narrow both skipif conditions to >= (3, 12), which is where the skip reason says the leak starts. Or, if 3.10 also leaks, say in the PR that this coverage is being dropped. [also at: scripts/test:13 - After merging, no test lane runs the memory-leak regression tests for client.copy(), on either the sync or async client.]

Why this was flagged

On the base branch, CI runs ./scripts/bootstrap, and uv python install installs .python-version (3.9.18). The min lane in scripts/test (UV_PYTHON=">=3.9.0") then runs on 3.9, where test_copy_build_request (sync at tests/test_client.py:248, async at :1151) runs. That test traces allocations from client.copy() and _build_request with tracemalloc. Its decorator is @ pytest.mark.skipif(sys.version_info >= (3, 10), reason="fails because of a memory leak that started from 3.12"). This PR sets .python-version to 3.10, PY_VERSION_MIN to >=3.10.0 and requires-python to >= 3.10. Both remaining lanes, 3.10 and 3.14, therefore satisfy the skip condition. No CI run will catch a per-copy memory leak in the Sent or AsyncSent clients after this merge. The PR's reported 472 passed is consistent with both tests being skipped. Nothing else in tests/ covers a leak in copy().

Verification: tests/test_client.py:248 (sync) and :1151 (async) both skip when sys.version_info >= (3, 10). On the base, .python-version was 3.9.18 and PY_VERSION_MIN=">=3.9.0", so the min lane ran these tests on 3.9. This diff changes .python-version to 3.10 and PY_VERSION_MIN to ">=3.10.0", so both tests are always skipped.

Comment thread pyproject.toml
]

requires-python = ">= 3.9"
requires-python = ">= 3.10"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔴 Customers would see an unscoped changelog entry, and the commit subject forces a major version bump instead of leaving that to a maintainer. The subject is feat!: require Python 3.10 or later. CLAUDE.md requires a scope ("Conventional Commits with a scope ... feat(api):, fix(client):, chore(repo):"). It also says "A major version is a maintainer's call. Describe the compatibility impact in the PR instead of deciding it in the commit type." Fix: reword to a scoped subject without !, for example feat(client): require Python 3.10 or later. Describe the 3.9 impact in the PR body so a maintainer can decide the bump.

Why this was flagged

The only commit, 6aaec21, uses the subject feat!: require Python 3.10 or later. It has no scope, and its ! marks a breaking change. release-please reads that marker to choose the release type. The PR description says it will propose 0.50.0 with this as the headline entry, so the bump is decided by the commit type rather than by a maintainer. On the base branch, no commit in history forces a breaking bump this way. Both rules are in CLAUDE.md under "Breaking changes" and "Commits and pull requests". REVIEW.md says to report CLAUDE.md violations as Important.

Verification: nit. Trigger: the PR merges with its only commit's subject as written. Commit 6aaec21 has the subject feat!: require Python 3.10 or later. The subject has no scope, which CLAUDE.md line 81 requires. The ! decides breaking-ness in the commit type, against CLAUDE.md lines 75-76. The ! does not force a major (1.0.0) bump.

@arbianst
arbianst merged commit a9bf028 into main Nov 3, 2026
8 checks passed
@arbianst
arbianst deleted the feat/python-3-10 branch November 3, 2026 11:23
@claude claude Bot mentioned this pull request Nov 3, 2026
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.

1 participant