The Wayback Machine - https://web.archive.org/web/20250610203017/https://github.com/matplotlib/matplotlib/pull/25360
Skip to content

pass deprecation warning thrown using PySide6 #25360

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

Closed
wants to merge 1 commit into from
Closed

pass deprecation warning thrown using PySide6 #25360

wants to merge 1 commit into from

Conversation

kvnp
Copy link

@kvnp kvnp commented Mar 1, 2023

PR Summary

Using matplotlib 3.7.0 with PySide 6.4.2 on Python 3.10.5 does not work. Instantiating FigureCanvasQTAgg raises DeprecationWarning and stops the application. Catching it fixes it.

I used the following example: https://matplotlib.org/stable/gallery/user_interfaces/embedding_in_qt_sgskip.html

PR Checklist

Documentation and Tests

  • Has pytest style unit tests (and pytest passes)
  • Documentation is sphinx and numpydoc compliant (the docs should build without error).
  • New plotting related features are documented with examples.

Release Notes

  • New features are marked with a .. versionadded:: directive in the docstring and documented in doc/users/next_whats_new/
  • API changes are marked with a .. versionchanged:: directive in the docstring and documented in doc/api/next_api_changes/
  • Release notes conform with instructions in next_whats_new/README.rst or next_api_changes/README.rst

Instantiating FigureCanvasQTAgg raises DeprecationWarning and stops the application. Catching it fixes it.
Example used: https://matplotlib.org/stable/gallery/user_interfaces/embedding_in_qt_sgskip.html
Python 3.10.5
Matplotlib 3.7.0
PySide 6.4.2
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Thank you for opening your first PR into Matplotlib!

If you have not heard from us in a while, please feel free to ping @matplotlib/developers or anyone who has commented on the PR. Most of our reviewers are volunteers and sometimes things fall through the cracks.

You can also join us on gitter for real-time discussion.

For details on testing, writing docs, and our review process, please see the developer guide

We strive to be a welcoming and open project. Please follow our Code of Conduct.

@jklymak
Copy link
Member

jklymak commented Mar 1, 2023

Do you understand why a deprecation warning would raise an error here? Warnings don't usually kill the process...

@tacaswell
Copy link
Member

I can not reproduce this failure, however it raising a warning as an exception is ... surprising but it would not be the most surprising thing pyside does.

Can you sort out which pyside6 attribute / method is causing this?


The docs failure is unrelated.

@QuLogic
Copy link
Member

QuLogic commented Mar 2, 2023

A warning is just a exception that the interpreter catches, prints out and returns to the caller (by default.) Are you running with -Werror?

@jklymak
Copy link
Member

jklymak commented Mar 8, 2023

@kvnp can you clarify the need for this?

@jklymak jklymak added the status: needs clarification Issues that need more information to resolve. label Mar 8, 2023
@kvnp
Copy link
Author

kvnp commented Mar 13, 2023

A warning is just a exception that the interpreter catches, prints out and returns to the caller (by default.) Are you running with -Werror?

Thanks! That's what I was doing. I'm integrating matplotlib into an existing project and didn't pay attention to the launch configuration.

Removing it fixes it, but wouldn't it be meaningful to catch the warning, since setting that attribute is expected not to work? How does PyQt handle this? Is it throwing an AttributeError instead?

@QuLogic
Copy link
Member

QuLogic commented Mar 13, 2023

Removing it fixes it, but wouldn't it be meaningful to catch the warning, since setting that attribute is expected not to work? How does PyQt handle this? Is it throwing an AttributeError instead?

Catch what warning? Setting what attribute? How does PyQt handle what? You still haven't provided any context and no-one else can reproduce.

@kvnp
Copy link
Author

kvnp commented Mar 13, 2023

Catch what warning? Setting what attribute? How does PyQt handle what? You still haven't provided any context and no-one else can reproduce.

How much more context do you need? It's all in the comments as well as in the diff of this PR. I ran the example with -Werror. It's part of the launch configuration of the project I'm working on.

I discovered that it's possible to ignore certain warnings, I'm going to stick with that.

@kvnp kvnp closed this Mar 13, 2023
@tacaswell
Copy link
Member

What is the deprecation that was triggering this?

We should definitely fix the warning, but catching the deprecation error is not the right fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: needs clarification Issues that need more information to resolve.
Projects
Development

Successfully merging this pull request may close these issues.

4 participants