Skip to content

Updates for recent mypy #161

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

Merged
merged 6 commits into from
Nov 17, 2022
Merged

Updates for recent mypy #161

merged 6 commits into from
Nov 17, 2022

Conversation

PeterJCLaw
Copy link
Contributor

@PeterJCLaw PeterJCLaw commented Nov 15, 2022

This picks up a change to mypy's defaults to prefer explicit Optionals and python/typeshed#8542 meaning one of our type: ignores is no longer needed.

@PeterJCLaw
Copy link
Contributor Author

The Python 3.6 failure looks like it's due to recent mpy having dropped support for Python 3.6, meaning that we're getting an older version which doesn't have the typeshed fix.

Solutions include not type checking on 3.6, grabbing a custom typeshed on 3.6 (kinda complicated but possible) or just dropping support for 3.6.

@attwad
Copy link
Owner

attwad commented Nov 16, 2022

Let me update the supported versions, I'll add more recent ones and remove 3.6

@attwad
Copy link
Owner

attwad commented Nov 16, 2022

alright can you take the latest changes from master? 3.6 should be out and 3.10, 3.11 should be added now.

@PeterJCLaw PeterJCLaw force-pushed the update-mypy branch 2 times, most recently from bf614dd to ea920be Compare November 16, 2022 09:47
@PeterJCLaw
Copy link
Contributor Author

I've put up #163 to fix CI on Python 3.10 (currently interpreted as 3.1) and rebased this on top of that.
The failures remaining are:

  • collections.Iterable import
  • pygame not installing on 3.11

@PeterJCLaw
Copy link
Contributor Author

Hrm, this is complicated by what appears to be a pygame bug. I think we can work around that, but an alternative quicker solution to fix master may be to pin mypy to an older working version (0.971 should I think work).

@PeterJCLaw
Copy link
Contributor Author

@attwad sorry this has been a bit iterative; I thiiink that with #164 (on which this PR is based) and this PR together the CI should now be sorted. There's a small code change here to help mypy, but I hope not a controversial one.

@attwad attwad merged commit c032ca8 into attwad:master Nov 17, 2022
@attwad
Copy link
Owner

attwad commented Nov 17, 2022

Thank you for the perseverance :)

@PeterJCLaw PeterJCLaw deleted the update-mypy branch November 17, 2022 18:22
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.

2 participants