diff options
| author | exislow <exislow@users.noreply.github.com> | 2025-01-05 18:43:26 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-01-05 18:43:26 +0100 |
| commit | aa763a9bca9f70071582d18e575c4357afbb4b77 (patch) | |
| tree | 9e42cfeac9593265daae8262b623a0c2a24e01a9 /tidal_dl_ng | |
| parent | 9318d1bf7436236d616d0e8e6d243800da932477 (diff) | |
| parent | edcd689840af69bd611a6735e3586cef59b5449a (diff) | |
| download | tidal-dl-ng-aa763a9bca9f70071582d18e575c4357afbb4b77.tar.gz | |
Merge pull request #311 from exislow/nuitka
Shifting from PyInstaller to Nuitka
Diffstat (limited to 'tidal_dl_ng')
| -rw-r--r-- | tidal_dl_ng/__init__.py | 6 | ||||
| -rw-r--r-- | tidal_dl_ng/gui.py | 46 |
2 files changed, 49 insertions, 3 deletions
diff --git a/tidal_dl_ng/__init__.py b/tidal_dl_ng/__init__.py index 5fb660b..9037212 100644 --- a/tidal_dl_ng/__init__.py +++ b/tidal_dl_ng/__init__.py @@ -1,6 +1,5 @@ #!/usr/bin/env python import importlib.metadata -import sys from pathlib import Path from urllib.parse import urlparse @@ -98,8 +97,9 @@ def is_dev_env() -> bool: result: bool = False # Check if package is running from source code == dev mode - # If package is not running in PyInstaller environment. - if not getattr(sys, "frozen", False) and not hasattr(sys, "_MEIPASS"): + # If package is not running in Nuitka environment, try to import it from pip libraries. + # If this also fails, it is dev mode. + if "__compiled__" not in globals(): try: importlib.metadata.version(package_name) except: diff --git a/tidal_dl_ng/gui.py b/tidal_dl_ng/gui.py index 5a70690..0d20758 100644 --- a/tidal_dl_ng/gui.py +++ b/tidal_dl_ng/gui.py @@ -1,3 +1,49 @@ +# Compilation mode, support OS-specific options +# nuitka-project-if: {OS} in ("Darwin"): +# nuitka-project: --macos-create-app-bundle +# nuitka-project: --macos-app-icon=tidal_dl_ng/ui/icon.icns +# nuitka-project: --macos-signed-app-name=com.exislow.TidalDlNg +# nuitka-project: --macos-app-mode=gui +# nuitka-project-if: {OS} in ("Linux", "FreeBSD"): +# nuitka-project: --linux-icon=tidal_dl_ng/ui/icon.png +# nuitka-project-if: {OS} in ("Windows"): +# nuitka-project: --windows-icon-from-ico=tidal_dl_ng/ui/icon.ico +# nuitka-project: --file-description="TIDAL media downloader next generation." + +# Debugging options, controlled via environment variable at compile time. +# nuitka-project-if: {OS} == "Windows" and os.getenv("DEBUG_COMPILATION", "no") == "yes": +# nuitka-project: --windows-console-mode=hide +# nuitka-project-else: +# nuitka-project: --windows-console-mode=disable +# nuitka-project-if: os.getenv("DEBUG_COMPILATION", "no") == "yes": +# nuitka-project: --debug +# nuitka-project: --debugger +# nuitka-project: --experimental=allow-c-warnings +# nuitka-project: --no-debug-immortal-assumptions +# nuitka-project: --run +# nuitka-project-else: +# nuitka-project: --assume-yes-for-downloads +# nuitka-project-if: os.getenv("DEPLOYMENT", "no") == "yes": +# nuitka-project: --deployment + +# The PySide6 plugin covers qt-plugins +# nuitka-project: --standalone +# nuitka-project: --output-dir=dist +# nuitka-project: --enable-plugin=pyside6 +# nuitka-project: --include-qt-plugins=qml +# nuitka-project: --noinclude-dlls=libQt6Charts* +# nuitka-project: --noinclude-dlls=libQt6Quick3D* +# nuitka-project: --noinclude-dlls=libQt6Sensors* +# nuitka-project: --noinclude-dlls=libQt6Test* +# nuitka-project: --noinclude-dlls=libQt6WebEngine* +# nuitka-project: --include-data-files={MAIN_DIRECTORY}/ui/icon.*=tidal_dl_ng/ui/ +# nuitka-project: --include-data-files={MAIN_DIRECTORY}/ui/default_album_image.png=tidal_dl_ng/ui/default_album_image.png +# nuitka-project: --include-data-files=./pyproject.toml=pyproject.toml +# nuitka-project: --force-stderr-spec="{TEMP}/tidal-dl-ng.err.log" +# nuitka-project: --force-stdout-spec="{TEMP}/tidal-dl-ng.out.log" +# nuitka-project: --company-name=exislow + + import math import sys import time |
