Fix #117: include .md prompt files in wheel + handle Windows temp-dir cleanup

Fix 1: Add [tool.setuptools.package-data] to pyproject.toml so that
all .md prompt files (generic prompts under skillopt/prompts/ and
env-specific prompts under skillopt/envs/*/prompts/) are included
in the wheel. Previously pip install from PyPI would fail with
FileNotFoundError on first prompt load.

Fix 2: Replace TemporaryDirectory context manager with mkdtemp +
shutil.rmtree(ignore_errors=True) in claude_backend._run_claude_print.
On Windows, the spawned claude/node subprocess still holds a handle
on the temp directory when the context manager tries to clean up,
causing WinError 32. Manual rmtree with ignore_errors=True works
on all Python versions >= 3.10.

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
nankingjing
2026-07-14 11:17:19 +08:00
parent 50fed2958b
commit df5bf20f09
2 changed files with 10 additions and 1 deletions
+3
View File
@@ -73,6 +73,9 @@ Issues = "https://github.com/microsoft/SkillOpt/issues"
# skillopt_webui = the Gradio dashboard (installed via the `webui` extra)
include = ["skillopt", "skillopt.*", "skillopt_sleep", "skillopt_sleep.*", "skillopt_webui", "skillopt_webui.*", "scripts*"]
[tool.setuptools.package-data]
"*" = ["*.md"]
[tool.ruff]
line-length = 120
target-version = "py310"