diff --git a/.github/workflows/macos-installer-arm.yml b/.github/workflows/macos-installer-arm.yml index bb22f47a..9b544ff9 100644 --- a/.github/workflows/macos-installer-arm.yml +++ b/.github/workflows/macos-installer-arm.yml @@ -342,6 +342,26 @@ jobs: 'qrcode.image.pil', 'routes', 'main', + # Apprise notification support + 'apprise', + 'apprise.common', + 'apprise.conversion', + 'apprise.decorators', + 'apprise.locale', + 'apprise.logger', + 'apprise.manager', + 'apprise.utils', + 'apprise.URLBase', + 'apprise.AppriseAsset', + 'apprise.AppriseAttachment', + 'apprise.AppriseConfig', + 'apprise.cli', + 'apprise.config', + 'apprise.attachment', + 'apprise.plugins', + 'markdown', + 'yaml', + 'cryptography', ], hookspath=['hooks'], hooksconfig={}, @@ -406,7 +426,7 @@ jobs: EOF - name: Build macOS app bundle - run: python -m PyInstaller Huntarr.spec --clean + run: python -m PyInstaller Huntarr.spec --clean --collect-all apprise - name: Create PKG installer run: | diff --git a/.github/workflows/macos-installer-intel.yml b/.github/workflows/macos-installer-intel.yml index 6130095d..8f4c73b0 100644 --- a/.github/workflows/macos-installer-intel.yml +++ b/.github/workflows/macos-installer-intel.yml @@ -338,6 +338,26 @@ jobs: 'qrcode.image.pil', 'routes', 'main', + # Apprise notification support + 'apprise', + 'apprise.common', + 'apprise.conversion', + 'apprise.decorators', + 'apprise.locale', + 'apprise.logger', + 'apprise.manager', + 'apprise.utils', + 'apprise.URLBase', + 'apprise.AppriseAsset', + 'apprise.AppriseAttachment', + 'apprise.AppriseConfig', + 'apprise.cli', + 'apprise.config', + 'apprise.attachment', + 'apprise.plugins', + 'markdown', + 'yaml', + 'cryptography', ], hookspath=['hooks'], hooksconfig={}, @@ -402,7 +422,7 @@ jobs: EOF - name: Build macOS app bundle - run: python -m PyInstaller Huntarr.spec --clean + run: python -m PyInstaller Huntarr.spec --clean --collect-all apprise - name: Create PKG installer run: | diff --git a/.github/workflows/windows-build-nsis.yml b/.github/workflows/windows-build-nsis.yml index 792ada05..1b62ace5 100644 --- a/.github/workflows/windows-build-nsis.yml +++ b/.github/workflows/windows-build-nsis.yml @@ -45,6 +45,10 @@ jobs: pip install -r requirements.txt pip install pyinstaller==5.13.0 pip install pywin32 + # Explicitly install apprise and its dependencies for Windows build + pip install apprise==1.6.0 + pip install markdown==3.4.3 + pip install pyyaml==6.0 - name: Create directories run: | @@ -60,7 +64,9 @@ jobs: # Use the dedicated build script from the distribution directory python -m pip install -r requirements.txt python -m pip install pywin32 - pyinstaller -y distribution/windows/huntarr.spec + + # Build with apprise support - use --collect-all apprise to fix attachment directory error + pyinstaller -y --collect-all apprise distribution/windows/huntarr.spec # Display contents of dist/Huntarr dir dist/Huntarr diff --git a/distribution/windows/build.py b/distribution/windows/build.py index 473885fc..fadc1085 100644 --- a/distribution/windows/build.py +++ b/distribution/windows/build.py @@ -64,7 +64,8 @@ def build_exe(): # Make sure we're in the project root directory when running PyInstaller # This helps with finding relative paths # Add the -y option to force overwrite of the output directory - result = run_command([sys.executable, "-m", "PyInstaller", "-y", str(spec_file)], cwd=str(ROOT_DIR)) + # Add --collect-all apprise to bundle all apprise data files and dependencies + result = run_command([sys.executable, "-m", "PyInstaller", "-y", "--collect-all", "apprise", str(spec_file)], cwd=str(ROOT_DIR)) if not result: print("ERROR: PyInstaller failed to build the executable") diff --git a/distribution/windows/huntarr.spec b/distribution/windows/huntarr.spec index 781594a4..4e4874dd 100644 --- a/distribution/windows/huntarr.spec +++ b/distribution/windows/huntarr.spec @@ -41,6 +41,27 @@ datas = [ (str(project_dir / 'src'), 'src'), ] +# Add apprise data files to fix attachment directory error +try: + import apprise + import os + apprise_path = os.path.dirname(apprise.__file__) + # Add apprise's attachment, plugins, and config directories + apprise_attachment_path = os.path.join(apprise_path, 'attachment') + apprise_plugins_path = os.path.join(apprise_path, 'plugins') + apprise_config_path = os.path.join(apprise_path, 'config') + + if os.path.exists(apprise_attachment_path): + datas.append((apprise_attachment_path, 'apprise/attachment')) + if os.path.exists(apprise_plugins_path): + datas.append((apprise_plugins_path, 'apprise/plugins')) + if os.path.exists(apprise_config_path): + datas.append((apprise_config_path, 'apprise/config')) + + print(f"Added apprise data directories from: {apprise_path}") +except ImportError: + print("Warning: apprise not found, skipping apprise data files") + # Add tools directory if it exists if os.path.exists(str(project_dir / 'tools')): datas.append((str(project_dir / 'tools'), 'tools'))