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

Move to GTK+ version 3 #111

Closed
wants to merge 2 commits into from
Closed

Move to GTK+ version 3 #111

wants to merge 2 commits into from

Conversation

coreycb
Copy link

@coreycb coreycb commented Nov 20, 2017

Fixes #106

@asweigart
Copy link
Owner

This change seems to break Python 2's use of pyperclip. For Python 2 I would run apt-get install python-gtk2-dev to get the gtk module, but this change seems like it would break that. I can run import gi just fine from Python 3 on Ubuntu, but import gi doesn't work for Python 2.

What's the solution that doesn't break backwards compatibility? Is backwards compatibility important here?

@tleonhardt
Copy link
Contributor

I would say that pyperclip working both with Python 2 and Python 3 is still essential at this point. Maybe in another year Python 2 support for new releases won't matter. But I know at this point I still have a lot of cmd2 end users who are still using Python 2. (I think they are nuts, but that is beside the point)

@coreycb
Copy link
Author

coreycb commented Nov 22, 2017

Are you able to apt install python-gi? That should get you py2 support. python3-gi should also be available for py3.

@tleonhardt
Copy link
Contributor

The python-gi package exists in apt repos for Ubuntu 17.10, Ubuntu 16.04, Debian 9, and Debian 8 (all of the Linux VMs I had on hand to verify).

@coreycb
Just curious, is there an equivalent package which can be installed via pip?

@coreycb
Copy link
Author

coreycb commented Nov 22, 2017

@tleonhardt I just checked and python-pi is available back to 12.04 for Ubuntu and looks to be available back to Debian 7. I'm not sure if there is a pip installable package. I didn't see one in my searches.

@asweigart
Copy link
Owner

I was just wondering if there was a way to still support people who have the older gtk module and not gi. Maybe we should add a init_gi_clipboard() instead of replacing the current init_gtk_clipboard(). If there's an incompatibility issue, how about we attempt to import gi first, and if that fails, then try to import gtk?

I'm not familiar with gtk on Linux. Does this make sense? Or do we have to necessarily get rid of the import gtk stuff?

@coreycb
Copy link
Author

coreycb commented Nov 22, 2017

I'm ok with a fallback mode. And as you said, if we did that I'd prefer importing gi first and falling back to gtk, because the import of gtk is why cmd2 and pyperclip currently fail when using interactive mode in Ubuntu. The gtk2 and gtk3 modules conflict.

I'm not sure if you need to maintain backward compatability though on major releases of a project though, but I am not the maintainer.

@coreycb
Copy link
Author

coreycb commented Nov 22, 2017

Note: You may also need libgtk-3-dev installed.

@coreycb
Copy link
Author

coreycb commented Nov 22, 2017

@asweigart I've made some updates to fall back to gtk if gi is not available.

@coreycb
Copy link
Author

coreycb commented Nov 29, 2017

@asweigart does this patch look ok to you? I really want to get this into ubuntu but would like it to land upstream here first.

@tleonhardt
Copy link
Contributor

@asweigart Al, if you are busy, I'd be willing to help maintain pyperclip.

@sdelafond
Copy link

Any news on this one ? An up-to-date patch is at https://github.com/sdelafond/pyperclip/blob/debian/master/debian/patches/move-to-gtk3.patch, just in case .

@asweigart
Copy link
Owner

Closing this. Thanks for your contributions and I'm sorry this slipped past my attention. I finally have some time to sort through the issues and PRs for pyperclip. I'll be adding you to the authors document so you can get recognition for your contribution.

@asweigart asweigart closed this Jun 18, 2024
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.

AttributeError: When using gi.repository you must not import static modules like "gobject".
4 participants