X Tutup
Skip to content

ENH: improve PySide2 loading#7252

Merged
tacaswell merged 3 commits intomatplotlib:masterfrom
jrversteegh:master
Oct 12, 2016
Merged

ENH: improve PySide2 loading#7252
tacaswell merged 3 commits intomatplotlib:masterfrom
jrversteegh:master

Conversation

@jrversteegh
Copy link
Copy Markdown
Contributor

Don't require explicit QT_API setting for PySide2 in qt_compat.py

Don't require explicit QT_API setting for PySide2 in qt_compat.py
@tacaswell tacaswell added this to the 2.1 (next point release) milestone Oct 11, 2016
@tacaswell tacaswell changed the title ENH: improve PySide2 loading [MRG+1] ENH: improve PySide2 loading Oct 11, 2016
if 'PySide2' in sys.modules:
# user has imported PySide before importing mpl
QT_API = QT_API_PYSIDE2

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why don't we use if elif checks instead of consecutive if statements?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

These things are going to be mutually exclusive due to restrictions from the libraries.

This could be cleaned up, but I think is out of scope of this PR.

@NelleV
Copy link
Copy Markdown
Member

NelleV commented Oct 11, 2016

There is also a pep8 failure.

raise RuntimeError(
('Unrecognized environment variable %r, valid values are:'
' %r, %r or %r' % (QT_API_ENV, 'pyqt', 'pyside', 'pyqt5')))
' %r, %r or %r' % (QT_API_ENV, 'pyqt', 'pyside', 'pyqt5', 'pyside2')))
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

this line needs to be wrapped.

Copy link
Copy Markdown
Contributor Author

@jrversteegh jrversteegh Oct 11, 2016

Choose a reason for hiding this comment

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

I also didn't adjust the number of argument placeholders. I fixed both issues.

@NelleV NelleV changed the title [MRG+1] ENH: improve PySide2 loading [MRG+2] ENH: improve PySide2 loading Oct 11, 2016
@NelleV
Copy link
Copy Markdown
Member

NelleV commented Oct 11, 2016

Apart from the pep8 comment, this looks good.

Fixed number of arguments and pep 8 issue
@NelleV
Copy link
Copy Markdown
Member

NelleV commented Oct 11, 2016

There is still a pep8 issue: there is a trailing whitespace l:72

You can easily test pep8 compliance by installing the pep8 tool and configure your text editor to show this to you inline. (We are currently working on our contribution guidelines to reflect this).

removed trailing white space
@jrversteegh
Copy link
Copy Markdown
Contributor Author

thanks for the feedback. installed pep8 and should be fixed now.

@tacaswell
Copy link
Copy Markdown
Member

Thanks for putting up with our style checking. It really does help keep the code base consistent

@tacaswell tacaswell merged commit de376dd into matplotlib:master Oct 12, 2016
@tacaswell
Copy link
Copy Markdown
Member

The failures are all unrelated.

@tacaswell
Copy link
Copy Markdown
Member

@jrversteegh Thanks!

@QuLogic QuLogic changed the title [MRG+2] ENH: improve PySide2 loading ENH: improve PySide2 loading Dec 7, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants

X Tutup