Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configure mypy skip following imports for some dependencies to workaround bugs #565

Merged
merged 3 commits into from
Jan 10, 2025

Conversation

alchzh
Copy link
Collaborator

@alchzh alchzh commented Jan 7, 2025

Authored by @Jepson2k

Workaround for issues such as python/mypy#13499
in the version of mypy version we're currently using which are causing
spurious type checking failures.

These workarounds should be removed when we bump the mypy version to
one without these bugs.

One sentence summary of this PR (This should go in the CHANGELOG!)
Configure mypy skip following imports for some dependencies to workaround bugs.

Link to Related Issue(s)
#550

Please describe the changes in your request.
Add follow_imports = skip to tempfile312, lief and numpy to workaround mypy bugs causing spurious type checking failures.

Anyone you think should look at this, specifically?

Jepson2k and others added 2 commits January 7, 2025 21:21
Workaround for issues such as  python/mypy#13499
in the version of mypy version we're currently using which are causing
spurious type checking failures.

These workarounds should be removed when we bump the mypy version to
one without these bugs.
@alchzh alchzh added this to the 3.3.0 Release milestone Jan 7, 2025
@alchzh alchzh requested a review from rbs-jacob January 7, 2025 21:27
@whyitfor
Copy link
Contributor

whyitfor commented Jan 7, 2025

Is this an issue with mypy==0.942? I'm trying to understand why this change is needed -- we don't seem to have failures in CI.

@rbs-jacob rbs-jacob requested review from whyitfor and removed request for rbs-jacob January 8, 2025 18:09
@alchzh
Copy link
Collaborator Author

alchzh commented Jan 8, 2025

the change is needed when mypy is installed with a python version >3.8, but because of the linked bug reports spurious failures in stub files

disassemblers/ofrak_angr/mypy.ini Outdated Show resolved Hide resolved
disassemblers/ofrak_angr/mypy.ini Outdated Show resolved Hide resolved
disassemblers/ofrak_angr/mypy.ini Outdated Show resolved Hide resolved
disassemblers/ofrak_angr/mypy.ini Outdated Show resolved Hide resolved
@alchzh
Copy link
Collaborator Author

alchzh commented Jan 9, 2025

The bug this workaround is needed for was fixed in mypy version 0.981. This change should be reverted after mypy to that version or later in the future. Tracked in #550

Copy link
Contributor

@whyitfor whyitfor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@whyitfor whyitfor merged commit ddc2ce1 into master Jan 10, 2025
4 checks passed
@whyitfor whyitfor deleted the maintenance/mypy-bug-workaround branch January 10, 2025 22:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants