Skip to content

Support Python 3.13 and 3.14 - #2962

Open
Flix6x wants to merge 3 commits into
mainfrom
feat/python-3.13-3.14
Open

Flix6x wants to merge 3 commits into
mainfrom
feat/python-3.13-3.14

Conversation

@Flix6x

@Flix6x Flix6x commented Dec 5, 2026

Copy link
Copy Markdown
Member

Description

  • Widen requires-python from >=3.11, <3.13 to >=3.11, <3.15, add the 3.13 and 3.14 trove classifiers, and re-lock uv.lock (with uv 0.12.7, as required-version asks).
  • Test on 3.13 and 3.14 in lint-and-test.yml (matrix [ "3.11", "3.12", "3.13", "3.14" ]); coverage, .python-version, the Dockerfile and Read the Docs stay on 3.12.
  • Fix the one break: Python 3.14 reworded the message of math.sqrt(-1)'s ValueError ("math domain error" became "expected a nonnegative input, got -1.0"), which nine job-failure tests compared verbatim. They now ask the running Python for it (math_sqrt_error_message() in flexmeasures/tests/utils.py). Only tests change; FlexMeasures code needed nothing.
  • The agent docs in .github/agents/ name the new matrix (and coverage on 3.12, as the workflow already has it).
  • Added changelog item in documentation/changelog.rst (Infrastructure / Support), and the v1.2.0 warning about dropping 3.10 now says which versions are supported.

The lock installs exactly the same packages on 3.11 and 3.12 as before (compared with uv export per version); it only adds the cp313/cp314 wheels, plus numpy 2.3.5 for Intel Macs on 3.14 (numpy 2.2.6, which Intel Macs get elsewhere, has no 3.14 wheel).

Look & Feel

Full CI test command (incl. doctests), Postgres 17.4, run locally:

Python before after
3.11 (not run: lock unchanged) 4575 passed
3.12 (lock unchanged) 4575 passed
3.13 — (refused by requires-python) 4575 passed
3.14 9 failed, 4566 passed 4575 passed

Deprecation warnings: the same 51 distinct warning sites on 3.12, 3.13 and 3.14, so none announce a break specific to the new versions.

timely-beliefs 5.0.0 passes its own suite on 3.13 and 3.14 as it is (424 passed each), so no timely-beliefs PR has to go first.

How to test

uv sync --python 3.14 --group test
uv run --python 3.14 pytest flexmeasures/cli/tests/test_jobs.py flexmeasures/data/tests/test_job_failures.py flexmeasures/ui/tests/test_tasks_views.py

Further Improvements

  • The lock gives Intel Macs numba 0.62.1, which has no 3.14 wheel, so Intel Macs on 3.14 would build numba (and llvmlite) from source; Linux and Apple-silicon Macs install wheels only.
  • timely-beliefs could add 3.13 and 3.14 to its CI matrix and classifiers (optional, not needed for this PR).

Related Items

Follow-up named in #2839 (drop Python 3.10): "We could add Python 3.13 support, which is out since Oct 2024, and 3.14."


Sign-off

  • I agree to contribute to the project under Apache 2 License.
  • To the best of my knowledge, the proposed patch is not based on code under GPL or other license that is incompatible with FlexMeasures

🤖 Generated with Claude Code

Flix6x and others added 2 commits December 5, 2026 19:08
…ests

Tests fail a job with math.sqrt(-1) and compared its stored message with "math domain error".
Python 3.14 reworded it to "expected a nonnegative input, got -1.0",
so nine tests failed there; they now take the message from the running Python.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: F.N. Claessen <claessen@seita.nl>
Widen requires-python to <3.15, add the trove classifiers, re-lock,
and test on 3.13 and 3.14 in CI.
The lock installs exactly the same packages on 3.11 and 3.12 as before;
it only adds wheels for 3.13 and 3.14 (and numpy 2.3.5 for Intel Macs on 3.14).
The agent docs now name the 3.11-3.14 matrix (and coverage on 3.12, as the workflow has it).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: F.N. Claessen <claessen@seita.nl>
@Flix6x Flix6x added this to the 1.2.0 milestone Dec 5, 2026
@Flix6x Flix6x added Continuous Integration installation dependencies Pull requests that update a dependency file python Pull requests that update python code labels Dec 5, 2026
@Flix6x Flix6x self-assigned this Dec 5, 2026
Signed-off-by: F.N. Claessen <claessen@seita.nl>
@read-the-docs-community

Copy link
Copy Markdown

📖 2 files modified


Preview · build overview · flexmeasures · built Dec. 5, 2026, 7:10 p.m. UTC

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Continuous Integration dependencies Pull requests that update a dependency file installation python Pull requests that update python code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant