|
20 | 20 |
|
21 | 21 |
|
22 | 22 | DP_ROOT = pathlib.Path(__file__).absolute().parent.parent
|
23 |
| -FAILING = """ |
24 |
| -pytensor/compile/builders.py |
25 |
| -pytensor/compile/compilelock.py |
26 |
| -pytensor/compile/debugmode.py |
27 |
| -pytensor/compile/function/pfunc.py |
28 |
| -pytensor/compile/function/types.py |
29 |
| -pytensor/compile/mode.py |
30 |
| -pytensor/compile/sharedvalue.py |
31 |
| -pytensor/graph/rewriting/basic.py |
32 |
| -pytensor/ifelse.py |
33 |
| -pytensor/link/basic.py |
34 |
| -pytensor/link/numba/dispatch/elemwise.py |
35 |
| -pytensor/link/numba/dispatch/random.py |
36 |
| -pytensor/link/numba/dispatch/scan.py |
37 |
| -pytensor/printing.py |
38 |
| -pytensor/raise_op.py |
39 |
| -pytensor/sandbox/rng_mrg.py |
40 |
| -pytensor/scalar/basic.py |
41 |
| -pytensor/sparse/basic.py |
42 |
| -pytensor/sparse/type.py |
43 |
| -pytensor/tensor/basic.py |
44 |
| -pytensor/tensor/blas.py |
45 |
| -pytensor/tensor/blas_c.py |
46 |
| -pytensor/tensor/blas_headers.py |
47 |
| -pytensor/tensor/elemwise.py |
48 |
| -pytensor/tensor/extra_ops.py |
49 |
| -pytensor/tensor/math.py |
50 |
| -pytensor/tensor/nnet/abstract_conv.py |
51 |
| -pytensor/tensor/nnet/ctc.py |
52 |
| -pytensor/tensor/nnet/neighbours.py |
53 |
| -pytensor/tensor/random/basic.py |
54 |
| -pytensor/tensor/random/op.py |
55 |
| -pytensor/tensor/random/utils.py |
56 |
| -pytensor/tensor/rewriting/basic.py |
57 |
| -pytensor/tensor/rewriting/elemwise.py |
58 |
| -pytensor/tensor/shape.py |
59 |
| -pytensor/tensor/slinalg.py |
60 |
| -pytensor/tensor/subtensor.py |
61 |
| -pytensor/tensor/type.py |
62 |
| -pytensor/tensor/type_other.py |
63 |
| -pytensor/tensor/var.py |
64 |
| -""" |
| 23 | +FAILING = [ |
| 24 | + line.strip() |
| 25 | + for line in (DP_ROOT / "scripts" / "mypy-failing.txt").read_text().splitlines() |
| 26 | + if line.strip() |
| 27 | +] |
65 | 28 |
|
66 | 29 |
|
67 | 30 | def enforce_pep561(module_name):
|
@@ -130,7 +93,7 @@ def check_no_unexpected_results(mypy_lines: Iterator[str]):
|
130 | 93 | + "\n".join(sorted(map(str, failing - all_files)))
|
131 | 94 | )
|
132 | 95 | passing = all_files - failing
|
133 |
| - expected_failing = set(FAILING.strip().split("\n")) - {""} |
| 96 | + expected_failing = set(FAILING) |
134 | 97 | unexpected_failing = failing - expected_failing
|
135 | 98 | unexpected_passing = passing.intersection(expected_failing)
|
136 | 99 |
|
@@ -177,7 +140,14 @@ def check_no_unexpected_results(mypy_lines: Iterator[str]):
|
177 | 140 | help="How to group verbose output. One of {file|errorcode|message}.",
|
178 | 141 | )
|
179 | 142 | args, _ = parser.parse_known_args()
|
180 |
| - |
| 143 | + missing = list() |
| 144 | + for path in FAILING: |
| 145 | + if not os.path.exists(path): |
| 146 | + missing.append(path) |
| 147 | + if missing: |
| 148 | + print("These files are missing but still kept in FAILING") |
| 149 | + print("\n".join(missing)) |
| 150 | + sys.exit(1) |
181 | 151 | cp = subprocess.run(
|
182 | 152 | ["mypy", "--show-error-codes", "pytensor"],
|
183 | 153 | capture_output=True,
|
|
0 commit comments