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

deal with upcoming deprecations in CPython #25912

Closed
tacaswell opened this issue May 18, 2023 · 4 comments · Fixed by #25918
Closed

deal with upcoming deprecations in CPython #25912

tacaswell opened this issue May 18, 2023 · 4 comments · Fixed by #25918
Labels
Difficulty: Medium https://matplotlib.org/devdocs/devel/contribute.html#good-first-issues Good first issue Open a pull request against these issues if there are no active ones!
Milestone

Comments

@tacaswell
Copy link
Member

FAILED lib/matplotlib/tests/test_lines.py::test_set_line_coll_dash_image[svg] - matplotlib.testing.exceptions.ImageComparisonFailure: images not close (RMS 0.412):
FAILED lib/matplotlib/tests/test_backend_svg.py::test_url_tick - DeprecationWarning: datetime.utcfromtimestamp() is deprecated and scheduled for removal in a future version. Use timezone-aware objects to represent datetimes in UTC: datetime.now(datetime.UTC).
FAILED lib/matplotlib/tests/test_backend_svg.py::test_svg_default_metadata - DeprecationWarning: datetime.utcfromtimestamp() is deprecated and scheduled for removal in a future version. Use timezone-aware objects to represent datetimes in UTC: datetime.now(datetime.UTC).
FAILED lib/matplotlib/tests/test_backend_svg.py::test_svg_clear_default_metadata - DeprecationWarning: datetime.utcfromtimestamp() is deprecated and scheduled for removal in a future version. Use timezone-aware objects to represent datetimes in UTC: datetime.now(datetime.UTC).

which was changed by python/cpython#103858

We appear to use this a couple of places in Matplotlib https://github.com/search?q=repo%3Amatplotlib%2Fmatplotlib%20utcfromtimestamp&type=code all of which need to be changed to not-deprecated methods of achieving the same thing.

I am labeling this as "good first issue" because there is no API design and there should be no behavior changes (other than not getting warnings) but "medium" difficulty as datetime and timezones are involved.

@tacaswell tacaswell added Difficulty: Medium https://matplotlib.org/devdocs/devel/contribute.html#good-first-issues Good first issue Open a pull request against these issues if there are no active ones! labels May 18, 2023
@tacaswell tacaswell added this to the v3.7.2 milestone May 18, 2023
@smeet07
Copy link
Contributor

smeet07 commented May 18, 2023

I'll open a pr , do I need to assign this issue or can I directly start working on the pr?

@QuLogic
Copy link
Member

QuLogic commented May 19, 2023

No, we do not assign issues. If there is no open PR linked here, you can just start working on it.

@ksunden
Copy link
Member

ksunden commented May 19, 2023

Do we have any sense of what is causing the image test failure? seems odd that that would be caused by the deprecation warning, but haven't looked into it at all.

@tacaswell
Copy link
Member Author

oh, I think I copied one too many lines, only meant to grab the deprecation warning lines here. I am seeing ~50 failures on my very unstable (default branch of almost everything) environment.

@QuLogic QuLogic changed the title deal with upcoming depractions in CPython deal with upcoming deprecations in CPython May 19, 2023
devRD pushed a commit to devRD/matplotlib that referenced this issue Jun 5, 2023
melissawm pushed a commit to melissawm/matplotlib that referenced this issue Jun 15, 2023
QuLogic pushed a commit to fedora-python/matplotlib that referenced this issue Jun 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Difficulty: Medium https://matplotlib.org/devdocs/devel/contribute.html#good-first-issues Good first issue Open a pull request against these issues if there are no active ones!
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants