將 Flask 應用重構為正式的 Python package 結構: - 新增 src/mes_dashboard/ package 取代 apps/ 目錄 - 實作 Application Factory pattern (create_app()) - 移除所有 sys.path.insert hacks,使用標準 import - 新增 pyproject.toml 定義 package metadata - 新增 gunicorn.conf.py 部署設定 - 新增 NoOpCache 抽象層,預留未來擴充 - 新增單元測試 tests/test_app_factory.py - 更新 .gitignore 支援新架構 - 新增 OpenSpec 規格文件追蹤變更 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
42 lines
977 B
TOML
42 lines
977 B
TOML
[build-system]
|
|
requires = ["setuptools>=68", "wheel"]
|
|
build-backend = "setuptools.build_meta"
|
|
|
|
[project]
|
|
name = "mes-dashboard"
|
|
version = "0.1.0"
|
|
description = "MES Dashboard Portal"
|
|
readme = "README.md"
|
|
requires-python = ">=3.9"
|
|
license = { text = "MIT" }
|
|
authors = [
|
|
{ name = "MES Dashboard Team" }
|
|
]
|
|
keywords = ["flask", "mes", "dashboard"]
|
|
classifiers = [
|
|
"Programming Language :: Python :: 3",
|
|
"Programming Language :: Python :: 3 :: Only",
|
|
"Programming Language :: Python :: 3.9",
|
|
"License :: OSI Approved :: MIT License",
|
|
]
|
|
dependencies = [
|
|
"oracledb>=2.0.0",
|
|
"flask>=3.0.0",
|
|
"pandas>=2.0.0",
|
|
"sqlalchemy>=2.0.0",
|
|
"openpyxl>=3.0.0",
|
|
"python-dotenv>=1.0.0",
|
|
"gunicorn>=21.2.0",
|
|
"waitress>=2.1.2; platform_system == 'Windows'",
|
|
]
|
|
|
|
[tool.setuptools]
|
|
package-dir = {"" = "src"}
|
|
include-package-data = true
|
|
|
|
[tool.setuptools.packages.find]
|
|
where = ["src"]
|
|
|
|
[tool.setuptools.package-data]
|
|
mes_dashboard = ["templates/**/*"]
|