From 92c5484ffe96a9753f19d3df9bd11da08f845ccc Mon Sep 17 00:00:00 2001 From: Mohamed <110548351+oop7@users.noreply.github.com> Date: Sun, 25 Jan 2026 14:33:15 +0200 Subject: [PATCH] Update Linux build workflow for PEP 517 and cx_Freeze Switch pip install to use PEP 517 (pyproject.toml) instead of requirements.txt and update cache key accordingly. Refactor cx_Freeze setup to use new asset paths, add entry point script, and adjust include_files for correct packaging structure. --- .github/workflows/build-linux.yml | 32 ++++++++++++++++++------------- 1 file changed, 19 insertions(+), 13 deletions(-) diff --git a/.github/workflows/build-linux.yml b/.github/workflows/build-linux.yml index bf7182f..bb05ae1 100644 --- a/.github/workflows/build-linux.yml +++ b/.github/workflows/build-linux.yml @@ -49,7 +49,7 @@ jobs: path: | venv ~/.cache/pip - key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} + key: ${{ runner.os }}-pip-${{ hashFiles('pyproject.toml') }} restore-keys: | ${{ runner.os }}-pip- @@ -67,7 +67,7 @@ jobs: python -m venv venv source venv/bin/activate python -m pip install --upgrade pip - pip install --no-cache-dir -r requirements.txt + pip install --no-cache-dir . pip install --no-cache-dir cx_Freeze - name: Prepare build variables @@ -82,6 +82,13 @@ jobs: - name: Create cx_Freeze setup script (Linux) shell: bash run: | + # Create entry point script + cat > ytsage_entry.py <<'ENTRY' + from ytsage.main import main + if __name__ == "__main__": + main() + ENTRY + cat > setup_cxfreeze.py <<'PY' import os import sys @@ -92,26 +99,26 @@ jobs: # Prepare include_files list include_files_list = [ - ("src", "src"), - ("assets/branding/icons", "lib/assets/branding/icons"), - ("assets/Icon", "lib/assets/Icon"), - ("assets/sound", "lib/assets/sound"), - ("languages", "lib/languages"), + ("ytsage/assets/Icon", "lib/assets/Icon"), + ("ytsage/assets/sound", "lib/assets/sound"), + ("ytsage/languages", "lib/languages"), + ("branding/icons", "lib/assets/branding/icons"), ("ytsage.desktop", "share/applications/ytsage.desktop"), - ("assets/branding/icons/icon.png", "share/pixmaps/ytsage.png"), + ("branding/icons/icon.png", "share/pixmaps/ytsage.png"), ] build_exe_options = dict( optimize=2, packages=[ + "ytsage", "PySide6.QtCore", "PySide6.QtGui", "PySide6.QtWidgets", + "PySide6.QtMultimedia", "requests", "PIL", "packaging", "markdown", - "pyglet", "loguru", "setuptools", ], @@ -125,7 +132,6 @@ jobs: "PySide6.QtXml", "PySide6.QtSql", "PySide6.QtHelp", - "PySide6.QtMultimedia", "PySide6.QtQml", "PySide6.QtQuick", "PySide6.QtWebEngineCore", @@ -144,9 +150,9 @@ jobs: include_files=include_files_list, # Bundle all dependencies - avoid system library references bin_includes=[], - bin_excludes=[], - # Important: include system libs to avoid external dependencies - replace_paths=[("*", "")], + bin_excludesytsage_entry.py", + target_name="ytsage", + icon="*", "")], ) executables = [