flatpak-builder-tools icon indicating copy to clipboard operation
flatpak-builder-tools copied to clipboard

Make flatpak-pip-generator prefer .whl over .tar.gz

Open EvilSupahFly opened this issue 1 year ago • 4 comments

I've encountered problems several times with packages not building properly from .tar.gz, but building just fine when using the .whl for that same package because version information is missing or not available.

For example, on Python 3.11.9, when attempting to build the Flatpak version of the Amulet Minecraft Map Editor, the script wants to download and build the lz4 module from the .tar.gz archive, and it fails.

On the other hand, if I download lz4-4.3.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl myself, and save it to the project folder, and change url: to path: and supply the sha256sum, the project builds just fine.

For this reason, it would be handy to have an option to prefer .whl files whenever available.

EvilSupahFly avatar Sep 22 '24 20:09 EvilSupahFly

On the other hand, if I download lz4-4.3.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl myself, and save it to the project folder, and change url: to path: and supply the sha256sum, the project builds just fine.

That mean this won't work on aarch64.

hfiguiere avatar Sep 22 '24 20:09 hfiguiere

On the other hand, if I download lz4-4.3.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl myself, and save it to the project folder, and change url: to path: and supply the sha256sum, the project builds just fine.

That mean this won't work on aarch64.

If it's optional behaviour, it means you don't use that option on non-applicable platforms. It's a fall-back option, for when the default behaviour doesn't work as expected.

EvilSupahFly avatar Sep 22 '24 20:09 EvilSupahFly

I find problem with pyside6 that only contain whel too

Traceback (most recent call last): File "/var/home/yodatak/Projects/work/rimsort-flatpak/flatpak-pip-generator", line 291, in url = get_tar_package_url_pypi(name, version) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/var/home/yodatak/Projects/work/rimsort-flatpak/flatpak-pip-generator", line 91, in get_tar_package_url_pypi raise Exception(err) Exception: Failed to get PySide6-6.7.2 source from https://pypi.org/pypi/PySide6/6.7.2/json

yodatak avatar Oct 05 '24 14:10 yodatak

Pyside6 has a baseapp now maintained by Qt, you can use it from there https://github.com/flathub/io.qt.PySide.BaseApp

This issue is partially solved by https://github.com/flatpak/flatpak-builder-tools/pull/331

bbhtt avatar Oct 05 '24 14:10 bbhtt

we can only do any wheels at best, there isn't much point going over the complexity of choosing the right wheel for right python version/glibc ABI when the tarball is already there.

bbhtt avatar Apr 28 '25 02:04 bbhtt

Dupe of https://github.com/flatpak/flatpak-builder-tools/issues/296

bbhtt avatar Apr 28 '25 02:04 bbhtt