Skip to content

Fix two static type errors reported by mypy 2.0.0#4626

Merged
seisman merged 1 commit intomainfrom
mypy/2.0
May 7, 2026
Merged

Fix two static type errors reported by mypy 2.0.0#4626
seisman merged 1 commit intomainfrom
mypy/2.0

Conversation

@seisman
Copy link
Copy Markdown
Member

@seisman seisman commented May 7, 2026

The new mypy v2.0.0 reports two new errors:

mypy pygmt
pygmt/clib/session.py:113: error: Need type annotation for "GMT_CONSTANTS" (hint: "GMT_CONSTANTS: dict[<type>, <type>] = ...")  [var-annotated]
pygmt/figure.py:96: error: Need type annotation for "SHOWED_FIGURES" (hint: "SHOWED_FIGURES: list[<type>] = ...")  [var-annotated]
Found 2 errors in 2 files (checked 128 source files)
make: *** [Makefile:74: typecheck] Error 1

xref: https://github.com/GenericMappingTools/pygmt/actions/runs/25474333778/job/74744492600

@seisman seisman added maintenance Boring but important stuff for the core devs skip-changelog Skip adding Pull Request to changelog final review call This PR requires final review and approval from a second reviewer labels May 7, 2026
@seisman seisman added this to the 0.19.0 milestone May 7, 2026
Copy link
Copy Markdown
Member

@weiji14 weiji14 left a comment

Choose a reason for hiding this comment

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

Was gonna recommend using parallel type checking, but then remembered this runs on ubuntu-slim with just 1 CPU 😆

@seisman seisman merged commit 9b3488e into main May 7, 2026
25 of 28 checks passed
@seisman seisman deleted the mypy/2.0 branch May 7, 2026 10:18
@seisman seisman removed the final review call This PR requires final review and approval from a second reviewer label May 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintenance Boring but important stuff for the core devs skip-changelog Skip adding Pull Request to changelog

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants