fix(build): make PyInstaller include backend modules

This commit is contained in:
2026-01-31 12:40:48 +01:00
parent 9d57df0dd0
commit 9477da4e43
4 changed files with 44 additions and 4 deletions

View File

@@ -0,0 +1,38 @@
# -*- mode: python ; coding: utf-8 -*-
a = Analysis(
['app.py'],
pathex=['backend'],
binaries=[],
datas=[],
hiddenimports=['p2pk', 'p2pkh', 'p2sh', 'p2tr', 'p2wpkh'],
hookspath=[],
hooksconfig={},
runtime_hooks=[],
excludes=[],
noarchive=False,
optimize=0,
)
pyz = PYZ(a.pure)
exe = EXE(
pyz,
a.scripts,
a.binaries,
a.datas,
[],
name='addressgen-backend',
debug=False,
bootloader_ignore_signals=False,
strip=False,
upx=True,
upx_exclude=[],
runtime_tmpdir=None,
console=True,
disable_windowed_traceback=False,
argv_emulation=False,
target_arch=None,
codesign_identity=None,
entitlements_file=None,
)

View File

@@ -9,8 +9,9 @@ from fastapi.middleware.cors import CORSMiddleware
from pydantic import BaseModel
ROOT_DIR = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))
if ROOT_DIR not in sys.path:
sys.path.insert(0, ROOT_DIR)
BACKEND_DIR = os.path.abspath(os.path.dirname(__file__))
if BACKEND_DIR not in sys.path:
sys.path.insert(0, BACKEND_DIR)
import p2pk
import p2pkh
@@ -170,7 +171,7 @@ def run():
import uvicorn
port = int(os.getenv("ADDRESSGEN_PORT", "8732"))
uvicorn.run("backend.app:app", host="127.0.0.1", port=port, log_level="info")
uvicorn.run(app, host="127.0.0.1", port=port, log_level="info")
if __name__ == "__main__":