Skip to content
Merged
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
5 changes: 5 additions & 0 deletions .github/workflows/pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,11 @@ jobs:
path: dist
merge-multiple: true

- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: '3.11'

- name: Check SDist
run: |
mkdir -p test-sdist
Expand Down
37 changes: 10 additions & 27 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.10", "3.13"]
python-version: ["3.11", "3.13"]
steps:
- uses: actions/checkout@v5
with:
Expand All @@ -65,7 +65,7 @@ jobs:
- uses: pre-commit/[email protected]

test:
name: "${{ matrix.os }} test py${{ matrix.python-version }} numpy${{ matrix.numpy-version }} : fast-compile ${{ matrix.fast-compile }} : float32 ${{ matrix.float32 }} : ${{ matrix.part }}"
name: "${{ matrix.os }} test py${{ matrix.python-version }} : fast-compile ${{ matrix.fast-compile }} : float32 ${{ matrix.float32 }} : ${{ matrix.part }}"
needs:
- changes
- style
Expand All @@ -75,8 +75,7 @@ jobs:
fail-fast: false
matrix:
os: ["ubuntu-latest"]
python-version: ["3.10", "3.13"]
numpy-version: ["~=1.26.0", ">=2.0"]
python-version: ["3.11", "3.13"]
fast-compile: [0, 1]
float32: [0, 1]
install-numba: [0]
Expand All @@ -92,23 +91,16 @@ jobs:
- "tests/tensor/test_basic.py tests/tensor/test_inplace.py tests/tensor/conv"
- "tests/tensor/test_blas.py tests/tensor/test_elemwise.py tests/tensor/test_math_scipy.py"
exclude:
- python-version: "3.10"
- python-version: "3.11"
fast-compile: 1
- python-version: "3.10"
- python-version: "3.11"
float32: 1
- fast-compile: 1
float32: 1
- numpy-version: "~=1.26.0"
fast-compile: 1
- numpy-version: "~=1.26.0"
float32: 1
- numpy-version: "~=1.26.0"
python-version: "3.13"
include:
- os: "ubuntu-latest"
part: "--doctest-modules pytensor --ignore=pytensor/misc/check_duplicate_key.py --ignore=pytensor/link --ignore=pytensor/ipython.py"
python-version: "3.12"
numpy-version: ">=2.0"
fast-compile: 0
float32: 0
install-numba: 0
Expand All @@ -117,56 +109,48 @@ jobs:
install-xarray: 0
- install-numba: 1
os: "ubuntu-latest"
python-version: "3.10"
numpy-version: "~=2.1.0"
python-version: "3.11"
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"
numpy-version: "~=2.1.0"
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"
numpy-version: "~=2.1.0"
fast-compile: 0
float32: 0
part: "tests/link/numba/test_slinalg.py"
- install-jax: 1
os: "ubuntu-latest"
python-version: "3.10"
numpy-version: ">=2.0"
python-version: "3.11"
fast-compile: 0
float32: 0
part: "tests/link/jax"
- install-jax: 1
os: "ubuntu-latest"
python-version: "3.13"
numpy-version: ">=2.0"
fast-compile: 0
float32: 0
part: "tests/link/jax"
- install-torch: 1
os: "ubuntu-latest"
python-version: "3.10"
numpy-version: ">=2.0"
python-version: "3.11"
fast-compile: 0
float32: 0
part: "tests/link/pytorch"
- install-xarray: 1
os: "ubuntu-latest"
python-version: "3.13"
numpy-version: ">=2.0"
fast-compile: 0
float32: 0
part: "tests/xtensor"
- os: macos-15
python-version: "3.13"
numpy-version: ">=2.0"
fast-compile: 0
float32: 0
install-numba: 0
Expand Down Expand Up @@ -222,7 +206,6 @@ jobs:
fi
env:
PYTHON_VERSION: ${{ matrix.python-version }}
NUMPY_VERSION: ${{ matrix.numpy-version }}
INSTALL_NUMBA: ${{ matrix.install-numba }}
INSTALL_JAX: ${{ matrix.install-jax }}
INSTALL_TORCH: ${{ matrix.install-torch}}
Expand Down Expand Up @@ -265,7 +248,7 @@ jobs:
with:
fetch-depth: 0
persist-credentials: false
- name: Set up Python 3.10
- name: Set up Python 3.11
uses: mamba-org/setup-micromamba@v2
with:
environment-name: pytensor-test
Expand All @@ -281,7 +264,7 @@ jobs:
python -c 'import pytensor; print(pytensor.config.__str__(print_doc=False))'
python -c 'import pytensor; assert pytensor.config.blas__ldflags != "", "Blas flags are empty"'
env:
PYTHON_VERSION: 3.10
PYTHON_VERSION: 3.11
- name: Download previous benchmark data
uses: actions/cache@v4
with:
Expand Down
2 changes: 1 addition & 1 deletion doc/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ channels:
- conda-forge
- nodefaults
dependencies:
- python=3.10
- python=3.11
- gcc_linux-64
- gxx_linux-64
- numpy
Expand Down
4 changes: 2 additions & 2 deletions environment-osx-arm64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ name: pytensor-dev
channels:
- conda-forge
dependencies:
- python>=3.10
- python>=3.11
- compilers
- numpy>=1.17.0
- numpy>=2.0.0
- scipy>=1,<2
- filelock>=3.15
- etuples
Expand Down
4 changes: 2 additions & 2 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ name: pytensor-dev
channels:
- conda-forge
dependencies:
- python>=3.10
- python>=3.11
- compilers
- numpy>=1.17.0
- numpy>=2.0.0
- scipy>=1,<2
- filelock>=3.15
- etuples
Expand Down
9 changes: 4 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
requires = [
"setuptools>=59.0.0",
"cython",
"numpy>=1.17.0",
"numpy>=2.0",
"versioneer[toml]==0.29",
]
build-backend = "setuptools.build_meta"

