Repository navigation
chore!: require Python 3.11 or newer (0.36.0) - #3589
Conversation
Python 3.10 reached end of life in October 2026 and every fixed filelock release (>= 4.2.1, GHSA-v4x8-3wr5-3wq8 family) requires Python 3.11. Raise requires-python to >=3.11, drop the #3465 filelock Python-version split so filelock >= 4.2.1 applies everywhere, and remove the tomli backport. uv.lock is edited surgically (public PyPI source URLs and lock revision 5 preserved); uv lock --check passes against PyPI. Also align install.sh/install.ps1 pip fallback, the devcontainer feature floor, the Windows git-discovery CI matrix, docs and NOTICE. Refs #3562 Co-authored-by: Copilot App <[email protected]>
…-python-311 # Conflicts: # docs/src/content/docs/getting-started/installation.md # tests/unit/install/test_unix_install_ownership.py
There was a problem hiding this comment.
🟡 Changes recommended
The shipped apm-usage guide still recommends Python 3.10+ in two places, which can direct users to an interpreter incompatible with the upcoming release; both references need updating to Python 3.11+.
1 open issue
What changed in this PR
This PR raises APM's minimum Python version to 3.11 for the planned 0.36.0 release, removing the compatibility constraint that prevented patched filelock versions on Python 3.10. Prebuilt binaries retain their bundled Python.
Changes:
- Aligns package metadata, installers, devcontainers, documentation, and Windows discovery CI with Python 3.11+.
- Removes Python 3.10-only dependency resolutions and updates license notices.
- Adopts Python 3.11 standard-library features and adjusts existing regression tests.
| File | Description |
|---|---|
uv.lock |
Removes Python 3.10 resolutions, dependency edges, and wheels. |
tests/unit/test_windows_compat_gate_workflow.py |
Expects the discovery matrix to use Python 3.11 only. |
tests/unit/test_project_licensing.py |
Checks attribution for locked filelock 4.2.10. |
tests/unit/scripts/test_run_mutation_pilot.py |
Groups tomllib with standard-library imports. |
tests/unit/integration/test_agent_integrator.py |
Groups tomllib with standard-library imports. |
tests/unit/install/test_unix_install_ownership.py |
Moves installer boundary cases and guidance to 3.11. |
tests/unit/install/test_mcp_lockfile_determinism.py |
Uses datetime.UTC in timestamp fixtures. |
tests/unit/export/test_sbom.py |
Removes shim-specific assertions while retaining UTC parsing coverage. |
tests/test_lockfile.py |
Uses datetime.UTC in timestamp fixtures. |
tests/spec_conformance/test_manifest_reqs.py |
Groups tomllib with standard-library imports. |
tests/quality/test_test_taxonomy.py |
Groups tomllib with standard-library imports. |
tests/quality/test_ci_topology.py |
Groups tomllib with standard-library imports. |
tests/integration/test_oci_mcp_lifecycle_contract.py |
Groups tomllib with standard-library imports. |
tests/integration/test_marketplace_object_audit_lifecycle.py |
Uses datetime.UTC in timestamp assertions. |
tests/integration/test_marker_registry_sync.py |
Reorders tomllib as a standard-library import. |
tests/integration/test_codex_agent_tool_scope_contract.py |
Groups tomllib with standard-library imports. |
src/apm_cli/security/file_scanner.py |
Reorders the existing tomllib import. |
src/apm_cli/deps/lockfile.py |
Uses datetime.UTC for lockfile timestamps. |
src/apm_cli/deps/git_semver_resolver.py |
Uses datetime.UTC for resolution timestamps. |
src/apm_cli/core/script_executors.py |
Uses datetime.UTC for script-log timestamps. |
src/apm_cli/core/lifecycle_scripts.py |
Uses datetime.UTC for lifecycle timestamps. |
src/apm_cli/core/azure_cli.py |
Uses datetime.UTC for expiry conversion. |
src/apm_cli/commands/lock.py |
Removes the Python 3.10 UTC-designator shim. |
src/apm_cli/bundle/lockfile_enrichment.py |
Uses datetime.UTC for pack timestamps. |
scripts/notice-metadata.yaml |
Removes tomli attribution and updates filelock notes. |
scripts/generate-notice.py |
Imports tomllib directly without the backport fallback. |
README.md |
Updates the pip prerequisite comment to Python 3.11+. |
pyproject.toml |
Raises Python and filelock floors and targets Ruff at 3.11. |
NOTICE |
Aligns dependency notices with the new requirements. |
install.sh |
Requires Python 3.11 for pip fallback and recovery guidance. |
install.ps1 |
Raises pip fallback eligibility from Python 3.9 to 3.11. |
docs/src/content/docs/troubleshooting/install-failures.md |
Updates the pip prerequisite. |
docs/src/content/docs/getting-started/installation.md |
Aligns installation and fallback requirements. |
docs/src/content/docs/enterprise/security.md |
Updates supported Windows discovery version wording. |
docs/src/content/docs/contributing/integration-testing.md |
Documents the Python 3.11 discovery job. |
devcontainer/test/apm-cli/with-python-feature.sh |
Checks for Python 3.11 or newer. |
devcontainer/test/apm-cli/unit/install.bats |
Tests acceptance at 3.11 and rejection at 3.10. |
devcontainer/test/apm-cli/scenarios.json |
Moves the pinned-version scenario to Ubuntu 24.04. |
devcontainer/src/apm-cli/install.sh |
Enforces Python 3.11 and updates image guidance. |
devcontainer/README.md |
Updates prerequisites, scenarios, and supported images. |
CHANGELOG.md |
Announces the breaking Python requirement. |
.github/workflows/ci.yml |
Removes Python 3.10 from Windows discovery CI. |
Review effort: Balanced
APM Review Panel:
|
| Persona | B | R | N | Takeaway |
|---|---|---|---|---|
| Supply Chain Security Expert | 0 | 0 | 0 | The lockfile surgery is clean: filelock 4.2.10 everywhere with hashes, the 3.10 backports are removed, no dependency 3.11+ needs is dropped, and the installer floors now agree. |
| Test Coverage Expert | 0 | 1 | 0 | Five of six changed user-promise surfaces have regression traps; the install.ps1 Python-floor guard has no boundary test (install.sh does). |
B = blocking-severity findings, R = recommended, N = nits.
Counts are signal strength, not gates. The maintainer ships.
Top 1 follow-ups
- [Test Coverage Expert] Add a boundary test for
install.ps1Test-PythonRequirementthat asserts the-geoperand is 11 and that the pip-fallback error says 'Python 3.11+'. --install.shhas bats and pytest boundary tests for the same gate, andinstall.ps1has none. Without a test, a revert to-ge 9would ship silently.
Recommendation
Ship with this follow-up. The breaking change is communicated properly, and the security posture improves materially because the filelock vulnerability family is cleared. All 31 CI checks are green, and the panelists report either nothing or one low-severity gap. Add the install.ps1 boundary test so the Windows installer has the same regression traps as the Unix one.
Full per-persona findings
Supply Chain Security Expert
No findings.
Test Coverage Expert
- [recommended] The
install.ps1Test-PythonRequirementversion floor changed from 3.9 to 3.11 with no boundary test, atinstall.ps1:292.
install.shhas a bats boundary test (3.10 refused, 3.11 accepted) and a pytest parametrize[None, 3.10, 3.11]. Nothing asserts theinstall.ps1floor or its error wording. The Windows e2e test only runs the happy path.
Suggested: Add a structural unit test that extractsTest-PythonRequirementfrominstall.ps1and asserts the-ge 11operand and the 'Python 3.11+' error string.
Proof (missing at):tests/unit/test_enterprise_bootstrap_installers.py::test_windows_pip_fallback_python_floor_is_3_11-- proves: the Windows pip fallback refuses Python versions below the declared 3.11 floor [devx,portability-by-manifest]
This panel is advisory. It does not block merge. Re-apply the
panel-review label after addressing feedback to re-run.
Generated by autopilot-pr-review-worker. This comment is AI-generated and may contain errors.
Folds the panel follow-up on #3589: run Test-PythonRequirement under a PowerShell host with stubbed interpreters so 3.10 is refused and 3.11+ accepted, and assert the refusal names Python 3.11+. Refs #3562 Co-authored-by: Copilot App <[email protected]>
The shipped apm-usage guide still pointed pip users at Python 3.10+. Also generalize a notice-drift comment that cited the removed tomli marker. Refs #3562 Co-authored-by: Copilot App <[email protected]>

