chore: relax requires-python floor to >= 3.11#366
Conversation
Lets the SDK install on Python 3.11 consumers (most notably scaleapi/scaleapi's egp-api-backend, which is pinned to 3.11 alongside 7 other monorepo packages). Verified the SDK source parses cleanly at ast.parse(feature_version=(3, 11)) over every .py file — no PEP 695 type params, no type statement, no other 3.12-only syntax. Declan approved the relax in conversation with Max Parke. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Closing as obsoleted — superseded by Stainless config update. The Stainless project config for agentex now sets This PR's one-line change would only persist as a manual override against the generator, so closing in favor of the config-side fix. Reopen-able if the regen doesn't produce the expected change. 🤖 — posted via Claude Code |
|
Reopened — Stainless's
So the manual Separate Stainless-side concern (won't block this PR): their lockfile pipeline should select a Python interpreter that satisfies Cc @declan-scale if you can hit the merge button when CI's green, this unblocks SGP-5968 → unblocks #143807 → unblocks the v6 IG flag-on. 🤖 — posted via Claude Code |
|
Follow-up data point — Stainless's After the Two possibilities:
Either way: the config-side fix is not an off-the-shelf 5-minute change. This PR (manual Separately re. 🤖 — posted via Claude Code |
Address Greptile P2: pyright was still targeting 3.12 while the runtime floor was lowered to 3.11. Aligning so CI type-checks against 3.11 semantics — catches 3.11-vs-3.12 stdlib/overload drift that would otherwise slip through. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Addressed Greptile's P2 on 🤖 — posted via Claude Code |
This reverts commit 66a7369.
|
Reverting commit When I flipped The root cause: this SDK has two distinct kinds of code with different Python floors:
Crucially So pyright at Greptile's concern would be valid if the entire SDK was claiming 3.11 support, but the actual semantic claim is: "client surface works on 3.11+; framework code requires 3.12+." A cleaner long-term fix is to migrate the 🤖 — posted via Claude Code |
Summary
requires-pythonfrom>= 3.12,<4→>= 3.11,<4.Python :: 3.11to the classifiers.Why
scaleapi/scaleapi's
packages/egp-api-backend(and 7 other monorepo packages) are pinned to>=3.11,<3.12, blocking adoption of this SDK there. Specifically, SGP-5968 (Insights Generator backend) is swapping fromscale-gp-agentstoagentex-sdkand Poetry version resolution fails on the current>= 3.12floor.Safety
The SDK source parses cleanly at Python 3.11 grammar — no PEP 695 type parameters, no
typestatement, no other 3.12-only syntax.Verified with:
The Stainless-generated 3.12 floor appears to be a default, not a real syntactic constraint.
Coordination
Declan pre-approved this relax in conversation with @max-parke-scale.
Test plan
🤖 Generated with Claude Code
Greptile Summary
This PR relaxes the
requires-pythonfloor from>=3.12,<4to>=3.11,<4and adds theProgramming Language :: Python :: 3.11PyPI classifier, unblocking adoption in monorepo packages pinned to>=3.11,<3.12.requires-python+ classifier: Single-line change inpyproject.toml; the PR's AST-parse verification confirms no 3.12-only syntax is used across the 200+ source files.[tool.pyright] pythonVersionremains at3.12(flagged in a prior review pass), so type-level 3.11/3.12 differences won't be caught by static analysis until that is updated.Confidence Score: 5/5
Safe to merge — the change is a one-line metadata relaxation with no modifications to SDK logic.
The diff touches only the
requires-pythonspecifier and a PyPI classifier. The author verified zero syntax errors against the 3.11 grammar across all source files, and the Stainless-generated 3.12 floor was a tooling default rather than a real language constraint. No runtime logic, dependencies, or build steps are affected.No files require special attention; the only changed file is
pyproject.tomlwith a two-line metadata edit.Important Files Changed
requires-pythonfloor from>=3.12to>=3.11and adds the corresponding PyPI classifier; syntactically clean, but[tool.pyright] pythonVersionremains at3.12and CI has no 3.11 matrix job.Flowchart
%%{init: {'theme': 'neutral'}}%% flowchart TD A["Consumer project\n(pinned to Python >=3.11,<3.12)"] -->|"Before: Poetry resolution fails"| B["agentex-sdk\nrequires-python >= 3.12"] A -->|"After: resolves ✓"| C["agentex-sdk\nrequires-python >= 3.11"] C --> D["Python 3.11 runtime"] C --> E["Python 3.12 runtime"] C --> F["Python 3.13 runtime"] B -.->|"blocked"| DComments Outside Diff (1)
pyproject.toml, line 193-196 (link)requires-pythonfloor was lowered to 3.11, butpythonVersionin the pyright config still targets 3.12. This means pyright validates stdlib types and overloads against 3.12 semantics, so any type-level incompatibilities between 3.11 and 3.12 (e.g.,tomllibbeing stdlib in 3.11 vs not,ExceptionGroupstdlib availability differences in stub resolution, or anysys.version_info-gated overloads) won't be caught by CI when running on a 3.11 host.Prompt To Fix With AI
Prompt To Fix All With AI
Reviews (4): Last reviewed commit: "Revert "chore: align pyright pythonVersi..." | Re-trigger Greptile