From 8ac86f2ce559e323064b09a54267d35cf3c51ec6 Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Sat, 6 Nov 2021 13:58:15 +0100 Subject: [PATCH] mypy: Exclude only 20 files that are still failing (#5608) * DRAFT: Run a mypy reality check Let's see what is required to finish #4052 * mypy --ignore-missing-imports --install-types --non-interactive * Check our progress... * Update build.yml * Update build.yml * Update build.yml * Update build.yml * mypy --exclude 20 files * --exclude with no `=` * Update build.yml * 558 character regex!!! * With quotes * mypy.ini: mega exclude * Update mypy.ini * Update build.yml * Update mypy.ini * Update build.yml * Update mypy.ini * .py --> .p* * Escape the dots!: `.` --> `\.` * Remove the comment * Leading slash * Update mypy.ini Co-authored-by: Dylan Buchi Co-authored-by: Dylan Buchi --- .github/workflows/build.yml | 2 +- mypy.ini | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f710e1e0e..e5f8d6b39 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -21,7 +21,7 @@ jobs: run: | python -m pip install --upgrade pip setuptools six wheel python -m pip install mypy pytest-cov -r requirements.txt - - run: mypy --install-types --non-interactive . + - run: mypy . # See `mypy.ini` for configuration settings. - name: Run tests run: pytest --doctest-modules --ignore=project_euler/ --ignore=scripts/validate_solutions.py --cov-report=term-missing:skip-covered --cov=. . - if: ${{ success() }} diff --git a/mypy.ini b/mypy.ini index ba552f878..1a2282c44 100644 --- a/mypy.ini +++ b/mypy.ini @@ -1,5 +1,6 @@ [mypy] ignore_missing_imports = True +install_types = True +non_interactive = True +exclude = (data_structures/stacks/next_greater_element.py|graphs/boruvka.py|graphs/breadth_first_search.py|graphs/breadth_first_search_2.py|graphs/check_cycle.py|graphs/finding_bridges.py|graphs/greedy_min_vertex_cover.py|graphs/random_graph_generator.py|maths/average_mode.py|maths/gamma_recursive.py|maths/proth_number.py|maths/series/geometric_series.py|maths/series/p_series.py|matrix_operation.py|other/fischer_yates_shuffle.py|other/least_recently_used.py|other/lfu_cache.py|other/lru_cache.py|searches/simulated_annealing.py|searches/ternary_search.py) -; FIXME: #4052 fix mypy errors in the exclude directories and remove them below -exclude = (data_structures|graphs|maths|matrix|other|searches)/$