### Description The PR https://github.com/pymc-devs/pytensor/pull/1598 was reverted in #1704 (commit https://github.com/pymc-devs/pytensor/commit/2b2a7a548a4af1c05ab810da598d8b12f79ebcfe) because it broke run_mypy output when there are errors. It should be re-added. CC @jorenham