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

Upgrade to mypy 1.0.0 after incompatible typeshed change #1298

Merged
merged 2 commits into from
Feb 16, 2023

Conversation

neiljp
Copy link
Collaborator

@neiljp neiljp commented Feb 16, 2023

What does this PR do?

Bumps mypy version to 1.0.0 and makes minor changes to remove some type ignores, one of which caused a linting error.

The commits are structured to bump mypy first, since it seems that lots of type stubs became incompatible with mypy < 1.0 in python/typeshed#9702, which I assume translated into an incompatible types-requests. This translates into 2 Self?-related errors in ZT, maybe more elsewhere.

The second commit then makes some minor adjustments to take into account the mypy bump. These are only typing changes (or ignore-comments) so should not substantively affect the code running, though arguably they do fix the previous commit. I'm keeping them separate for clarity.

Tested?

  • Manually
  • Existing tests (adapted, if necessary)
  • New tests added (for any new behavior)
  • Passed linting & tests (each commit)

This is necessary since fresh environment builds (including CI) appear to pull
a version of types-requests that is broken with mypy < 1.0, types-requests
being the broken-out 3rd-party package of stubs for requests, but that is still
maintained in typeshed.

This appears to be python/typeshed#9702.

The mypy version is updated to ~=1.0.0 versioning now that it has moved to a
major/minor/point versioning scheme.
@neiljp neiljp added PR blocks other PR PR ready to be merged PR has been reviewed & is ready to be merged area: infrastructure Project infrastructure labels Feb 16, 2023
One of these are required by the upgrade of mypy to version 1.0.0, which flags
an unnecessary type-ignore as an error.

The other case is a second type-ignore that can be removed via explicitly
typing.
@zulipbot zulipbot added the size: S [Automatic label added by zulipbot] label Feb 16, 2023
@neiljp neiljp added this to the Next Release milestone Feb 16, 2023
@neiljp neiljp merged commit 4d1fb3d into zulip:main Feb 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: infrastructure Project infrastructure PR blocks other PR PR ready to be merged PR has been reviewed & is ready to be merged size: S [Automatic label added by zulipbot]
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants