build(windows): fix PyInstaller packaging\n\n- Add spec file with hiddenimports and data dirs\n- Use spec in release workflow; fallback to --paths code\n- Insert ./code into sys.path when frozen to resolve local imports

This commit is contained in:
mwisnowski 2025-08-25 09:57:02 -07:00
parent e52dfd7bb5
commit 8fa040a05a
3 changed files with 46 additions and 2 deletions

View file

@ -11,12 +11,19 @@ from pathlib import Path
import json
from typing import NoReturn
# Ensure local package resolution in frozen builds
import os
if getattr(sys, 'frozen', False): # PyInstaller frozen
base = os.path.dirname(sys.executable)
code_dir = os.path.join(base, 'code')
if os.path.isdir(code_dir) and code_dir not in sys.path:
sys.path.insert(0, code_dir)
# Local imports
from deck_builder import DeckBuilder
from file_setup.setup import initial_setup
from tagging import tagger
import logging_util
import os
from settings import CSV_DIRECTORY
# Create logger for this module