pyqt / python-qt5

Unofficial PyQt5 via PyPI for Python 2.7 64-bit on Windows
GNU General Public License v3.0
285 stars 79 forks source link

PyQt 5.4 support #7

Open fabiencastan opened 9 years ago

mottosso commented 9 years ago

Thanks for reporting this, I am also very keen to get this supported!

fabiencastan commented 9 years ago

Can I help? What's the procedure to do that?

mottosso commented 9 years ago

You most certainly can, the procedure however is not very well defined at the moment.

I'd be happy to properly document it with you in the Wiki if you're up for giving it a go; and to potentially develop a build-script for future compilations.

In a nutshell, these are the steps I took for the current version.

  1. Compile using Python 2.7 x64 and Visual Studio 2013 under Windows 7 or 8.
  2. Paste the result into the installation of a Riverbank distribution; overwriting all existing, but keeping all new.
  3. Append qt.conf and augment __init__.py

2. Overwrite

This is rather unclean, but when asking Riverbank about which binaries to actually include in a distribution, such as those included in his installers, he essentially told me he figured it out via "trail and error", so I did the same.

"Most of it is obvious, the rest is trial-and-error and bug reports." - Mailing list conversation

3. Qt.conf and init.py

These make PyQt self-contained and are required to make Qt usable without manually registering the platform-plugins. It differs from Riverbanks distribution in that it doesn't pollute the Python root directory and allows PyQt5 to co-exist with PyQt4, if needed.

mottosso commented 9 years ago

Adding a page here for instructions about how to compile and ship. Feel free to augment it with your experiences, and I'll fill in missing bits best I can.

https://github.com/pyqt/python-qt5/wiki/Updating-the-repository

fabiencastan commented 9 years ago

Could you add the description on how to upload it on PyPi?

mottosso commented 9 years ago

Added.

mottosso commented 9 years ago

Hey @fabiencastan, have you had a chance to look into this?

mottosso commented 9 years ago

I remembered I had documented the procedure. :)

It covers both how to compile, but also how to bundle it up similar to the Riverbank distribution. This is the approach I've taken in this repository as well, and should apply equally well to PyQt 5.4.

mottosso commented 9 years ago

Added updated and complete guide here.

Will upload 5.4 once I've ran it through some internal tests.

fabiencastan commented 9 years ago

Thanks @mottosso for all the information. I'm interested to do it for qt 5.4 on linux but I don't have the time to to that currently.

mottosso commented 9 years ago

No problem @fabiencastan, once you have something up and running, we can have a chat about how to get it up on PyPI!

There is a guide on compiling for Ubuntu here.

mottosso commented 9 years ago

It would appear that 5.4 hits a PyPI file size-limit.

PyQt 5.3 weighs in around 53mb, whereas 5.4 ends up in the 90mb range. I've opened up a support ticket regarding the issue and so it may be resolved, but I'm not counting on it.

An alternative would be to provide pure-PyQt5 via PyPI and have users install the Qt libraries themselves.

mottosso commented 9 years ago

You can also install with pip directly from Git.

$ pip install git+https://github.com/pyqt/python-qt5.git

I'm looking into distributing PyQt without compiled binaries from now on; it's about 15mb and shouldn't get any bigger with new releases. It'll also be slim enough to provide builds to multiple platforms.

fabiencastan commented 9 years ago

You can also install with pip directly from Git. $ pip install git+https://github.com/pyqt/python-qt5.git

Thanks for the tip! Seems really useful.

I'm looking into distributing PyQt without compiled binaries from now on; it's about 15mb and shouldn't get any bigger with new releases. It'll also be slim enough to provide builds to multiple platforms.

Sorry, I don't get it. Is it not possible to split it in 2 packages on pypi to get around the size limitation? With Qt alone and PyQt/Sip on another.

mottosso commented 9 years ago

No problem!

Is it not possible to split it in 2 packages on pypi to get around the size limitation? With Qt alone and PyQt/Sip on another.

Could do; we might be looking at potentially three packages to work around the limitation of PyPI at 50mb.

  1. PyQt (15mb)
  2. Qt part 1 (75/2mb)
  3. Qt part 2

Though there is no "automatic splitting" of sorts, as far as I know. We would have to make three separate distributions with their own installers and spot on PyPI.

Alternatively, we could have PyQt alone on PyPI, and grab the binaries directly from GitHub, via something like this:

That would allow us to have binaries of any size, whilst still having python-qt5 be available on PyPI. Users could could also choose to install just PyQt or PyQt with dependencies/binaries.

$ pip install python-qt5  # Install everything
$ pip install python-qt5 --no-dependencies  # Install without Qt

It's a little above and beyond my requirements at the moment, but it looks as though we should be safe to start off by providing pure-PyQt5 distributions in this particular repo, whilst distributing the binaries from another to keep Git/GitHub cleaner and lighter.

@fabiencastan Would you like to have a go with dependency_links? Maybe do some tests with a mock library and binaries so that we know it works?

anthrotype commented 7 years ago

PyPI can now increase the size limit on a package by package basis, if you kindly ask the maintainers. For a project like PyQt5 I guess they should be able to accept your request. Eg. see https://github.com/pypa/packaging-problems/issues/86#issuecomment-264971348

It's a pity the official wheels are py35 only. It would be really nice to have py27 wheels on PyPI with the latest pyqt5 5.7.0.

mottosso commented 7 years ago

I'd be happy for you to do this on my behalf.

anthrotype commented 7 years ago

well, ok.. I could try. Let's see how it goes.