diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 5bb416f893..9677615206 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -54,7 +54,7 @@ jobs: if: ${{ needs.changes.outputs.changes == 'true' }} strategy: matrix: - python-version: ["3.10", "3.12"] + python-version: ["3.10", "3.13"] steps: - uses: actions/checkout@v4 with: @@ -75,7 +75,7 @@ jobs: fail-fast: false matrix: os: ["ubuntu-latest"] - python-version: ["3.10", "3.12"] + python-version: ["3.10", "3.13"] numpy-version: ["~=1.26.0", ">=2.0"] fast-compile: [0, 1] float32: [0, 1] @@ -83,7 +83,6 @@ jobs: install-jax: [0] install-torch: [0] part: - - "--doctest-modules pytensor --ignore=pytensor/misc/check_duplicate_key.py --ignore=pytensor/link" - "tests --ignore=tests/tensor --ignore=tests/scan --ignore=tests/sparse" - "tests/scan" - "tests/sparse" @@ -98,23 +97,24 @@ jobs: fast-compile: 1 - python-version: "3.10" float32: 1 - - python-version: "3.10" - part: "tests/tensor/test_math.py" - fast-compile: 1 float32: 1 - - part: "--doctest-modules pytensor --ignore=pytensor/misc/check_duplicate_key.py --ignore=pytensor/link" - float32: 1 - - part: "--doctest-modules pytensor --ignore=pytensor/misc/check_duplicate_key.py --ignore=pytensor/link" - fast-compile: 1 - numpy-version: "~=1.26.0" fast-compile: 1 - numpy-version: "~=1.26.0" float32: 1 - numpy-version: "~=1.26.0" - python-version: "3.12" - - numpy-version: "~=1.26.0" - part: "--doctest-modules pytensor --ignore=pytensor/misc/check_duplicate_key.py --ignore=pytensor/link" + python-version: "3.13" include: + - os: "ubuntu-latest" + part: "--doctest-modules pytensor --ignore=pytensor/misc/check_duplicate_key.py --ignore=pytensor/link" + python-version: "3.12" + numpy-version: ">=2.0" + fast-compile: 0 + float32: 0 + install-numba: 0 + install-jax: 0 + install-torch: 0 - install-numba: 1 os: "ubuntu-latest" python-version: "3.10" @@ -124,7 +124,7 @@ jobs: part: "tests/link/numba" - install-numba: 1 os: "ubuntu-latest" - python-version: "3.12" + python-version: "3.13" numpy-version: "~=2.1.0" fast-compile: 0 float32: 0 @@ -138,7 +138,7 @@ jobs: part: "tests/link/jax" - install-jax: 1 os: "ubuntu-latest" - python-version: "3.12" + python-version: "3.13" numpy-version: ">=2.0" fast-compile: 0 float32: 0 @@ -151,7 +151,7 @@ jobs: float32: 0 part: "tests/link/pytorch" - os: macos-15 - python-version: "3.12" + python-version: "3.13" numpy-version: ">=2.0" fast-compile: 0 float32: 0 @@ -159,15 +159,6 @@ jobs: install-jax: 0 install-torch: 0 part: "tests/tensor/test_blas.py tests/tensor/test_elemwise.py tests/tensor/test_math_scipy.py" - - os: "ubuntu-latest" - python-version: "3.10" - numpy-version: "~=1.26.0" - fast-compile: 0 - float32: 0 - install-numba: 0 - install-jax: 0 - install-torch: 0 - part: "tests/tensor/test_math.py" steps: - uses: actions/checkout@v4 @@ -198,13 +189,13 @@ jobs: run: | if [[ $OS == "macos-15" ]]; then - micromamba install --yes -q "python~=${PYTHON_VERSION}=*_cpython" "numpy${NUMPY_VERSION}" scipy pip graphviz cython pytest coverage pytest-cov pytest-benchmark pytest-mock libblas=*=*accelerate; + micromamba install --yes -q "python~=${PYTHON_VERSION}" "numpy${NUMPY_VERSION}" scipy pip graphviz cython pytest coverage pytest-cov pytest-benchmark pytest-mock libblas=*=*accelerate; else - micromamba install --yes -q "python~=${PYTHON_VERSION}=*_cpython" mkl "numpy${NUMPY_VERSION}" scipy pip mkl-service graphviz cython pytest coverage pytest-cov pytest-benchmark pytest-mock; + 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; fi - if [[ $INSTALL_NUMBA == "1" ]]; then micromamba install --yes -q -c conda-forge "python~=${PYTHON_VERSION}=*_cpython" "numba>=0.57"; fi - if [[ $INSTALL_JAX == "1" ]]; then micromamba install --yes -q -c conda-forge "python~=${PYTHON_VERSION}=*_cpython" jax jaxlib numpyro && pip install tensorflow-probability; fi - if [[ $INSTALL_TORCH == "1" ]]; then micromamba install --yes -q -c conda-forge "python~=${PYTHON_VERSION}=*_cpython" pytorch pytorch-cuda=12.1 "mkl<=2024.0" -c pytorch -c nvidia; fi + if [[ $INSTALL_NUMBA == "1" ]]; then micromamba install --yes -q -c conda-forge "python~=${PYTHON_VERSION}" "numba>=0.57"; fi + if [[ $INSTALL_JAX == "1" ]]; then micromamba install --yes -q -c conda-forge "python~=${PYTHON_VERSION}" jax jaxlib numpyro && pip install tensorflow-probability; 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 pip install pytest-sphinx pip install -e ./ @@ -269,7 +260,7 @@ jobs: - name: Install dependencies shell: micromamba-shell {0} run: | - micromamba install --yes -q -c conda-forge "python~=${PYTHON_VERSION}=*_cpython" mkl numpy scipy pip mkl-service cython pytest "numba>=0.57" jax jaxlib pytest-benchmark + micromamba install --yes -q -c conda-forge "python~=${PYTHON_VERSION}" mkl numpy scipy pip mkl-service cython pytest "numba>=0.57" jax jaxlib pytest-benchmark pip install -e ./ micromamba list && pip freeze python -c 'import pytensor; print(pytensor.config.__str__(print_doc=False))' @@ -322,7 +313,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v5 with: - python-version: "3.12" + python-version: "3.13" - name: Install dependencies run: | diff --git a/pyproject.toml b/pyproject.toml index e796e35a10..f37b3de84b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -10,7 +10,7 @@ build-backend = "setuptools.build_meta" [project] name = "pytensor" dynamic = ['version'] -requires-python = ">=3.10,<3.13" +requires-python = ">=3.10,<3.14" authors = [{ name = "pymc-devs", email = "pymc.devs@gmail.com" }] description = "Optimizing compiler for evaluating mathematical expressions on CPUs and GPUs." readme = "README.rst" @@ -33,6 +33,7 @@ classifiers = [ "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", ] keywords = [ diff --git a/tests/link/jax/test_tensor_basic.py b/tests/link/jax/test_tensor_basic.py index 46f7fd7375..5461095c70 100644 --- a/tests/link/jax/test_tensor_basic.py +++ b/tests/link/jax/test_tensor_basic.py @@ -29,7 +29,7 @@ def test_jax_Alloc(): x = ptb.AllocEmpty("float32")(2, 3) def compare_shape_dtype(x, y): - np.testing.assert_array_equal(x, y, strict=True) + assert x.shape == y.shape and x.dtype == y.dtype compare_jax_and_py([], [x], [], assert_fn=compare_shape_dtype)