Clean up mypy & ruff config#30258
Merged
timhoffm merged 4 commits intomatplotlib:mainfrom Jul 5, 2025
Merged
Conversation
jkseppan
approved these changes
Jul 4, 2025
jkseppan
reviewed
Jul 4, 2025
| HourLocator, MicrosecondLocator, MinuteLocator, | ||
| MonthLocator, RRuleLocator, SecondLocator, | ||
| WeekdayLocator, YearLocator, rrulewrapper) | ||
| from matplotlib.dates import DateFormatter |
Member
There was a problem hiding this comment.
It seems that while these aren't referenced in the code directly, they are referenced from strings that get evaled:
Traceback (most recent call last):
File "/home/circleci/project/galleries/examples/ticks/date_formatters_locators.py", line 58, in <module>
plot_axis(ax, locator, xmax, fmt)
File "/home/circleci/project/galleries/examples/ticks/date_formatters_locators.py", line 27, in plot_axis
ax.xaxis.set_major_locator(eval(locator))
^^^^^^^^^^^^^
File "<string>", line 1, in <module>
NameError: name 'AutoDateLocator' is not defined
Member
Author
There was a problem hiding this comment.
Indeed, I'll add a comment to make that more obvious.
Member
Author
There was a problem hiding this comment.
Sigh, isort wants to remove the noqa, while ruff/flake8 wants it. I'll just restore the exception then.
ruff uses `project.requires-python`, so the ruff-only `target-version` is not needed. Other exceptions can be dropped since they are all clear of warnings.
The removed excludes are covered by the first line. The Unpack feature was enabled by default in 1.9, which is our minimum.
cf7c0d5 to
77deb26
Compare
These examples only needed a single fix to remove the exception.
timhoffm
approved these changes
Jul 5, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR summary
Drop outdated options, and exceptions that are no longer needed because the files were fixed. Also, fix a few simpler cases so that more exceptions can be dropped.
PR checklist