mirror of
https://github.com/mwisnowski/mtg_python_deckbuilder.git
synced 2025-09-22 04:50:46 +02:00
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:
parent
e52dfd7bb5
commit
8fa040a05a
3 changed files with 46 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue