From 7ce2108fff04b91e6217222f9a614462110da711 Mon Sep 17 00:00:00 2001 From: chakcy <947105045@qq.com> Date: Thu, 27 Aug 2026 17:00:35 +0800 Subject: [PATCH] modify: version: 0.2.0 --- pyproject.toml | 2 +- src/chongming_cli/build.py | 42 ++++++++++++++++++++------------------ 2 files changed, 23 insertions(+), 21 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 3437551..d343efc 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ requires = ["hatchling"] [project] name = "chongming-cli" -version = "0.1.1" +version = "0.1.2" description = "chongming 命令脚本集合:构建打包 / 进程插件打包 / 插件脚手架 / 模型生成" readme = "README.md" requires-python = ">=3.12" diff --git a/src/chongming_cli/build.py b/src/chongming_cli/build.py index d60264c..4cebab2 100644 --- a/src/chongming_cli/build.py +++ b/src/chongming_cli/build.py @@ -313,8 +313,9 @@ def _stage_pyinstaller(config: Config) -> tuple[str, str]: "PyInstaller", "--onefile", "--noconfirm", - "--optimize", - "2", + "--exclude-module", "tkinter", + "--optimize=2", + # "2", "--name", "chongming", "--distpath", @@ -323,7 +324,7 @@ def _stage_pyinstaller(config: Config) -> tuple[str, str]: "./build_temp", "--specpath", "./specs", - "--clean", + "--clean" ] if not is_windows: cmd.append("--strip") @@ -363,25 +364,25 @@ def _stage_nuitka(config: Config) -> tuple[str, str]: "windows" if is_windows else "linux", [] ) - packages = [ - "module_bank", - "sqlite_vfs", - "fastapi", - "uvicorn", - "gunicorn", - "diskcache", - "chongming_cache", - "chongming_cache.backends", - "chongming_cache.backends.disk", - "apscheduler", - "tomli", - "typing_extensions", - ] + # packages = [ + # "module_bank", + # "sqlite_vfs", + # "fastapi", + # "uvicorn", + # "gunicorn", + # "diskcache", + # "chongming_cache", + # "chongming_cache.backends", + # "chongming_cache.backends.disk", + # "tomli", + # "typing_extensions", + # ] cmd = [ sys.executable, "-m", "nuitka", + "--clang", "--standalone", "--onefile", "--follow-imports", @@ -392,16 +393,17 @@ def _stage_nuitka(config: Config) -> tuple[str, str]: "--pgo-c", "--pgo-python", "--disable-plugin=tk-inter", - "--enable-plugin=numpy", "--output-dir=.", "--output-filename=chongming", "main.py", "--jobs=4", ] + # export LDFLAGS="-fuse-ld=lld" + # export LDFLAGS="-fuse-ld=lld-20" if shutil.which("upx"): cmd.append("--enable-plugin=upx") - for pkg in packages: - cmd.append(f"--include-package={pkg}") + # # for pkg in packages: + # cmd.append(f"--include-package={pkg}") for mod in list(base_imports) + extra: cmd.append(f"--include-module={mod}")