Skip to content

Commit e8dc48c

Browse files
committed
Cleanup ruff per file ignores
1 parent 4e4f237 commit e8dc48c

File tree

3 files changed

+8
-18
lines changed

3 files changed

+8
-18
lines changed

pyproject.toml

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -144,27 +144,21 @@ lines-after-imports = 2
144144
# TODO: Get rid of these:
145145
"**/__init__.py" = ["F401", "E402", "F403"]
146146
"pytensor/tensor/linalg.py" = ["F403"]
147+
# Modules that use print-statements, skip "T201"
147148
"pytensor/link/c/cmodule.py" = ["PTH", "T201"]
148149
"pytensor/misc/elemwise_time_test.py" = ["T201"]
149150
"pytensor/misc/elemwise_openmp_speedup.py" = ["T201"]
150151
"pytensor/misc/check_duplicate_key.py" = ["T201"]
151152
"pytensor/misc/check_blas.py" = ["T201"]
152153
"pytensor/bin/pytensor_cache.py" = ["T201"]
153-
# For the tests we skip `E402` because `pytest.importorskip` is used:
154-
"tests/link/jax/test_scalar.py" = ["E402"]
155-
"tests/link/jax/test_tensor_basic.py" = ["E402"]
156-
"tests/link/numba/test_basic.py" = ["E402"]
157-
"tests/link/numba/test_cython_support.py" = ["E402"]
158-
"tests/link/numba/test_performance.py" = ["E402"]
159-
"tests/link/numba/test_sparse.py" = ["E402"]
160-
"tests/link/numba/test_tensor_basic.py" = ["E402"]
161-
"tests/tensor/test_math_scipy.py" = ["E402"]
162-
"tests/sparse/test_basic.py" = ["E402"]
163-
"tests/sparse/test_sp2.py" = ["E402"]
164-
"tests/sparse/test_utils.py" = ["E402"]
165-
"tests/sparse/sandbox/test_sp.py" = ["E402", "F401"]
166154
"tests/compile/test_monitormode.py" = ["T201"]
167155
"scripts/run_mypy.py" = ["T201"]
156+
# Test modules of optional backends that use `pytest.importorskip`, skip "E402"
157+
"tests/link/jax/**/test_*.py" = ["E402"]
158+
"tests/link/numba/**/test_*.py" = ["E402"]
159+
"tests/link/pytorch/**/test_*.py" = ["E402"]
160+
"tests/link/mlx/**/test_*.py" = ["E402"]
161+
168162

169163

170164
[tool.mypy]

tests/link/jax/test_random.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
jax = pytest.importorskip("jax")
2424

2525

26-
from pytensor.link.jax.dispatch.random import numpyro_available # noqa: E402
26+
from pytensor.link.jax.dispatch.random import numpyro_available
2727

2828

2929
def compile_random_function(*args, mode=jax_mode, **kwargs):

tests/sparse/test_utils.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
11
import numpy as np
2-
import pytest
3-
4-
5-
sp = pytest.importorskip("scipy", minversion="0.7.0")
62

73
from pytensor.sparse.utils import hash_from_sparse
84
from tests.sparse.test_basic import as_sparse_format

0 commit comments

Comments
 (0)