Skip to content

Commit 6d6f51a

Browse files
Support Python 3.14, drop JAX on macOS Intel (#5374)
* feat: support Python 3.14, bump JAX and CasADi, drop JAX on macOS Intel Bump requires-python to <3.15, CasADi to 3.7.2, and JAX to >=0.7.0,<0.9.0 for Python 3.14 compatibility. Add a PEP 508 platform marker to exclude JAX on macOS x86_64 since JAX dropped Intel Mac wheels in 0.5.0. Remove explicit casadi pin since it is managed transitively through pybammsolvers.Update idaklu_jax.py for JAX 0.7+ API changes (explicit np.int64 casts, type check adjustments). Add raise_jax_not_found() helper with a platform-aware error message so macOS Intel users get a clear explanation. * docs: add changelog entry * fix: update deprecated JAX API calls for JAX 0.7+ Migrate jax.lib.xla_bridge.get_backend() to jax.extend.backend.get_backend() (deprecated in JAX 0.8.0) and jax.interpreters.mlir.custom_call to jax._src.interpreters.mlir.custom_call. * style: pre-commit fixes * fix: add Python >=3.11 marker for JAX and handle 3.14 math error message Add python_version >= '3.11' to the JAX dependency marker since JAX 0.7+ requires Python 3.11. Update test_bruggeman_invalid_values_raise regex to match both the old 'math domain error' and the new Python 3.14 message 'expected a positive input' (cpython#101410). * fix: skip jax parametrized test when jax is not installed * infra: increment pybammsolvers * infra: add Python 3.14 to CI, docs, and packaging Update all workflows, documentation, Dockerfile, ReadTheDocs config, and pyproject.toml classifiers to include Python 3.14. Drop Python 3.10 from CI test matrices. --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 86531fb commit 6d6f51a

File tree

21 files changed

+97
-53
lines changed

21 files changed

+97
-53
lines changed

.github/workflows/periodic_benchmarks.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,10 @@ jobs:
3232
with:
3333
persist-credentials: false
3434

35-
- name: Set up Python 3.12
35+
- name: Set up Python 3.14
3636
uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0
3737
with:
38-
python-version: 3.12
38+
python-version: 3.14
3939

4040
- name: Install Linux system dependencies
4141
run: |
@@ -70,10 +70,10 @@ jobs:
7070
permissions:
7171
contents: write
7272
steps:
73-
- name: Set up Python 3.12
73+
- name: Set up Python 3.14
7474
uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0
7575
with:
76-
python-version: 3.12
76+
python-version: 3.14
7777

7878
- name: Install asv
7979
run: pip install asv

.github/workflows/publish_pypi.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
persist-credentials: true
1919
- uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0
2020
with:
21-
python-version: 3.13
21+
python-version: 3.14
2222

2323
- name: Build wheel
2424
run: pipx run build --outdir deploy

.github/workflows/run_benchmarks_over_history.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,10 @@ jobs:
4040
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
4141
with:
4242
persist-credentials: false
43-
- name: Set up Python 3.12
43+
- name: Set up Python 3.14
4444
uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0
4545
with:
46-
python-version: 3.12
46+
python-version: 3.14
4747

4848
- name: Install nox and asv
4949
run: pip install -U pip nox asv
@@ -131,10 +131,10 @@ jobs:
131131
permissions:
132132
contents: write
133133
steps:
134-
- name: Set up Python 3.12
134+
- name: Set up Python 3.14
135135
uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0
136136
with:
137-
python-version: 3.12
137+
python-version: 3.14
138138

139139
- name: Install asv
140140
run: pip install asv

.github/workflows/run_periodic_tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
fail-fast: false
3232
matrix:
3333
os: [ ubuntu-latest, macos-15-intel, macos-latest, windows-latest ]
34-
python-version: ["3.10", "3.11", "3.12", "3.13"]
34+
python-version: ["3.11", "3.12", "3.13", "3.14"]
3535
name: Tests (${{ matrix.os }} / Python ${{ matrix.python-version }})
3636

3737
steps:

.github/workflows/test_on_push.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ jobs:
4949
fail-fast: false
5050
matrix:
5151
os: [ubuntu-latest, macos-15-intel, macos-latest, windows-latest]
52-
python-version: ["3.10", "3.11", "3.12", "3.13"]
52+
python-version: ["3.11", "3.12", "3.13", "3.14"]
5353
name: Tests (${{ matrix.os }} / Python ${{ matrix.python-version }})
5454

5555
steps:

.readthedocs.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ build:
1919
- "graphviz"
2020
os: ubuntu-22.04
2121
tools:
22-
python: "3.13"
22+
python: "3.14"
2323
jobs:
2424
pre_create_environment:
2525
- asdf plugin add uv

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
## Features
44

5+
- Added support for Python 3.14. ([#5374](https://github.com/pybamm-team/PyBaMM/pull/5374))
56
- Added regularisation to the kinetics and OCPs so they are more numerically stable. ([#5371](https://github.com/pybamm-team/PyBaMM/pull/5371))
67
- Improve the performance of matrix multiplication with CasADi expressions. ([#5351](https://github.com/pybamm-team/PyBaMM/pull/5351))
78
- Adds option for lists of inputs to `solve` to include input parameters which are used
@@ -12,6 +13,7 @@ as initial conditions. ([#5311](https://github.com/pybamm-team/PyBaMM/pull/5311)
1213

1314
## Breaking changes
1415

16+
- Dropped JAX support on macOS with Intel (x86_64) processors. JAX dropped macOS Intel wheels in version 0.5.0, and the minimum JAX version has been bumped to >=0.7.0 for Python 3.14 compatibility. macOS users require Apple Silicon (M-series) for JAX features. ([#5374](https://github.com/pybamm-team/PyBaMM/pull/5374))
1517
- Added a small regularisation term to the exchange current density which slightly modifies the functional form of the kinetics as stoichiometry approaches 0 or 1. ([#5371](https://github.com/pybamm-team/PyBaMM/pull/5371))
1618
- The default OCP barrier as stoichiometry approaches 0 or 1 is now smooth instead of asymptotically approaching infinity. This may change the behavior of ESOH solvers in extreme stoichiometry limits. ([#5371](https://github.com/pybamm-team/PyBaMM/pull/5371))
1719
- Migrated `docs` and `dev` dependencies from `project.optional-dependencies` to `dependency-groups` per PEP 735. ([#5368](https://github.com/pybamm-team/PyBaMM/pull/5368))

docs/source/user_guide/installation/gnu-linux-mac.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ GNU/Linux & macOS
66
Prerequisites
77
-------------
88

9-
To use PyBaMM, you must have Python 3.10, 3.11, 3.12, 3.13 installed.
9+
To use PyBaMM, you must have Python 3.10, 3.11, 3.12, 3.13, or 3.14 installed.
1010

1111
.. tab:: Debian-based distributions (Debian, Ubuntu)
1212

@@ -43,7 +43,7 @@ User install
4343

4444
We recommend to install PyBaMM within a virtual environment, in order
4545
not to alter any distribution Python files.
46-
First, make sure you are using Python 3.10, 3.11, 3.12, 3.13.
46+
First, make sure you are using Python 3.10, 3.11, 3.12, 3.13, or 3.14.
4747
To create a virtual environment ``env`` within your current directory type:
4848

4949
.. code:: bash

docs/source/user_guide/installation/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ Dependency Minimum Version p
213213
Jax dependencies
214214
^^^^^^^^^^^^^^^^
215215

216-
Installable with ``pip install "pybamm[jax]"``, currently supported on Python 3.10-3.12.
216+
Installable with ``pip install "pybamm[jax]"``, currently supported on Python 3.10-3.14.
217217

218218
========================================================================= ================== ================== =======================
219219
Dependency Minimum Version pip extra Notes

docs/source/user_guide/installation/install-from-source.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ or download the source archive on the repository's homepage.
2828

2929
To install PyBaMM, you will need:
3030

31-
- Python 3 (PyBaMM supports versions 3.10, 3.11, 3.12, and 3.13)
31+
- Python 3 (PyBaMM supports versions 3.10 3.14)
3232
- The Python headers file for your current Python version.
3333
- A BLAS library (for instance `openblas <https://www.openblas.net/>`_).
3434
- A C compiler (ex: ``gcc``).

0 commit comments

Comments
 (0)