flatpak / flatpak-builder-tools

Various helper tools for flatpak-builder
197 stars 107 forks source link

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

Open EvilSupahFly opened 1 month ago

EvilSupahFly commented 1 month ago

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.

hfiguiere commented 1 month ago

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.

EvilSupahFly commented 1 month ago

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.

yodatak commented 1 month ago

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

bbhtt commented 1 month ago

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