-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Clean up mypy & ruff config #30258
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
Clean up mypy & ruff config #30258
Conversation
HourLocator, MicrosecondLocator, MinuteLocator, | ||
MonthLocator, RRuleLocator, SecondLocator, | ||
WeekdayLocator, YearLocator, rrulewrapper) | ||
from matplotlib.dates import DateFormatter |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed, I'll add a comment to make that more obvious.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
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