[project]
name = "pytensor"
dynamic = ['version']
requires-python = ">=3.10,<3.14"
requires-python = ">=3.11,<3.14"
authors = [{ name = "pymc-devs", email = "[email protected]" }]
description = "Optimizing compiler for evaluating mathematical expressions on CPUs and GPUs."
readme = "README.rst"
Expand All @@ -30,7 +30,6 @@ classifiers = [
"Operating System :: Unix",
"Operating System :: MacOS",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
Expand All @@ -49,7 +48,7 @@ keywords = [
dependencies = [
"setuptools>=59.0.0",
"scipy>=1,<2",
"numpy>=1.17.0",
"numpy>=2.0",
"filelock>=3.15",
"etuples",
"logical-unification",
Expand Down Expand Up @@ -169,7 +168,7 @@ lines-after-imports = 2


[tool.mypy]
python_version = "3.10"
python_version = "3.11"
ignore_missing_imports = true
strict_equality = true
warn_redundant_casts = true
Expand Down
5 changes: 2 additions & 3 deletions pytensor/link/c/basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@
from pytensor.link.c.cmodule import get_module_cache as _get_module_cache
from pytensor.link.c.interface import CLinkerObject, CLinkerOp, CLinkerType
from pytensor.link.utils import gc_helper, map_storage, raise_with_op, streamline
from pytensor.npy_2_compat import ndarray_c_version
from pytensor.utils import difference, uniq
from pytensor.utils import NDARRAY_C_VERSION, difference, uniq


NoParams = object()
Expand Down Expand Up @@ -1367,7 +1366,7 @@ def cmodule_key_(

# We must always add the numpy ABI version here as
# DynamicModule always add the include <numpy/arrayobject.h>
sig.append(f"NPY_ABI_VERSION=0x{ndarray_c_version:X}")
sig.append(f"NPY_ABI_VERSION=0x{NDARRAY_C_VERSION:X}")
if c_compiler:
sig.append("c_compiler_str=" + c_compiler.version_str())

Expand Down
2 changes: 1 addition & 1 deletion pytensor/link/numba/dispatch/elemwise.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import numba
import numpy as np
from numba.core.extending import overload
from numpy.lib.array_utils import normalize_axis_index, normalize_axis_tuple
from numpy.lib.stride_tricks import as_strided

from pytensor.graph.op import Op
Expand All @@ -19,7 +20,6 @@
store_core_outputs,
)
from pytensor.link.utils import compile_function_src
from pytensor.npy_2_compat import normalize_axis_index, normalize_axis_tuple
from pytensor.scalar.basic import (
AND,
OR,
Expand Down
Loading
Loading