Files
Inventory-Management-System/build_exe.py
T
star 5060d027e5 feat: 多工厂/厂间调拨/替代料/流水台账折叠 + 重写 README
- 多工厂(factory 表) + 顶栏工厂下拉过滤, 库存按厂聚合
- 厂间调拨(transfer): 源厂减+目标厂加, 总库存不变, 双向流水对账
- 替代料关系(substitute): 出库/BOM领料/生产领料缺料时提示可替代料
- 流水台账(ledger): 入出按日期合并折叠, 按日期导出同一 Excel
- 生产订单增强: 编辑/删除(级联清关联流水)/调入数量/确认调入=厂间调拨
- 入库新增送货日期字段; 出库物料编码扫码定位
- 重写 README 补全全部模块; .gitignore 排除 dist_pkg/build_pkg/*.db
- 停止跟踪 instance/app.db(运行时自动生成)
2026-09-29 11:17:48 +08:00

36 lines
1.2 KiB
Python

"""打包单文件 EXE (PyInstaller --onefile --windowed)
冻结后:
- 模板/静态走 sys._MEIPASS (用 --add-data 打入)
- 库文件 app.db 落在 exe 同目录 (app.py 中 EXE_DIR 处理)
- 启动时自动打开浏览器 (app.py __main__ 中 webbrowser.open)
用法: venv 的 python build_exe.py
"""
import os, sys, platform
from PyInstaller.__main__ import run
HERE = os.path.dirname(os.path.abspath(__file__))
sep = ";" if platform.system() == "Windows" else ":"
args = [
os.path.join(HERE, "app.py"),
"--onefile",
"--windowed",
"--name", "MaterialWMS",
"--distpath", os.path.join(HERE, "dist_pkg"),
"--workpath", os.path.join(HERE, "build_pkg"),
"--specpath", os.path.join(HERE, "build_pkg"),
"--add-data", os.path.join(HERE, "templates") + sep + "templates",
"--add-data", os.path.join(HERE, "static") + sep + "static",
"--hidden-import", "flask",
"--hidden-import", "flask_sqlalchemy",
"--hidden-import", "sqlalchemy",
"--hidden-import", "openpyxl",
"--hidden-import", "excel_io",
"--noconfirm",
]
print("PyInstaller args:", args)
run(args)
print("BUILD DONE ->", os.path.join(HERE, "dist", "MaterialWMS.exe"))