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.
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-
jonatack commented at 10:20 PM on June 29, 2023: contributor
-
f86a301433
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
-
92408224a4
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
-
script: update linter dependencies 146c861da2
-
script: update ignored-words.txt 1316119ce7
-
script: appease spelling linter 6c97757a48
-
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.
-
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 - jonatack marked this as ready for review on Jun 30, 2023
- fanquake approved
-
fanquake commented at 3:19 PM on June 30, 2023: member
ACK 6c97757a480b6e71a0750330d69ff18ac7cc6127
- fanquake merged this on Jun 30, 2023
- fanquake closed this on Jun 30, 2023
- sidhujag referenced this in commit ec4f7adc10 on Jun 30, 2023
- jonatack deleted the branch on Jun 30, 2023
- bitcoin locked this on Jun 29, 2024