Page MenuHomePhabricator

Bump minimum supported mypy version to 0.910
ClosedPublic

Authored by sdulfari on Apr 11 2023, 06:17.

Details

Reviewers
PiRK
Group Reviewers
Restricted Project
Commits
rABC74563ddb3f8e: Bump minimum supported mypy version to 0.910
Summary

D13649 Introduced --install-types (mypy 0.810) and --non-interactive (mypy 0.910) so lets bump the version.

Test Plan
arc lint test/functional/abc_rpc_isfinal

Works on Debian 11.
Installed successfully on Debian 10, but I'm getting some lint errors.
No version of mypy up to 1.2 appeared to solve the issue so it is unclear
if it is my environment or something else. If someone could test on
another Debian 10 box for sanity that would be nice.

Diff Detail

Repository
rABC Bitcoin ABC
Branch
bump-mypy
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 23188
Build 45995: Build Diff
Build 45994: arc lint + arc unit

Event Timeline

PiRK added a subscriber: PiRK.

Thanks. I didn't think of checking the support of the options with the currently installed version.

As we install the package with pip, the only limit to the minimum version is imposed by support of Python 3.6. The last version supporting 3.6 is 0.971 https://mypy-lang.blogspot.com/2022/07/mypy-0971-released.html

0.910 is fine too, I just checked that it does not cause any new errors. For future reference, I have previously tested v0.991 and v1.2.0, and Fabien tested v1.1.0, all seem to have identical results for this codebase.

Can you share some of the errors you see on Debian 10? Python 3.7 is supposed to be fully supported by all of the considered versions of mypy.

This revision is now accepted and ready to land.Apr 11 2023, 07:05

I tried 0.991, 1.1.1, and 1.2.0 also. All mypy versions above 0.910 give me this on Debian 10:

$ arc lint abc_rpc_isfinal.py
 Exception 
Some linters failed:
    - CommandException: Command failed with error #1!
      COMMAND
      mypy --show-error-codes --ignore-missing-imports --install-types --non-interactive /home/dev/bitcoin-abc/test/functional/abc_rpc_isfinal.py

      STDOUT
      Found 5 errors in 1 file (checked 1 source file)


      STDERR
      test/functional/test_framework/util.py:20: error: Module "typing" has no attribute "Literal"  [attr-defined]
      test/functional/test_framework/util.py:306: error: Variable "test_framework.util.PortName" is not valid as a type  [valid-type]
      test/functional/test_framework/util.py:306: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
      test/functional/test_framework/util.py:314: error: Variable "test_framework.util.PortName" is not valid as a type  [valid-type]
      test/functional/test_framework/util.py:314: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
      test/functional/test_framework/util.py:352: error: Variable "test_framework.util.PortName" is not valid as a type  [valid-type]
      test/functional/test_framework/util.py:352: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
      test/functional/test_framework/util.py:377: error: Variable "test_framework.util.PortName" is no... (169 more byte(s)) ...
(Run with `--trace` for a full exception trace.)