lint: enable mypy import checking #23212

pull fanquake wants to merge 4 commits into bitcoin:master from fanquake:22844_fixedup changing 8 files +16 −12
  1. fanquake commented at 6:22 AM on October 7, 2021: member

    This is #22844 with issues addressed, and two additional commits. One to move to the latest mypy version in the CI, and another to remove what is just pointless duplication from the test README. There's no need to relist package versions and install instructions (meaning 2x the work when changing anything), when you can just link to 04_install.sh which has the versions used and pip invocations to install them.

  2. fanquake added the label Scripts and tools on Oct 7, 2021
  3. fanquake cross-referenced this on Oct 7, 2021 from issue feature: enable mypy to run without --ignore-imports by josibake
  4. fanquake force-pushed on Oct 7, 2021
  5. practicalswift commented at 7:41 AM on October 7, 2021: contributor

    Concept ACK

    The more high quality automated review we can get prior to manual review the better.

  6. fanquake force-pushed on Oct 7, 2021
  7. DrahtBot commented at 5:48 PM on October 7, 2021: contributor

    <!--e57a25ab6845829454e8d69fc972939a-->

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    <!--174a7506f384e20aa4161008e828411d-->

    Conflicts

    No conflicts as of last run.

  8. DrahtBot cross-referenced this on Oct 7, 2021 from issue build: Fix guix linker-loader path and add check_ELF_interpreter by dongcarl
  9. DrahtBot cross-referenced this on Oct 11, 2021 from issue scripts: use LIEF for ELF security & symbol checks by fanquake
  10. DrahtBot added the label Needs rebase on Oct 13, 2021
  11. fanquake force-pushed on Oct 14, 2021
  12. DrahtBot removed the label Needs rebase on Oct 14, 2021
  13. laanwj commented at 12:36 PM on October 15, 2021: member

    Python lints are failing:

    test/functional/test_runner.py:43: error: Module has no attribute "getwindowsversion"  [attr-defined]
    Found 1 error in 1 file (checked 216 source files)
    ^---- failure generated from test/lint/lint-python.sh
    
  14. promag commented at 10:33 PM on October 15, 2021: member

    Tested ACK after

    diff --git a/test/functional/test_runner.py b/test/functional/test_runner.py
    index c5f08b27f2..d6f61bfbff 100755
    --- a/test/functional/test_runner.py
    +++ b/test/functional/test_runner.py
    @@ -40,7 +40,7 @@ except UnicodeDecodeError:
         CROSS = "x "
         CIRCLE = "o "
    
    -if os.name != 'nt' or sys.getwindowsversion() >= (10, 0, 14393):
    +if os.name != 'nt' or sys.getwindowsversion() >= (10, 0, 14393): #type:ignore
         if os.name == 'nt':
             import ctypes
             kernel32 = ctypes.windll.kernel32  # type: ignore
    

    because getwindowsversion is only available in Windows.

  15. doc: remove pointlessly duplicated linter version / install info b93e2299da
  16. lint: install pyzmq (22.3.0) into linter environment
    mypy stubs were introduced in 21.0.1
    6ae9c2ef23
  17. lint mypy 0.910 22e652662b
  18. lint: enable mypy checking for missing imports
    Achieve this by adding some ignore, and making data/ importable.
    
    Co-authored-by: João Barbosa <joao.paulo.barbosa@gmail.com>
    a46f71bb70
  19. fanquake force-pushed on Oct 16, 2021
  20. fanquake commented at 1:15 AM on October 16, 2021: member

    Tested ACK after

    Thanks for the review @promag. Taken the suggestion.

  21. promag commented at 8:10 AM on October 16, 2021: member

    ACK

  22. practicalswift commented at 9:47 AM on October 16, 2021: contributor

    cr ACK a46f71bb703dd8ada77e5eaf2a0b05d741d39bbf

  23. MarcoFalke merged this on Oct 17, 2021
  24. MarcoFalke closed this on Oct 17, 2021

  25. fanquake deleted the branch on Oct 17, 2021
  26. sidhujag referenced this in commit dde8b9a002 on Oct 17, 2021
  27. bitcoin locked this on Oct 30, 2022

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-05-20 06:53 UTC