Open lpyparmentier opened 2 years ago
If i'm wrong in my process, please tell me! Maybe there is another way that I don't see
I am having the same problem with pyQt5 and poetry. If the "source" isn't provided in the manifest for the nested dependencies (pyqt5 needs sip for example), the build will fail. Thing is python-pip-generator script cannot create a json output with source for setuptools (because it is already installed?). And because of it, I am currently struck..
This is way more painful than maintaining an rpm for example.
Edit : This is what I get by running python flatpak-pip-generator.py setuptools
{
"name": "python3-setuptools",
"buildsystem": "simple",
"build-commands": [],
"modules": []
}
@akarshanbiswas setuptools
is blacklisted because its already there: https://github.com/flatpak/flatpak-builder-tools/blob/master/pip/flatpak-pip-generator#L297
But maybe it can be made smarter, like if setuptools
is explicitly in the list given, ignore the blacklist.
I just went through a similar packaging hell as @lpyparmentier did when trying to package a few of my own PyQt5 based applications until I came across this (and other Flatpak and PythonQT related issues that are almost 4 years old a this point).
The packaging experience is sadly so bad, that I gave up on it.
The fact that no PyQt5 extension exists like it does for openJDK just blows my mind.
The fact that no PyQt5 extension exists like it does for openJDK just blows my mind.
Feel free to submit it. Voicing your frustrations here is not going to solve any problem.
A few comments above mention PyQt5: this is now much better with https://github.com/flathub/com.riverbankcomputing.PyQt.BaseApp (at least it works well for me and maintainers where very responsive to a few issues that initially cropped up)
@hfiguiere, Following my PR on flathub I will try to explain why building a python app can be painful with the tool.
According to discussion we can't use the option
build-options/build-args
so we have to pre-download everything as a generated module thanks to the builder-tools here.Let's start with streamdeck-ui, I want to build the flatpak app.
flatpak-poetry-generator.py poetry.lock
, first fail.I check the related issues, found this, one team lead at Qt explain why there is no source available discussion. To my POV two ways to solve this.: 1.1. Either I ask for each developer to add the sources 1.2. Ignore and install later as a separate module
I'll go with 1.2, no time to deal with each developer that don't put source on pypi, it looks like they have their reasons and pypi don't force them. So I change the script in order to have an option
--ignore-pkgs
like #217re-run
flatpak-poetry-generator.py poetry.lock --ignore-pkgs pyside2
and keep in mind that I will have to buildpyside2
or include somewhere else as a module. second fail:pywin32 is for windows from what I understand, let's ignore it also (or think that i'll need to add it as a module). re-run
flatpak-poetry-generator.py poetry.lock --ignore-pkgs pyside2 pywin32
. third faillets remove shiboken2, it is part of pyside2 from what i've read.
flatpak-poetry-generator.py poetry.lock --ignore-pkgs pyside2 pywin32 shiboken2
. Now I have agenerated-poetry-sources.json
. Great let's add it here and run a classic buildflatpak-builder --user --install --force-clean build-dir .....yml
fourth failok let's add setuptools, now I have to modify the generated json, very ugly, if the maintainer of the original app change dependencies, it will change the generated poetry.json and I will have to re-apply everything I'm doing from here (same issue with pip-gen btw). So let's do it anyway, and keep finger crossed that no plenty similar error happend, or worst: the stack of new dependencies dont match in the constraint of versions.
Append this as source in the poetry-generated file:
So I spend time to find the source, the right url/version. Then re-run the build.
fail no counting anymore, what I didn't want to happened, happened. Now it's
wheel
that miss. I have to stack other missing sources on an already generated file:I stack
wheel
on the sources of the generated file, and re-run, fail:How do I deal with that ? It seems it requires internet for pbr. 8.1) remove bandit and continue ? not a good idea to remove depdencies of the projet I'm building 8.2) add
build-options/build-args: -share=network
, no I can't, its not available on the bulding CI/CD pipeline of flathub. 8.3) re-runflatpak-poetry-generator.py poetry-of-bandit.lock
(or his requirements) and go through al the process I have been through again ? so I can get a "generated" file of bandit. No way. 8.4) let's try to add a source for pbr.I really hope that through this issue some high level flathub maintainers will understand how painful it is to build some python app. Just because there is a 'security' reason which seems related with how CI/CD pipeline is designed and cannot have internet connection and not with flatpak/bubblwarp concept. If there was a connection we would just have to run 'pip3 install theinitialpackage` and don't go through all this indeep process..., because it clearly works locally, but not on CI/CD flathub pipeline
So maybe there is a lot of python apps on flathub., I would definitely not be the guy that build and maintain one of them in this manner. There must be another way of doing this.