Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ jobs:
if: ${{ needs.changes.outputs.changes == 'true' }}
strategy:
matrix:
python-version: ["3.11", "3.13"]
python-version: ["3.11", "3.14"]
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
Expand All @@ -75,7 +75,7 @@ jobs:
fail-fast: false
matrix:
os: ["ubuntu-latest"]
python-version: ["3.11", "3.13"]
python-version: ["3.11", "3.14"]
fast-compile: [0, 1]
float32: [0, 1]
install-numba: [0]
Expand Down Expand Up @@ -117,13 +117,13 @@ jobs:
part: "tests/link/numba --ignore=tests/link/numba/test_slinalg.py"
- install-numba: 1
os: "ubuntu-latest"
python-version: "3.13"
python-version: "3.14"
fast-compile: 0
float32: 0
part: "tests/link/numba --ignore=tests/link/numba/test_slinalg.py"
- install-numba: 1
os: "ubuntu-latest"
python-version: "3.13"
python-version: "3.14"
fast-compile: 0
float32: 0
part: "tests/link/numba/test_slinalg.py"
Expand All @@ -135,7 +135,7 @@ jobs:
part: "tests/link/jax"
- install-jax: 1
os: "ubuntu-latest"
python-version: "3.13"
python-version: "3.14"
fast-compile: 0
float32: 0
part: "tests/link/jax"
Expand All @@ -147,7 +147,7 @@ jobs:
part: "tests/link/pytorch"
- install-xarray: 1
os: "ubuntu-latest"
python-version: "3.13"
python-version: "3.14"
fast-compile: 0
float32: 0
part: "tests/xtensor"
Expand All @@ -161,7 +161,7 @@ jobs:
install-torch: 0
part: "tests/link/mlx"
- os: "macos-15"
python-version: "3.13"
python-version: "3.14"
fast-compile: 0
float32: 0
install-numba: 0
Expand Down Expand Up @@ -202,7 +202,7 @@ jobs:
else
micromamba install --yes -q "python~=${PYTHON_VERSION}" mkl "numpy${NUMPY_VERSION}" scipy pip mkl-service graphviz cython pytest coverage pytest-cov pytest-benchmark pytest-mock pytest-sphinx;
fi
if [[ $INSTALL_NUMBA == "1" ]]; then micromamba install --yes -q -c conda-forge "python~=${PYTHON_VERSION}" "numba>=0.57"; fi
if [[ $INSTALL_NUMBA == "1" ]]; then pip install "numba==0.63.0b1"; fi
if [[ $INSTALL_JAX == "1" ]]; then micromamba install --yes -q -c conda-forge "python~=${PYTHON_VERSION}" jax jaxlib numpyro equinox && pip install tfp-nightly; fi
if [[ $INSTALL_TORCH == "1" ]]; then micromamba install --yes -q -c conda-forge "python~=${PYTHON_VERSION}" pytorch pytorch-cuda=12.1 "mkl<=2024.0" -c pytorch -c nvidia; fi
if [[ $INSTALL_MLX == "1" ]]; then micromamba install --yes -q -c conda-forge "python~=${PYTHON_VERSION}" mlx; fi
Expand Down Expand Up @@ -324,7 +324,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0
with:
python-version: "3.13"
python-version: "3.14"

- name: Install dependencies
run: |
Expand Down
5 changes: 3 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ build-backend = "setuptools.build_meta"
[project]
name = "pytensor"
dynamic = ['version']
requires-python = ">=3.11,<3.14"
requires-python = ">=3.11,<3.15"
authors = [{ name = "pymc-devs", email = "[email protected]" }]
description = "Optimizing compiler for evaluating mathematical expressions on CPUs and GPUs."
readme = "README.rst"
Expand All @@ -33,6 +33,7 @@ classifiers = [
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
]

keywords = [
Expand Down Expand Up @@ -79,7 +80,7 @@ tests = [
]
rtd = ["sphinx>=5.1.0,<6", "pygments", "pydot"]
jax = ["jax", "jaxlib"]
numba = ["numba>=0.57", "llvmlite"]
numba = ["numba>=0.63.0b1", "llvmlite"]

[tool.setuptools.packages.find]
include = ["pytensor*"]
Expand Down
22 changes: 11 additions & 11 deletions tests/link/c/test_cmodule.py
Original file line number Diff line number Diff line change
Expand Up @@ -395,18 +395,18 @@ def test_linking_patch(listdir_mock, platform):
]


def test_cache_race_condition():
with tempfile.TemporaryDirectory() as dir_name:
@config.change_flags(on_opt_error="raise", on_shape_error="raise")
def _f_build_cache_race_condition(factor):
# Some of the caching issues arise during constant folding within the
# optimization passes, so we need these config changes to prevent the
# exceptions from being caught
a = pt.vector()
f = pytensor.function([a], factor * a)
return f(np.array([1], dtype=config.floatX))

@config.change_flags(on_opt_error="raise", on_shape_error="raise")
def f_build(factor):
# Some of the caching issues arise during constant folding within the
# optimization passes, so we need these config changes to prevent the
# exceptions from being caught
a = pt.vector()
f = pytensor.function([a], factor * a)
return f(np.array([1], dtype=config.floatX))

def test_cache_race_condition():
with tempfile.TemporaryDirectory() as dir_name:
ctx = multiprocessing.get_context()
compiledir_prop = pytensor.config._config_var_dict["compiledir"]

Expand All @@ -425,7 +425,7 @@ def f_build(factor):
# A random, constant input to prevent caching between runs
factor = rng.random()
procs = [
ctx.Process(target=f_build, args=(factor,))
ctx.Process(target=_f_build_cache_race_condition, args=(factor,))
for i in range(num_procs)
]
for proc in procs:
Expand Down
7 changes: 5 additions & 2 deletions tests/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,9 +247,12 @@ def test_config_pickling():
configparser.IntParam(5, lambda i: i > 0),
in_c_key=False,
)
# Python 3.14 emits a pickle.PicklingError
# previous versions used to emit an AttributeError
# the error string changed a little bit too
with pytest.raises(
AttributeError,
match=r"Can't (pickle|get) local object 'test_config_pickling\.<locals>\.<lambda>'",
(AttributeError, pickle.PicklingError),
match=r"Can't (pickle|get) local object .*test_config_pickling\.<locals>\.<lambda>",
):
pickle.dump(root, io.BytesIO())

Expand Down
Loading