From 864846313626c36c274050039bcc4673b904cd6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois?= Date: Sat, 18 Apr 2026 11:15:49 +0200 Subject: [PATCH] flatpak is working --- .gitignore | 5 +- package/flatpak/build.sh | 8 + package/flatpak/org.testium.Testium.yaml | 58 +++++ package/flatpak/python3-requirements.json | 279 ++++++++++++++++++++++ package/flatpak/requirements.txt | 14 ++ 5 files changed, 362 insertions(+), 2 deletions(-) create mode 100755 package/flatpak/build.sh create mode 100644 package/flatpak/org.testium.Testium.yaml create mode 100644 package/flatpak/python3-requirements.json create mode 100644 package/flatpak/requirements.txt diff --git a/.gitignore b/.gitignore index 6c7d8ab..990930b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,12 +1,13 @@ *__pycache__ -build +build/ dist *.egg-info/ .env /.project /.pydevproject /.vscode -/.venv +.venv/ +.flatpak-builder/ crash.tx* report_test.tx* *.autosave diff --git a/package/flatpak/build.sh b/package/flatpak/build.sh new file mode 100755 index 0000000..1d017f6 --- /dev/null +++ b/package/flatpak/build.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +# Prérequis : installer le runtime et SDK KDE +# flatpak install flathub org.kde.Platform//6.10 +# flatpak install flathub org.kde.Sdk//6.10 +# flatpak install flathub io.qt.PySide.BaseApp//6.10 + +flatpak-builder --user --verbose --force-clean --install build org.testium.Testium.yaml diff --git a/package/flatpak/org.testium.Testium.yaml b/package/flatpak/org.testium.Testium.yaml new file mode 100644 index 0000000..dcf3e06 --- /dev/null +++ b/package/flatpak/org.testium.Testium.yaml @@ -0,0 +1,58 @@ +app-id: org.testium.Testium +runtime: org.kde.Platform +runtime-version: '6.10' + +sdk: org.kde.Sdk +base: io.qt.PySide.BaseApp +base-version: '6.10' # Doit correspondre au runtime +command: testium + +finish-args: + - --share=ipc + - --socket=fallback-x11 + - --socket=wayland + - --device=dri + - --share=network + - --filesystem=home # Optionnel : si votre testium doit lire des fichiers utilisateurs + +build-options: + build-args: + - "--share=network" + +modules: + - python3-requirements.json + # 1. Dépendances Python tierces (HORS PySide6) + # Utilisez flatpak-pip-generator pour vos autres libs (ex: pyserial, requests, etc.) + # - name: python3-requirements + # buildsystem: simple + # build-options: + # build-args: + # - --share=network + # build-commands: + # # --only-binary=:all: empêche la compilation et force le téléchargement des .whl + # - pip3 install --prefix=/app --only-binary=:all: -r requirements.txt + # sources: + # - type: file + # path: requirements.txt + + # 2. Votre application (Code source dans ../../src) + - name: testium-app + buildsystem: simple + sources: + - type: dir + path: ../../src + build-commands: + # On installe le code source dans /app/lib/testium + - mkdir -p /app/lib + - cp -r . /app/lib/ + + # Création du launcher exécutable + - mkdir -p /app/bin + - | + cat < /app/bin/testium + #!/bin/sh + # On ajoute le code source et l'extension PySide6 au PYTHONPATH + export PYTHONPATH="/app/lib/testium:/usr/lib/sdk/pyside6/lib/python3.13/site-packages:\$PYTHONPATH" + exec python3 /app/lib/testium "\$@" + EOF + - chmod +x /app/bin/testium diff --git a/package/flatpak/python3-requirements.json b/package/flatpak/python3-requirements.json new file mode 100644 index 0000000..68287a8 --- /dev/null +++ b/package/flatpak/python3-requirements.json @@ -0,0 +1,279 @@ +{ + "name": "python3-requirements", + "buildsystem": "simple", + "build-commands": [], + "modules": [ + { + "name": "python3-setuptools-scm", + "buildsystem": "simple", + "build-commands": [ + "pip3 install --verbose --exists-action=i --no-index --find-links=\"file://${PWD}\" --prefix=${FLATPAK_DEST} \"setuptools-scm\" --no-build-isolation" + ], + "sources": [ + { + "type": "file", + "url": "https://files.pythonhosted.org/packages/b7/b9/c538f279a4e237a006a2c98387d081e9eb060d203d8ed34467cc0f0b9b53/packaging-26.0-py3-none-any.whl", + "sha256": "b36f1fef9334a5588b4166f8bcd26a14e521f2b55e6b9de3aaa80d3ff7a37529" + }, + { + "type": "file", + "url": "https://files.pythonhosted.org/packages/3d/ea/ac2bf868899d0d2e82ef72d350d97a846110c709bacf2d968431576ca915/setuptools_scm-9.2.2-py3-none-any.whl", + "sha256": "30e8f84d2ab1ba7cb0e653429b179395d0c33775d54807fc5f1dd6671801aef7" + } + ] + }, + { + "name": "python3-pyserial", + "buildsystem": "simple", + "build-commands": [ + "pip3 install --verbose --exists-action=i --no-index --find-links=\"file://${PWD}\" --prefix=${FLATPAK_DEST} \"pyserial\" --no-build-isolation" + ], + "sources": [ + { + "type": "file", + "url": "https://files.pythonhosted.org/packages/07/bc/587a445451b253b285629263eb51c2d8e9bcea4fc97826266d186f96f558/pyserial-3.5-py2.py3-none-any.whl", + "sha256": "c4451db6ba391ca6ca299fb3ec7bae67a5c55dde170964c7a14ceefec02f2cf0" + } + ] + }, + { + "name": "python3-telnetlib3", + "buildsystem": "simple", + "build-commands": [ + "pip3 install --verbose --exists-action=i --no-index --find-links=\"file://${PWD}\" --prefix=${FLATPAK_DEST} \"telnetlib3\" --no-build-isolation" + ], + "sources": [ + { + "type": "file", + "url": "https://files.pythonhosted.org/packages/ea/5a/8b101830965fab106d33df8c50c4eb801d08beaf2de65f366b667e8a6f74/telnetlib3-4.0.1-py3-none-any.whl", + "sha256": "07b129473709f35b0a2d598f5033fd6d2d2eaf63f28f8897a948851fd52ba332" + }, + { + "type": "file", + "url": "https://files.pythonhosted.org/packages/68/5a/199c59e0a824a3db2b89c5d2dade7ab5f9624dbf6448dc291b46d5ec94d3/wcwidth-0.6.0-py3-none-any.whl", + "sha256": "1a3a1e510b553315f8e146c54764f4fb6264ffad731b3d78088cdb1478ffbdad" + } + ] + }, + { + "name": "python3-pyyaml", + "buildsystem": "simple", + "build-commands": [ + "pip3 install --verbose --exists-action=i --no-index --find-links=\"file://${PWD}\" --prefix=${FLATPAK_DEST} \"pyyaml\" --no-build-isolation" + ], + "sources": [ + { + "type": "file", + "url": "https://files.pythonhosted.org/packages/74/27/e5b8f34d02d9995b80abcef563ea1f8b56d20134d8f4e5e81733b1feceb2/pyyaml-6.0.3-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", + "sha256": "0f29edc409a6392443abf94b9cf89ce99889a1dd5376d94316ae5145dfedd5d6" + } + ] + }, + { + "name": "python3-pexpect", + "buildsystem": "simple", + "build-commands": [ + "pip3 install --verbose --exists-action=i --no-index --find-links=\"file://${PWD}\" --prefix=${FLATPAK_DEST} \"pexpect\" --no-build-isolation" + ], + "sources": [ + { + "type": "file", + "url": "https://files.pythonhosted.org/packages/9e/c3/059298687310d527a58bb01f3b1965787ee3b40dce76752eda8b44e9a2c5/pexpect-4.9.0-py2.py3-none-any.whl", + "sha256": "7236d1e080e4936be2dc3e326cec0af72acf9212a7e1d060210e70a47e253523" + }, + { + "type": "file", + "url": "https://files.pythonhosted.org/packages/22/a6/858897256d0deac81a172289110f31629fc4cee19b6f01283303e18c8db3/ptyprocess-0.7.0-py2.py3-none-any.whl", + "sha256": "4b41f3967fce3af57cc7e94b888626c18bf37a083e3651ca8feeb66d492fef35" + } + ] + }, + { + "name": "python3-gitpython", + "buildsystem": "simple", + "build-commands": [ + "pip3 install --verbose --exists-action=i --no-index --find-links=\"file://${PWD}\" --prefix=${FLATPAK_DEST} \"gitpython\" --no-build-isolation" + ], + "sources": [ + { + "type": "file", + "url": "https://files.pythonhosted.org/packages/a0/61/5c78b91c3143ed5c14207f463aecfc8f9dbb5092fb2869baf37c273b2705/gitdb-4.0.12-py3-none-any.whl", + "sha256": "67073e15955400952c6565cc3e707c554a4eea2e428946f7a4c162fab9bd9bcf" + }, + { + "type": "file", + "url": "https://files.pythonhosted.org/packages/6a/09/e21df6aef1e1ffc0c816f0522ddc3f6dcded766c3261813131c78a704470/gitpython-3.1.46-py3-none-any.whl", + "sha256": "79812ed143d9d25b6d176a10bb511de0f9c67b1fa641d82097b0ab90398a2058" + }, + { + "type": "file", + "url": "https://files.pythonhosted.org/packages/c1/d4/59e74daffcb57a07668852eeeb6035af9f32cbfd7a1d2511f17d2fe6a738/smmap-5.0.3-py3-none-any.whl", + "sha256": "c106e05d5a61449cf6ba9a1e650227ecfb141590d2a98412103ff35d89fc7b2f" + } + ] + }, + { + "name": "python3-jinja2", + "buildsystem": "simple", + "build-commands": [ + "pip3 install --verbose --exists-action=i --no-index --find-links=\"file://${PWD}\" --prefix=${FLATPAK_DEST} \"jinja2\" --no-build-isolation" + ], + "sources": [ + { + "type": "file", + "url": "https://files.pythonhosted.org/packages/62/a1/3d680cbfd5f4b8f15abc1d571870c5fc3e594bb582bc3b64ea099db13e56/jinja2-3.1.6-py3-none-any.whl", + "sha256": "85ece4451f492d0c13c5dd7c13a64681a86afae63a5f347908daf103ce6d2f67" + }, + { + "type": "file", + "url": "https://files.pythonhosted.org/packages/a9/21/9b05698b46f218fc0e118e1f8168395c65c8a2c750ae2bab54fc4bd4e0e8/markupsafe-3.0.3-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", + "sha256": "ccfcd093f13f0f0b7fdd0f198b90053bf7b2f02a3927a30e63f3ccc9df56b676" + } + ] + }, + { + "name": "python3-colorama", + "buildsystem": "simple", + "build-commands": [ + "pip3 install --verbose --exists-action=i --no-index --find-links=\"file://${PWD}\" --prefix=${FLATPAK_DEST} \"colorama\" --no-build-isolation" + ], + "sources": [ + { + "type": "file", + "url": "https://files.pythonhosted.org/packages/d1/d6/3965ed04c63042e047cb6a3e6ed1a63a35087b6a609aa3a15ed8ac56c221/colorama-0.4.6-py2.py3-none-any.whl", + "sha256": "4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6" + } + ] + }, + { + "name": "python3-meson-python", + "buildsystem": "simple", + "build-commands": [ + "pip3 install --verbose --exists-action=i --no-index --find-links=\"file://${PWD}\" --prefix=${FLATPAK_DEST} \"meson-python\" --no-build-isolation" + ], + "sources": [ + { + "type": "file", + "url": "https://files.pythonhosted.org/packages/16/7f/d1b0c65b267a1463d752b324f11d3470e30889daefc4b9ec83029bfa30b5/meson_python-0.19.0-py3-none-any.whl", + "sha256": "67b5906c37404396d23c195e12c8825506074460d4a2e7083266b845d14f0298" + }, + { + "type": "file", + "url": "https://files.pythonhosted.org/packages/b7/b9/c538f279a4e237a006a2c98387d081e9eb060d203d8ed34467cc0f0b9b53/packaging-26.0-py3-none-any.whl", + "sha256": "b36f1fef9334a5588b4166f8bcd26a14e521f2b55e6b9de3aaa80d3ff7a37529" + }, + { + "type": "file", + "url": "https://files.pythonhosted.org/packages/1d/0b/da4851b1e2d9c40c9bd74c0abd94510a7d797da9ccde0a90e8953751ed4a/pyproject_metadata-0.11.0-py3-none-any.whl", + "sha256": "85bbecca8694e2c00f63b492c96921d6c228454057c88e7c352b2077fcaa4096" + } + ] + }, + { + "name": "python3-numpy", + "buildsystem": "simple", + "build-commands": [ + "pip3 install --verbose --exists-action=i --no-index --find-links=\"file://${PWD}\" --prefix=${FLATPAK_DEST} \"numpy\" --no-build-isolation" + ], + "sources": [ + { + "type": "file", + "url": "https://files.pythonhosted.org/packages/7e/eb/7daecbea84ec935b7fc732e18f532073064a3816f0932a40a17f3349185f/numpy-2.4.3-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", + "sha256": "d5f51900414fc9204a0e0da158ba2ac52b75656e7dce7e77fb9f84bfa343b4cc" + } + ] + }, + { + "name": "python3-matplotlib", + "buildsystem": "simple", + "build-commands": [ + "pip3 install --verbose --exists-action=i --no-index --find-links=\"file://${PWD}\" --prefix=${FLATPAK_DEST} \"matplotlib\" --no-build-isolation" + ], + "sources": [ + { + "type": "file", + "url": "https://files.pythonhosted.org/packages/4b/32/e0f13a1c5b0f8572d0ec6ae2f6c677b7991fafd95da523159c19eff0696a/contourpy-1.3.3-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", + "sha256": "4debd64f124ca62069f313a9cb86656ff087786016d76927ae2cf37846b006c9" + }, + { + "type": "file", + "url": "https://files.pythonhosted.org/packages/e7/05/c19819d5e3d95294a6f5947fb9b9629efb316b96de511b418c53d245aae6/cycler-0.12.1-py3-none-any.whl", + "sha256": "85cef7cff222d8644161529808465972e51340599459b8ac3ccbac5a854e0d30" + }, + { + "type": "file", + "url": "https://files.pythonhosted.org/packages/e2/98/8b1e801939839d405f1f122e7d175cebe9aeb4e114f95bfc45e3152af9a7/fonttools-4.62.1-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", + "sha256": "6706d1cb1d5e6251a97ad3c1b9347505c5615c112e66047abbef0f8545fa30d1" + }, + { + "type": "file", + "url": "https://files.pythonhosted.org/packages/2b/0a/7b98e1e119878a27ba8618ca1e18b14f992ff1eda40f47bccccf4de44121/kiwisolver-1.5.0-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", + "sha256": "332b4f0145c30b5f5ad9374881133e5aa64320428a57c2c2b61e9d891a51c2f3" + }, + { + "type": "file", + "url": "https://files.pythonhosted.org/packages/75/97/a471f1c3eb1fd6f6c24a31a5858f443891d5127e63a7788678d14e249aea/matplotlib-3.10.8-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", + "sha256": "a0a7f52498f72f13d4a25ea70f35f4cb60642b466cbb0a9be951b5bc3f45a486" + }, + { + "type": "file", + "url": "https://files.pythonhosted.org/packages/7e/eb/7daecbea84ec935b7fc732e18f532073064a3816f0932a40a17f3349185f/numpy-2.4.3-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", + "sha256": "d5f51900414fc9204a0e0da158ba2ac52b75656e7dce7e77fb9f84bfa343b4cc" + }, + { + "type": "file", + "url": "https://files.pythonhosted.org/packages/b7/b9/c538f279a4e237a006a2c98387d081e9eb060d203d8ed34467cc0f0b9b53/packaging-26.0-py3-none-any.whl", + "sha256": "b36f1fef9334a5588b4166f8bcd26a14e521f2b55e6b9de3aaa80d3ff7a37529" + }, + { + "type": "file", + "url": "https://files.pythonhosted.org/packages/95/f4/86f51b8745070daf21fd2e5b1fe0eb35d4db9ca26e6d58366562fb56a743/pillow-12.1.1-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", + "sha256": "fc44ef1f3de4f45b50ccf9136999d71abb99dca7706bc75d222ed350b9fd2289" + }, + { + "type": "file", + "url": "https://files.pythonhosted.org/packages/10/bd/c038d7cc38edc1aa5bf91ab8068b63d4308c66c4c8bb3cbba7dfbc049f9c/pyparsing-3.3.2-py3-none-any.whl", + "sha256": "850ba148bd908d7e2411587e247a1e4f0327839c40e2e5e6d05a007ecc69911d" + }, + { + "type": "file", + "url": "https://files.pythonhosted.org/packages/ec/57/56b9bcc3c9c6a792fcbaf139543cee77261f3651ca9da0c93f5c1221264b/python_dateutil-2.9.0.post0-py2.py3-none-any.whl", + "sha256": "a8b2bc7bffae282281c8140a97d3aa9c14da0b136dfe83f850eea9a5f7470427" + }, + { + "type": "file", + "url": "https://files.pythonhosted.org/packages/b7/ce/149a00dd41f10bc29e5921b496af8b574d8413afcd5e30dfa0ed46c2cc5e/six-1.17.0-py2.py3-none-any.whl", + "sha256": "4721f391ed90541fddacab5acf947aa0d3dc7d27b2e1e8eda2be8970586c3274" + } + ] + }, + { + "name": "python3-junit-xml", + "buildsystem": "simple", + "build-commands": [ + "pip3 install --verbose --exists-action=i --no-index --find-links=\"file://${PWD}\" --prefix=${FLATPAK_DEST} \"junit-xml\" --no-build-isolation" + ], + "sources": [ + { + "type": "file", + "url": "https://files.pythonhosted.org/packages/2a/93/2d896b5fd3d79b4cadd8882c06650e66d003f465c9d12c488d92853dff78/junit_xml-1.9-py2.py3-none-any.whl", + "sha256": "ec5ca1a55aefdd76d28fcc0b135251d156c7106fa979686a4b48d62b761b4732" + } + ] + }, + { + "name": "python3-lxml", + "buildsystem": "simple", + "build-commands": [ + "pip3 install --verbose --exists-action=i --no-index --find-links=\"file://${PWD}\" --prefix=${FLATPAK_DEST} \"lxml\" --no-build-isolation" + ], + "sources": [ + { + "type": "file", + "url": "https://files.pythonhosted.org/packages/ce/0f/526e78a6d38d109fdbaa5049c62e1d32fdd70c75fb61c4eadf3045d3d124/lxml-6.0.2-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", + "sha256": "bb2f6ca0ae2d983ded09357b84af659c954722bbf04dea98030064996d156048" + } + ] + } + ] +} diff --git a/package/flatpak/requirements.txt b/package/flatpak/requirements.txt new file mode 100644 index 0000000..1e059d2 --- /dev/null +++ b/package/flatpak/requirements.txt @@ -0,0 +1,14 @@ +setuptools +setuptools-scm +pyserial +telnetlib3 +pyyaml +pexpect +gitpython +jinja2 +colorama +meson-python +numpy +matplotlib +junit-xml +lxml