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

remove conditionals on python version #635

Merged
merged 4 commits into from
Jul 30, 2020
Merged

remove conditionals on python version #635

merged 4 commits into from
Jul 30, 2020

Conversation

aaronayres35
Copy link
Contributor

@aaronayres35 aaronayres35 commented Jul 24, 2020

fixes #601

@aaronayres35 aaronayres35 requested a review from rahulporuri July 24, 2020 14:27
@codecov-commenter
Copy link

codecov-commenter commented Jul 24, 2020

Codecov Report

Merging #635 into master will decrease coverage by 0.02%.
The diff coverage is 75.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #635      +/-   ##
==========================================
- Coverage   39.22%   39.19%   -0.03%     
==========================================
  Files         491      491              
  Lines       26916    26905      -11     
  Branches     4069     4065       -4     
==========================================
- Hits        10557    10545      -12     
+ Misses      15903    15901       -2     
- Partials      456      459       +3     
Impacted Files Coverage Δ
pyface/gui_application.py 77.89% <0.00%> (+2.38%) ⬆️
pyface/qt/__init__.py 71.73% <ø> (+2.98%) ⬆️
pyface/timer/i_timer.py 89.47% <100.00%> (+2.73%) ⬆️
pyface/ui/qt4/mimedata.py 85.29% <100.00%> (+3.60%) ⬆️
pyface/i_file_dialog.py 76.92% <0.00%> (-7.70%) ⬇️
pyface/ui/qt4/util/gui_test_assistant.py 77.87% <0.00%> (-2.66%) ⬇️
pyface/ui/wx/window.py 74.69% <0.00%> (-2.41%) ⬇️
pyface/wx/python_stc.py 9.14% <0.00%> (-1.22%) ⬇️
pyface/ui/qt4/code_editor/code_widget.py 43.31% <0.00%> (-0.85%) ⬇️
pyface/ui/qt4/console/console_widget.py 29.07% <0.00%> (-0.21%) ⬇️
... and 1 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 990cbd2...c5918c6. Read the comment docs.

Copy link
Contributor

@rahulporuri rahulporuri left a comment

Choose a reason for hiding this comment

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

Changes LGTM but i'm a little concerned about the changes in pyface.qt.__init__. Can you hold off on merging this until we can get another pair of eyes on this PR?

@rahulporuri rahulporuri requested a review from kitchoi July 24, 2020 17:22
@aaronayres35
Copy link
Contributor Author

Changes LGTM but i'm a little concerned about the changes in pyface.qt.__init__. Can you hold off on merging this until we can get another pair of eyes on this PR?

Yeah I will hold off, tbh I was a bit unsure myself - was curious for any feedback.

Comment on lines 34 to 40
sip.setapi("QDate", 2)
sip.setapi("QDateTime", 2)
sip.setapi("QString", 2)
sip.setapi("QTextStream", 2)
sip.setapi("QTime", 2)
sip.setapi("QUrl", 2)
sip.setapi("QVariant", 2)
Copy link
Contributor

@kitchoi kitchoi Jul 29, 2020

Choose a reason for hiding this comment

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

This code path still gets run in Python 3 with PyQt4. The outcome of this import side effect may not have been well tested, and it would be difficult to track down to this change if this removal should cause issues.
Are there other reasons for removing this apart from the comment and message surrounding it being Python 2 specific?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, it was simply removed because of the comment and Rahul saying we might be able to remove it on the original issue. To prevent potential additional headaches from its removal, I will add it back in - thanks!

Copy link
Contributor

Choose a reason for hiding this comment

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

I see. Yes please add it back in. Thank you!
Finger-crossed we won't need to support PyQt4 for much longer so this function is on already the death row - just not quite there yet :)

Copy link
Contributor Author

@aaronayres35 aaronayres35 Jul 30, 2020

Choose a reason for hiding this comment

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

Should I add back in the places where it was called? The one I'm most unsure about is the one below that was on line 61 as that if statement only occurs if python2 is being used explicitly.

(In the latest commit I added all the code where it was called that had been removed back. If needed I can re-remove it.

Copy link
Contributor

Choose a reason for hiding this comment

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

You're right - I think the one under if qt_api == "pyqt" and sys.version_info[0] <= 2: can be safely removed.

@aaronayres35 aaronayres35 merged commit 05fb211 into master Jul 30, 2020
@aaronayres35 aaronayres35 deleted the python2-cleanup branch July 30, 2020 17:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Python 2 cleanup
4 participants