-
Notifications
You must be signed in to change notification settings - Fork 198
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 deprecated libraries (pyqt4, pygtk) #225
Merged
asweigart
merged 5 commits into
asweigart:master
from
stephenfin:remove-deprecated-libraries
Jun 18, 2024
Merged
Remove deprecated libraries (pyqt4, pygtk) #225
asweigart
merged 5 commits into
asweigart:master
from
stephenfin:remove-deprecated-libraries
Jun 18, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PyGTK is a dead project that hasn't seen any updates in over a decade (since the release of GTK version 3) [1][2]. This is dead code. [1] https://pypi.org/project/PyGTK/#history [2] https://en.wikipedia.org/wiki/PyGTK Signed-off-by: Stephen Finucane <[email protected]>
Qt4, and by extension PyQt4, are unsupported since 2015 [1]. There's no reason to keep supporting them. [1] https://www.qt.io/blog/2015/05/26/qt-4-8-7-released Signed-off-by: Stephen Finucane <[email protected]>
Neither of these are supported anymore. Signed-off-by: Stephen Finucane <[email protected]>
We were using a try-except "ladder" to handle switching between backends. While there's nothing totally wrong with this, it was allowing for a weird issue to develop. I had previously installed PyQt5 via my distro package (Fedora) but had then removed this. Unfortunately removing the package had left some files behind: $ ls /usr/lib64/python3.10/site-packages/PyQt5/* -la /usr/lib64/python3.10/site-packages/PyQt5/bindings: total 8 drwxr-xr-x. 2 root root 4096 May 18 15:09 . drwxr-xr-x. 4 root root 4096 May 18 15:09 .. /usr/lib64/python3.10/site-packages/PyQt5/__pycache__: total 8 drwxr-xr-x. 2 root root 4096 May 18 15:09 . drwxr-xr-x. 4 root root 4096 May 18 15:09 .. This meant that I was able to import the 'PyQt5' module but nothing under this: $ python >>> import PyQt5 >>> from PyQt5.QtWidgets import QApplication Traceback (most recent call last): File "<stdin>", line 1, in <module> ModuleNotFoundError: No module named 'PyQt5.QtWidgets' This isn't pyperclip's fault. However, by moving away from this try-catch ladder and wrapping the import logic inside the try block, we can mitigate against this issue when it happens *and* result in less indented code. Signed-off-by: Stephen Finucane <[email protected]>
I note that there are a couple of patches open to add support for the new GObject library in place for PyGTK. I'd be happy to drop that part of this PR and/or fold those PRs in here if that would help. |
awesome. it's hard to install pyqt4 on the recent ubuntu. please applying this PR to the latest! |
Related #111 |
Thanks! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Both the PyGTK and PyQt4 libraries have been unsupported for many years. They
complicate the codebase and it's time we drop support for them. If people still
care about these, they can use older versions of pyperclip.