Description
TL;DR
APM now requires Python 3.11 or newer, starting with release 0.36.0. Python 3.10 reached end of life in October 2026, and every patched
filelockrelease (≥ 4.2.1, the GHSA-v4x8-3wr5-3wq8 fix family) needs 3.11+. This PR removes the Python-version split from #3465, so the patchedfilelocknow applies on every supported interpreter. The prebuilt standalone binaries bundle their own Python, so they are unaffected.Note
Sequencing confirmed: no 0.35.2; ships in 0.36.0.
Note
Side finding, now moot: on Python 3.10,
apm auditalready fails in 0.35.1 andmainwithError: No module named 'tomllib'. The cause is an unconditionalimport tomllibinsrc/apm_cli/security/file_scanner.py(#3529). Because there will be no 0.35.2 and 0.36.0 drops Python 3.10, notomlifallback is needed.Problem (WHY)
filelockfail onmain(CI: Dependabot security updates failing on main (setuptools transitive lock, filelock py3.10) #3562). Fixedfilelock(≥ 4.2.1) requires Python ≥ 3.11, so chore(deps): bump filelock from 3.29.0 to 4.1.0 #3465 pinned 3.10 tofilelock==3.29.0through[tool.uv] constraint-dependencies. Python 3.10 installs never get the fix.install.ps1still checked for 3.9,pyproject.tomlstill listed the 3.9 and 3.10 classifiers, and the docs said 3.10+.Approach (WHAT)
requires-python = ">=3.11"; drop the 3.9 and 3.10 classifiers; remove the[tool.uv] constraint-dependenciesfilelock split; raise the direct floor tofilelock>=4.2.1; drop thetomli; python_version<'3.11'backport.uv.lockby hand instead of regenerating it (see Trade-offs). Drop the 3.10-only packages, markers and wheels. Keep public PyPI source URLs andrevision = 5.install.shandinstall.ps1pip fallback, devcontainer featureinstall.sh, and the Windows git-discovery CI matrix (['3.10','3.11']→['3.11']).target-version = "py311"with autofixes (timezone.utc→UTC, import sort), removal of the 3.10fromisoformatZshim inapm lock, and a directimport tomllibinscripts/generate-notice.py.Implementation (HOW)
pyproject.toml: floor, classifiers, dependency floors,[tool.uv]removal, ruffpy311, and thetrusted_executablemarker text. AddsUP042(StrEnum) to the ruff ignore list instead of auto-migrating it.StrEnumchanges the output ofstr()andformat(), so that migration is not mechanical.uv.lock:requires-python >=3.11. Removes the[manifest]constraint,async-timeout,exceptiongroup,filelock 3.29.0, everypython_full_version < '3.11'dependency edge, and thecp310-cp310/pp310wheels.cp310-abi3wheels stay because they still install on 3.11+. The< '3.11'fork is removed fromresolution-markers. Diff: +3/−275.install.sh/install.ps1: the pip fallback now requires 3.11. Ininstall.ps1the check moves from a stale 3.9 to 3.11.devcontainer/: the feature floor is now 3.11 and the error suggestsubuntu:24.04ordebian:12. Thepinned-versionscenario moves offubuntu:22.04(system Python 3.10) toubuntu:24.04. The bats boundary tests now check that 3.11 passes and 3.10 fails. The feature is not published yet (publishing is disabled indevcontainer-feature-publish.yml), so its version is not bumped..github/workflows/ci.yml:windows-git-discoverynow runs on 3.11 only. Its< (3, 12)PATHEXT fallback still applies there, so the job still covers it. The job is not listed inmerge-gate.ymlEXPECTED_CHECKS, so removing the 3.10 check run does not affect the gate.src/apm_cli/commands/lock.py: removes_normalize_utc_designator, because 3.11'sdatetime.fromisoformatparses a trailingZ. Its test still asserts thatZinput normalizes to+00:00.scripts/runtime/setup-llm.*,runtime/manager.pyandtroubleshooting/ssl-issues.mdstill say "3.10+". Those refer to thellmchild-runtime venv's need fortruststore, not to APM's own interpreter.git_env.py's< (3, 12)gate is also unchanged, because it still applies to 3.11.Diagram
Legend: every place that now enforces the 3.11 floor (solid edges), and the standalone binary path, which bundles its own Python and is unaffected (dashed).
flowchart LR PY["pyproject.toml<br/>requires-python >=3.11"] --> LOCK["uv.lock<br/>requires-python >=3.11<br/>filelock 4.2.10 only"] PY --> PIP["pip / PyPI metadata<br/>refuses 3.10"] SH["install.sh pip fallback<br/>REQUIRED_VERSION 3.11"] --> PIP PS["install.ps1 pip fallback<br/>minor -ge 11"] --> PIP DC["devcontainer feature<br/>PYTHON_MINOR -lt 11 fails"] --> PIP BIN["standalone binaries<br/>bundled Python 3.12"] -.->|"unaffected"| USER["user"] PIP --> USER CI["ci.yml windows-git-discovery<br/>matrix 3.11"] --> PYTrade-offs
uv.lockedited by hand, not regenerated. Runninguv locklocally either cannot reachfiles.pythonhosted.orgor, through the internal feed proxy, rewrites every source URL, downgrades the lock torevision = 3, and resolvesfilelock4.2.9 instead of 4.2.10. I used the proxy run only as a structural reference. A normalized diff (ignoring source and URL fields) matches the edited lock except for the proxy'sfilelockversion and the fork grouping ofresolution-markers. The edited lock keeps the existing 3.11/3.12/3.13/3.14 forks. Against public PyPI,uv lock --checkpasses anduv lockmakes no changes.py311autofixes widen the diff (about 15 files) with mechanicaltimezone.utc→UTCchanges. Leavingpy310would let 3.10-compatible idioms keep accumulating.UP042is ignored on purpose (see Implementation).ubuntu:22.04now hit the 3.11 check, even though old APM releases ran on 3.10. Keeping a single floor was chosen over a version-aware check.pip (Python 3.10+)→3.11+). Repo rule 2 requires maintainer approval for README changes, so please confirm during review.Benefits
filelock(≥ 4.2.1) is the only resolution on every supported interpreter.uv.lockhas 0python_full_version < '3.11'markers, down from 16.pyproject.toml, both installers' pip fallback, the devcontainer feature, docs and CI (install.ps1previously checked 3.9).Issue and approved scope
Issue: Refs #3562
Human scope-approval comment: #3562 (comment) (maintainer decision of 2026-11-12, also recorded in the Atlas decision
decisions/2026-11-12-require-python-311.md).Does this PR complete the issue, or what remains? It contains all the code for the decision. The issue stays open until 0.36.0 ships, hence
Refs, notFixes.Type of change
Testing
install.ps1floor boundary test (panel follow-up); the existing boundary tests were moved to the new 3.11 floor.Validation
Lint contract (
.apm/instructions/linting.instructions.md, includingscripts/windows_native_symlink_probe_entry.py): all green.Lockfile, against public PyPI (
UV_DEFAULT_INDEX=https://pypi.org/simple):Python 3.10 is refused at install time:
NOTICE was regenerated with
scripts/generate-notice.pyfrom a venv matchinguv.lock. The diff only removes thetomlicomponent and updates thefilelockrequirement and note.Local unit suite (macOS,
pytest tests/unit tests/test_console.py tests/red_team -n 8)subprocess.TimeoutExpiredin installer-script suites (test_unix_install_ownership.py,test_unix_installer_checksums.py) under 8-way load. The sametest_binary_failure_advice_preserves_installation_ownership[...-existing]timeouts reproduce on unmodifiedorigin/mainon this machine.test_project_licensing.py::test_filelock_notice_matches_reviewed_releasepinned the old "locked 3.29.0 release" note. Fixed in this PR.5 failed, 411 passed. All 5 are environmental:test_is_tool_availableneedspythononPATH, and the 4 others are network/curl-backedtest_public_release_metadata.pycases that differ from run to run.CI on this PR is the authoritative signal. On merge commit
79891b3ee6, all 31 checks pass, includingLint, bothBuild & Testshards,Windows Git Discovery (Python 3.11),Windows Compatibility Gate, the lifecycle smoke shards,NOTICE Drift Check,Spec conformance,Devcontainer Feature - Test(bats plus the image scenarios, including the newpinned-versionimageubuntu:24.04) andMerge Gate. Latermainmerges were clean; ruff and the pylint R0801 mirror were rerun on them.Scenario Evidence
tests/unit/install/test_unix_install_ownership.py::test_binary_failure_advice_preserves_installation_ownership(3.10 rejected, 3.11 accepted),::test_missing_python_recovery_does_not_invent_pip_commandtests/unit/test_enterprise_bootstrap_installers.py::test_windows_pip_fallback_enforces_python_311_floor(runsTest-PythonRequirementunder pwsh; reverting the check to-ge 9makes it fail)devcontainer/test/apm-cli/unit/install.bats(boundary tests for 3.11 passing and 3.10 failing; CIunit-bats)tests/unit/test_windows_compat_gate_workflow.py::test_legacy_windows_git_discovery_runs_real_consumer_contracts, CIWindows Git Discovery (Python 3.11)apm lock export --timestamp ...Zstill accepts UTCZtimestamps."tests/unit/export/test_sbom.py::test_resolve_export_timestamp_valid_isotests/unit/test_project_licensing.py::test_filelock_notice_matches_reviewed_releaseHow to test
uv lock --checkagainst public PyPI →Resolved 105 packages, exit 0.grep -c "python_full_version < '3.11'" uv.lock→0.uv venv --python 3.10 /tmp/v && uv pip install --python /tmp/v/bin/python .→ resolution fails because ofrequires-python >=3.11.bash install.shwith only a Python 3.10 onPATHand a forced binary failure → printsInstall Python 3.11+ first.Spec conformance (OpenAPM v0.1)
Co-authored-by: Copilot [email protected]