-
-
Notifications
You must be signed in to change notification settings - Fork 69
Configure Qt API using config file #130
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
Conversation
Oh wow, crazy stuff! 😆 👍 What do you think about setting a flag when As for testing, I guess you could set up an environment with multiple Qt libraries installed so pytest-qt would pick the wrong one, then run in a subprocess (to make sure nothing is imported) with the config option, and e.g. look at the version output (or simply run a test in the subprocess) to make sure the right Qt API was picked? |
That does not seem necessary: all imports will happen in the
Good idea, although I it will complicate the tox setup. But you gave me an idea: setting the ini variable to the wrong api should raise an appropriate [pytest]
qt_api=pyqt4 Will fail make pytest fail with an qt_compatThis change will break backward compatibility for the |
You're right! I thought using Though a test which makes sure importing before
Sounds good to me.
Agreed. Is there anything else which would go into a 2.0 release? What about delaying 2.0 until after the pytest sprint? Then we can discuss if there's anything else we'd like to change which would need an API break (for example, I'd like to discuss making I also thought about if we should use/contribute to one of the existing wrappers instead, like |
Sure, sounds good!
No discussion there! 😉 In fact it was supposed to change even before that, as stated in this note. But I agree that changing it into a 2.0 is better specially if it is not far away.
I also don't think it would be worth it: pytest-qt uses a very limited set of the Qt api that just our humble |
I also think it wouldn't be worth it. There are already many wrappers, nearly any project that wants to support pyside, pyqt4 and pyqt5 have their own wrappers, written for their own needs. |
2c63ffa
to
020b1b5
Compare
|
||
|
||
@pytest.mark.parametrize('option_api', ['pyqt4', 'pyqt4v2', 'pyqt5', 'pyside']) | ||
def test_qt_api_ini_config(testdir, option_api): |
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.
This is how I ended up testing the qt_api
variable in the end
1 similar comment
9547d19
to
a820282
Compare
@The-Compiler rebased and I think this is ready for review. Could you take a look when you have the time please? 😁 |
* Now which Qt binding ``pytest-qt`` should use can be configured by the ``qt_api`` config option. | ||
Thanks `@The-Compiler`_ for the request (`#129`_). | ||
|
||
- ``PYTEST_QT_FORCE_PYQT`` environment variable is no longer supported. |
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.
Shouldn't this be under "breaking changes"?
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.
Oops, bad merge, thanks!
heh, I guess that works too 😆 |
I really don't have a clue why those lines are reported as missing... 😭 |
Are they covered when you do something like I'll take another look tomorrow. |
@The-Compiler, I plan to merge this on the weekend after I figure out why coverage decreased. Just wanted to know if you will find the time to get |
Probably not, I'd expect to work on it in a few days to weeks - so let's release 2.0 without it and then do a 2.1 at some point 😉 |
Roger! 👍 |
Duh, I was looking at the wrong line. Will merge after #141 to apply the proper changes to that branch myself. |
@nicoddemus @The-Compiler: Thanks! The new option works great. I was the one who initially bugged @The-Compiler on IRC about this :) |
👍 |
Fix #129
The big work here was of course to implement lazy-loading of Qt classes from
qt_compat
.