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 Mypy from 1.3.x to 1.8.x #1464

Merged
merged 8 commits into from
Feb 8, 2024
Merged

Conversation

neiljp
Copy link
Collaborator

@neiljp neiljp commented Jan 26, 2024

What does this PR do, and why?

This results in a more featureful, fast and less buggy version of mypy - it certainly appears to be faster so far.

This PR upgrades mostly by individual minor versions, to incorporate minor fixes found to be necessary for each upgrade.

This also refactors the lint-and-test workflow to use a common python version for linting explicitly, which is then easily bumped to 3.8 for mypy 1.5.x.

The initial commit is a CI bugfix to enable the test minimal-dependencies for mypy, added in #1461.

Outstanding aspect(s)

  • Followup work to use new features, or remove workarounds
  • Ensure this works well for contributors

External discussion & connections

  • Discussed in #zulip-terminal in topic
  • Fully fixes #
  • Partially fixes issue #
  • Builds upon previous unmerged work in PR #
  • Is a follow-up to work in PR #
  • Requires merge of PR #
  • Merge will enable work on #

How did you test this?

  • Manually - Behavioral changes
  • Manually - Visual changes
  • Adapting existing automated tests
  • Adding automated tests for new behavior (or missing tests)
  • Existing automated tests should already cover this (only a refactor of tested code)

Self-review checklist for each commit

  • It is a minimal coherent idea
  • It has a commit summary following the documented style (title & body)
  • It has a commit summary describing the motivation and reasoning for the change
  • It individually passes linting and tests
  • It contains test additions for any new behavior
  • It flows clearly from a previous branch commit, and/or prepares for the next commit

@neiljp neiljp added the area: infrastructure Project infrastructure label Jan 26, 2024
@zulipbot zulipbot added the size: S [Automatic label added by zulipbot] label Jan 26, 2024
@neiljp neiljp force-pushed the 2024-01-25-mypy-upgrade branch 3 times, most recently from 16c0eac to f19a2cc Compare January 26, 2024 03:50
@neiljp neiljp force-pushed the 2024-01-25-mypy-upgrade branch from 9f94611 to 6e6f035 Compare February 7, 2024 01:03
@zulipbot zulipbot added size: M [Automatic label added by zulipbot] and removed size: S [Automatic label added by zulipbot] labels Feb 7, 2024
@neiljp neiljp force-pushed the 2024-01-25-mypy-upgrade branch 6 times, most recently from 61f1d50 to 4a963c2 Compare February 8, 2024 00:16
@neiljp neiljp changed the title WIP mypy upgrade Upgrade Mypy from 1.3.x to 1.8.x Feb 8, 2024
This appeared to work previously when used in CI, but installation
gives a WARNING regarding not finding the extra.
Python 3.7 is now end of life. Core libraries will increasingly drop
support, but we can certainly push development requirements more
rapidly, and newer mypy already requires 3.8.
The strict-concatenate option is now deprecated, so replaced by
extra-checks, in pyproject.toml.
This requires an update of a type ignore in convert-unicode-emoji-data,
which is necessary due to the imported file being conditionally present.

CI and local Python 3.9 require different type ignore specifiers, so
this also adds 'unused-ignore', to avoid errors when the other type
ignore is apparently not used on the other platform.
@neiljp neiljp force-pushed the 2024-01-25-mypy-upgrade branch from 4a963c2 to 7e90e08 Compare February 8, 2024 00:57
@neiljp neiljp added the PR ready to be merged PR has been reviewed & is ready to be merged label Feb 8, 2024
@neiljp neiljp added this to the Next Release milestone Feb 8, 2024
@neiljp neiljp merged commit da84485 into zulip:main Feb 8, 2024
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: infrastructure Project infrastructure PR ready to be merged PR has been reviewed & is ready to be merged size: M [Automatic label added by zulipbot]
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants