script, test: python typing and linter updates #28009

pull jonatack wants to merge 5 commits into bitcoin:master from jonatack:2023-06-python-script-test-linter-updates changing 10 files +18 −14
  1. jonatack commented at 10:20 PM on June 29, 2023: contributor

    With these updates, ./test/lint/lint-python.py and ./test/lint/lint-spelling.py should be green again for developers using relatively recent Python dependencies, in particular mypy 0.991 (released 11/2022) and later. Please see the commit messages for details.

  2. script, test: add missing python type annotations
    Fix warnings for these files when ./test/lint/lint-python.py is run using
    mypy 0.991 (released 11/2022) and later:
    
    "By default the bodies of untyped functions are not checked, consider using
    --check-untyped-defs [annotation-unchecked]"
    
    For details, see:
    
    https://mypy-lang.blogspot.com/2022/11/mypy-0990-released.html
    f86a301433
  3. test: fix PEP484 no implicit optional argument types errors
    Fix warnings for these files when ./test/lint/lint-python.py is run using
    mypy 0.991 (released 11/2022) and later:
    
    $ test/lint/lint-python.py
    test/functional/test_framework/coverage.py:23: error: Incompatible default for argument "coverage_logfile" (default has type "None", argument has type "str")  [assignment]
    test/functional/test_framework/coverage.py:23: note: PEP 484 prohibits implicit Optional. Accordingly, mypy has changed its default to no_implicit_optional=True
    test/functional/test_framework/util.py:318: error: Incompatible default for argument "timeout" (default has type "None", argument has type "int")  [assignment]
    test/functional/test_framework/util.py:318: note: PEP 484 prohibits implicit Optional. Accordingly, mypy has changed its default to no_implicit_optional=True
    test/functional/test_framework/util.py:318: error: Incompatible default for argument "coveragedir" (default has type "None", argument has type "str")  [assignment]
    test/functional/interface_rest.py:67: error: Incompatible default for argument "query_params" (default has type "None", argument has type "dict[str, Any]")  [assignment]
    test/functional/interface_rest.py:67: note: PEP 484 prohibits implicit Optional. Accordingly, mypy has changed its default to no_implicit_optional=True
    
    Verified using https://github.com/hauntsaninja/no_implicit_optional
    
    For details, see:
    
    https://mypy-lang.blogspot.com/2022/11/mypy-0990-released.html
    92408224a4
  4. script: update linter dependencies 146c861da2
  5. script: update ignored-words.txt 1316119ce7
  6. script: appease spelling linter 6c97757a48
  7. DrahtBot commented at 10:20 PM on June 29, 2023: contributor

    <!--e57a25ab6845829454e8d69fc972939a-->

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

    <!--021abf342d371248e50ceaed478a90ca-->

    Reviews

    See the guideline for information on the review process.

    Type Reviewers
    ACK fanquake

    If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.

  8. jonatack commented at 1:14 AM on June 30, 2023: contributor

    Ready for review; per lint ci https://cirrus-ci.com/task/4666772440219648 new dependency versions installed successfully and

    ++ test/lint/all-lint.py
    Success: no issues found in 268 source files
    
  9. jonatack marked this as ready for review on Jun 30, 2023
  10. fanquake approved
  11. fanquake commented at 3:19 PM on June 30, 2023: member

    ACK 6c97757a480b6e71a0750330d69ff18ac7cc6127

  12. fanquake merged this on Jun 30, 2023
  13. fanquake closed this on Jun 30, 2023

  14. sidhujag referenced this in commit ec4f7adc10 on Jun 30, 2023
  15. jonatack deleted the branch on Jun 30, 2023
  16. bitcoin locked this on Jun 29, 2024

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-04-14 21:13 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me