{"id":15719564,"url":"https://github.com/patrickkidd/pyqtdeploy-demo","last_synced_at":"2025-07-29T00:35:35.647Z","repository":{"id":145976744,"uuid":"550336625","full_name":"patrickkidd/pyqtdeploy-demo","owner":"patrickkidd","description":null,"archived":false,"fork":false,"pushed_at":"2023-09-27T16:51:07.000Z","size":310,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-06T04:11:53.097Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/patrickkidd.png","metadata":{"files":{"readme":"README","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-10-12T15:33:56.000Z","updated_at":"2022-10-12T15:36:18.000Z","dependencies_parsed_at":null,"dependency_job_id":"fadfd389-2fe6-4794-a333-95c9a9060aea","html_url":"https://github.com/patrickkidd/pyqtdeploy-demo","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patrickkidd%2Fpyqtdeploy-demo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patrickkidd%2Fpyqtdeploy-demo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patrickkidd%2Fpyqtdeploy-demo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patrickkidd%2Fpyqtdeploy-demo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/patrickkidd","download_url":"https://codeload.github.com/patrickkidd/pyqtdeploy-demo/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246390857,"owners_count":20769476,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-03T21:56:08.102Z","updated_at":"2025-03-30T22:44:27.430Z","avatar_url":"https://github.com/patrickkidd.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"pyqtdeploy-demo\n==================================================================================\nThis project is an effort at a non-happy path demo for pyqtdeploy. As with all\npython deployment tools, there can be a number of problems getting a project up\nand running with pyqtdeploy. These problems can be difficult to troubleshoot. This\nproject is meant to track some common problems using pyqtdeploy and associated python\nextensions modules, demonstrate solutions to them, and serve as an example for\nnon-straightfoward pyqtdeploy project elements listed below under the \"Goals\"\nsection below.\n\nTLDR; Setup Environment\n----------------------------------------------------------------------------------\n```\n# Local python environment\npyenv install 3.10.6\npyenv shell 3.10.6\npip install pipenv\npipenv install\n```\n\nTLDR; Develop/Debug Application\n----------------------------------------------------------------------------------\n```\npipenv shell\ncd cpythononly \u0026\u0026 sip-install\ncd cpythonplusqt \u0026\u0026 sip-install\npython pyqtdeploy-demo.py\n```\n\nTLDR; Build Application\n----------------------------------------------------------------------------------\n```\n# Build sysroot\npyqtdeploy-sysroot --verbose sysroot/sysroot.toml\n\n# Build demo application\npyqtdeploy-build --verbose pyqtdeploy-demo.pdt\ncd build-macos-64\nqmake\nmake -j16\n```\n\nGoals: \n----------------------------------------------------------------------------------\n- Patch Qt before build.\n- Include a custom pure sip/CPython+Python extension.\n- Include a custom sip/CPython+Python extension that extends Qt.\n- Include python+pyqt application code\n    - Import and use all included custom sip extensions.\n    - Include png resource files in application code.\n- Be able to run un-deployed application via source for development.\n- Copy-pastable TLDR commands to get a working app binary (if possible)\n    - Include any necessary changes to sip/pyqt/pyqtbuilder/etc extension code.\n\nChanges To Original pyqt-demo Concept\n----------------------------------------------------------------------------------\n- Renamed `pyqt-demo.py` to `pyqtdeploy-demo.py`\n- Moved ./sysroot.toml to ./sysroot/sysroot.toml\n- Added ./Qt.py component plugin to patch Qt-5.15+ on macOS.\n- Added ./Qt.py, ./OpenSSL.py, ./python.py component plugins to allow for concurrent builds.\n- Added ./cpythononly, ./cpythononly.py for python+cpython only sip extension.\n- Added ./cpythonplusqt, ./cpythonplusqt.py for python+cpython+qt sip extension.\n\nList of Problems Discovered in Chronological Order for Base pyqt-demo\n----------------------------------------------------------------------------------\n- Prerequisite python environment?\n    - `pip install sip, pyqt5, pyqt-builder`\n    - Have to make a choice for venv, choosing pipenv.\n        - ** Created Pipfile, .venv dir to house venv in project dir.\n- Why build-demo.py over just TLDR copy-pasta commands?\n    - pyqtdeploy-sysroot, pyqtdeploy-build, cd build-macos-64 \u0026\u0026 qmake, make -j16\n    - Could see as instructive example but can be unclear if it's necessary\n    - Could see helpful to copy pyqt-demo.py.dat, but why not just do that in the release tarball?\n    - Can also obscure underlying use of executables, basic sip/pyqtdeploy-* concepts.\n- Building sysroot (pyqtdeploy-sysroot)\n    - took two days with some experience with Qt, PyQt*\n    - Always recommend --verbose for pyqtdeploy-* to troubleshoot inevitable errors\n    - pyqtdeploy-sysroot --verbose sysroot.toml\n    - troubleshooting build errors is timeconsuming without option for parallel builds\n        - ** Added PYQTDEPLOY_SYSROOT_JOBS env var to `pyqtdeploy` and `pyqtbuild`\n    - Compile error in Qt-5.15.2-6 on macos: https://github.com/conan-io/conan-center-index/blob/master/recipes/qt/6.x.x/patches/dece6f5.patch\n        - Had to move `#include \u003cCoreGraphics/CGColorSpace.h\u003e` to first include in file.\n        - Had to:\n            1. Create new archive qt-everywhere-src-5.15.6-patched.tar.xz\n            2. Create debuggable pythons script version of pyqtdeploy-build \"exe\" that\n                to step through pyqtdeploybuild_main, to understand pyqtdeploy plugin arch, etc.\n            3. Create new Qt.py in root project dir to point to new source path instead\n                of pyqtdeploy automatically downloading buggy source tarball.\n- Building qmake project (pyqtdeploy-build)\n    - Worked out of the box\n- Generating makefiles (qmake)\n    - Run w/ relative path to qmake in sysroot: ./sysroot-macos-64/Qt/bin/qmake\n    - Then worked\n- Compiling project sources (make)\n    - Compiled + Linked out of the box\n- Running binary (./pyqt-demo)\n    - ERROR\n        Traceback (most recent call last):\n            File \"pyqt-demo.py\", line 269, in \u003cmodule\u003e\n            File \"pyqt-demo.py\", line 224, in create_qscintilla_code_view\n            File \"pyqt-demo.py\", line 190, in get_source_code\n            File \":/importlib/resources.pyo\", line 103, in read_text\n            File \":/importlib/resources.pyo\", line 82, in open_text\n            File \":/importlib/resources.pyo\", line 46, in open_binary\n        SystemError: \u003cclass 'pdytools.qrcresource'\u003e returned NULL without setting an exception\n        - Had to read code for `pdytools`\n- Adding cpythononly to packages in pyqtdeploy project didn't include sip cpp module sources.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpatrickkidd%2Fpyqtdeploy-demo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpatrickkidd%2Fpyqtdeploy-demo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpatrickkidd%2Fpyqtdeploy-demo/lists"}