-
Notifications
You must be signed in to change notification settings - Fork 14.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Run mypy checks for full packages in CI (#36638)
MyPy as used in our static checks has slightly different heuristics when running on on individual files and whole packages. This sometimes causes semi-random failures when different set of files is produced when pre-commits split the files between parallel processes. The regular `mypy-*` pre-commits work by passing filenames to mypy checks, and when `--all-files` flag is passed to mypy, this means that 2700 files are passed. In this case pre-commit will split such long list of files to several sequential muypy executions. This is not very good because depending on the list of files passed, mypy can split the list diferently and results will be different when just list of files changes - so mypy might start detecting problems that were not present before. This PR introduces new `mypy` check that runs mypy for packages rather than individual files. We cannot run them for local pre-commit runs, because in many cases, such package based mypy check will run for minutes when a single file changes, due to cache invalidation rules - and we do not want to penalise commits that are changing common airflow code (because such PRs would invalidate a lot of mypy cache every time such common file changes). So we still want to run file-based mypy for local commits. But we do not want to pass 2700 files in CI, rather than that on CI we want to run mypy checks "per package". This PR introduces a new "manual" stage mypy pre-commit check that will run "package" based mypy checks and adds selective check rules that will decide properly when to run such tests and separate, matrix-based CI job that will run such mypy checks - separately for each of the packages: "airflow", "providers", "docs", "dev". Also this job will skip providers checks in non-main branch and will run all tests when "full tests needed" are requested. This PR ignores some errors resulted from 3rd-party libraries used that are randomply appearing when some files are modified (and fixes the current main failures)
- Loading branch information
Showing
30 changed files
with
443 additions
and
130 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.