Repository navigation
build: support Python 3.15 - #457
Conversation
Add the Python 3.15 classifier and Python 3.15 to the matrices of the unit tests (MongoDB 7.0 and 8.0), the image build, scan and publish jobs of checks.yml and release.yml, and the weekly scan of the release images. The integration tests now run on the images of Python 3.13 (the default) and 3.15, with the aggregate check "Integration tests (petstore)" keeping the name of the required check. The unsuffixed image tags stay on Python 3.13 (default: true), the newest version in its security-fix phase. The weekly scan skips Python versions whose first release with images is not out yet (3.15 until 0.18.0), with a notice, instead of failing on the missing image. Co-Authored-By: Claude Opus 5.5 <[email protected]>
List Python 3.11 to 3.15 as supported in the README, Getting started
and the contributing guide, describe the Python 3.15 images and the
policy for the Python version of the default image in Getting started
("Docker"), and add Python 3.15 to the migration notes of 0.18.0.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Older pydantic versions pin pydantic-core versions without Python 3.15 wheels, which pip would build from source (Rust). The lower bound stays at 2.7 on Python 3.11 to 3.14. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Give the default-image policy a paragraph of its own in Getting started, say where the bounds of the supported Python versions are declared, re-wrap the CI description in the contributing guide, and say which Python version runs the integration tests in checks.yml. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Reviewer's GuideAdds end-to-end Python 3.15 support: dependency metadata and documentation are updated, CI validates the new runtime and image, release workflows publish Python-versioned images while retaining Python 3.13 as the default, and weekly scanning safely handles the pre-0.18.0 image gap. Sequence diagram for Python 3.15 integration testingsequenceDiagram
participant CI as GitHub Actions
participant Build as FOCA image build
participant Petstore as Petstore integration tests
CI->>Build: Build 3.13 or 3.15 image
Build-->>CI: Image available
CI->>Petstore: Set PETSTORE_PY_IMAGE
Petstore->>Petstore: Run integration tests
Petstore-->>CI: Test result
CI->>CI: integration-passed
Flow diagram for Python-versioned release tagsflowchart TD
Release[Release workflow] --> Matrix[Build and publish Python 3.11-3.15 images]
Matrix --> Default[Python 3.13 marked default]
Default --> Stable[Unsuffixed X.Y.Z and latest tags]
Matrix --> Suffixed[Python-versioned tags]
Suffixed --> Py315[ X.Y.Z-py3.15 tag ]
File-Level Changes
Assessment against linked issues
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool. What Enabling Code Scanning Means:
For more information about GitHub Code Scanning, check out the documentation. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## dev #457 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 28 28
Lines 3266 3266
=========================================
Hits 3266 3266
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Hey - I've found 2 issues
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location path=".github/workflows/checks.yml" line_range="128" />
<code_context>
fail-fast: false
matrix:
- python-version: ["3.11", "3.12", "3.13", "3.14"]
+ python-version: ["3.11", "3.12", "3.13", "3.14", "3.15"]
mongodb-version: ["7.0"]
+ # MongoDB 8.0 with the Python version of the default image and the
</code_context>
<issue_to_address>
**Python 3.15 lower bound is not CI-tested**
When the Python 3.15 pydantic lower bound or its compatibility with FOCA regresses, the `test-lowest` job still runs only on Python 3.11, so CI never installs the Python 3.15-specific minimum, pydantic 2.14, and runs the suite against it. A regression in that minimum-version combination can therefore pass CI while breaking users who install FOCA on Python 3.15 with the allowed minimum dependency.
Add a lowest-direct dependency test on Python 3.15, or otherwise exercise the marker-selected minimum in CI.
Also at `pyproject.toml:59`.
</issue_to_address>
### Comment 2
<location path="docs/getting-started.md" line_range="111-115" />
<code_context>
+the `dev` branch are tagged with their date and the Python version (e.g.,
+`20261019-py3.13`).
+
+The default Python version is the newest one in its security-fix phase (cf.
+the [status of Python versions](https://devguide.python.org/versions/));
+newer versions, still in their bugfix phase, get suffixed tags only. The
+default moves on about once a year, after a new Python version is released,
+so pin a suffixed tag to keep the Python version.
+
+Images are signed and come with SBOM and provenance attestations, and CI
</code_context>
<issue_to_address>
**Petstore docs promise wrong default**
When a user follows the Petstore README after Python 3.15 is added as a supported version, users following the Petstore README are told its default uses the latest supported Python, so they expect Python 3.15; `docker-compose.yaml` actually defaults to Python 3.13, and the new policy says newer bugfix-phase versions get suffixed tags only. The setup instructions therefore give users the wrong expectation about the image they build.
Update the Petstore README to say that the default uses Python 3.13, or clarify that users must set `PETSTORE_PY_IMAGE` to select another supported version.
</issue_to_address>Sourcery assessment
Needs a human reviewer. 1 finding to address first, and if the Python 3.15 dependency constraint or image build is wrong, installs could resolve an incompatible Pydantic version or a broken 3.15 image could be published. The affected installs and image tags can outlive a revert, but the impact is limited to Python 3.15 and can be repaired with corrected constraints or images.
Blocking findings: .github/workflows/checks.yml:128
The lower bound of pydantic depends on the Python version (2.14 on 3.15), so run the lowest-direct unit tests on the oldest and the newest supported Python version. Also correct the default Python version in the README of the petstore example (3.13, not the newest one). Co-Authored-By: Claude Opus 5.5 <[email protected]>
Summary
Supports Python 3.15 in FOCA 0.18.0 (issue #448):
Programming Language :: Python :: 3.15classifier;requires-pythonunchanged (>=3.11). On Python 3.15 only, pydantic needs to be 2.14 or later (marker-split requirement), as older pydantic versions pin pydantic-core versions without cp315 wheels; the 2.7 floor stays for 3.11 to 3.14.checks.yml): 3.15 in the unit tests (MongoDB 7.0, plus MongoDB 8.0 next to 3.13, per "all MongoDB variants"), in the image push, scan and publish (dated tags) jobs. The integration tests are now a matrix over the images of Python 3.13 (default) and 3.15; a new aggregate job keeps the required check name "Integration tests (petstore)", like "Unit tests" and "Scan images" (which cover 3.15 through theirneeds).release.yml): 3.15 in the push, scan and publish matrices;default: truestays on 3.13, soX.Y.Zandlateststay on Python 3.13 and 3.15 getsX.Y.Z-py3.15only.scan.yml): 3.15 added. Until the first release with 3.15 images (0.18.0) is out, the 3.15 job scans nothing and passes with a notice (matrix entryfirst-release: "0.18.0"; remove it after the release), instead of failing on the missing image.python:3.15-slim-trixiewith the same Dockerfile (pip 26.2.2 already in the base image; the setuptools/wheel uninstall is a no-op).test-lowestjob runs on Python 3.11 and 3.15 (Sourcery finding), as the pydantic lower bound depends on the Python version.Dependencies on Python 3.15
Checked in
python:3.15-slim-trixie(Python 3.15.1) with all runtime, dev, docs, lint and release dependencies:yaml.safe_loadonly, so it needs no C extension. Not a blocker.ruamel.yaml.clibhas no cp315 wheel). Not relevant for CI or users.Verification
python:3.15-slim-trixie, MongoDB 7.0:pip install -e .[dev,docs] -r requirements/lint.txt -r requirements/release.txtOK;coverage run -m pytest: 2072 passed (1 failure:test_no_personal_email_addresses, needsgit, which the image lacks), coverage 100%;mypy foca: no issues.uv pip install --resolution lowest-direct --only-binary :all:(PyYAML from sdist): 2072 passed; and without--only-binaryinpython:3.15-trixie(as the new 3.15test-lowestjob does): pydantic 2.14.0, pymongo 4.18.2 (built from source), PyYAML 6.0.1; 2072 passed.docker build -f docker/Dockerfile --build-arg PY_IMAGE=3.15-slim-trixie .: builds; FOCA, PyYAML and pydantic-core import.uv pip compile --resolution lowest-direct: pydantic 2.7.0 on 3.11, 2.14.0 on 3.15.pre-commit run --all-filespassed;mypyno issues;mkdocs build --strictOK.version_geskip logic ofscan.ymlchecked in a shell (0.17.x skip; 0.18.0, 0.18.1, 1.0.0 scan).requires-pythonwording).Declined review findings
first-releaseentry inscan.yml: the comment says to remove it once 0.18.0 is released; the skip branch only runs onworkflow_dispatch/schedule, checked in a shell instead.yaml.__with_libyaml__ == False).deployment.md("default 3.13 one") stays correct until the yearly rotation.Open questions
None.
Closes #448
🤖 Generated with Claude Code