fix(packaging): include all subpackages and prompt files in wheel#43
Open
fuleinist wants to merge 1 commit into
Open
fix(packaging): include all subpackages and prompt files in wheel#43fuleinist wants to merge 1 commit into
fuleinist wants to merge 1 commit into
Conversation
Fixes federicodeponte#26. `pyproject.toml` declared `packages = ["engine"]`, which only ships the top-level `engine` package — `engine.concurrency`, `engine.opendraft`, `engine.phases`, `engine.utils`, and the `engine/prompts/*.md` data files were silently dropped from the wheel. After a fresh `pip install`, users hit: FileNotFoundError: Prompt file not found: prompts/01_research/scribe.md because the prompt directory never made it into the installed package, even after `pip install --force-reinstall`. Replace the explicit `packages` list with `[tool.setuptools.packages.find] include = ["engine*"]` so every subpackage under `engine/` is auto-discovered, and move the `package-data` declaration into its own table. Verified by building a wheel and inspecting it: the new wheel contains `engine.concurrency/`, `engine.opendraft/`, `engine.phases/`, `engine.utils/api_citations/`, `engine.utils/pdf_engines/`, and the full `engine/prompts/` tree including the previously-missing `prompts/01_research/scribe.md`. Adds tests/test_packaging_subpackages.py with three regression checks: - pyproject must use packages.find OR list every subpackage explicitly - prompt files (incl. the exact one from federicodeponte#26) exist on disk - package-data declares prompts/**/*.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #26.
Root cause
pyproject.tomldeclared:This only ships the top-level
enginepackage. Every subpackage —engine.concurrency,engine.opendraft,engine.phases,engine.utils,engine.utils.api_citations,engine.utils.pdf_engines— was silently dropped from the wheel. Theprompts/**/*.mdpackage-data glob then resolved against an empty directory, soengine/prompts/01_research/scribe.md(and every other prompt file) was missing from installed packages.Fix
Replace the explicit
packageslist with auto-discovery:Verification
Built a wheel with the patched config and inspected its contents. The new wheel ships:
engine/concurrency/,engine/opendraft/,engine/phases/,engine/utils/api_citations/,engine/utils/pdf_engines/engine/prompts/tree, including the previously-missingprompts/01_research/scribe.mdfrom the bug reportTests
Adds
tests/test_packaging_subpackages.pywith three regression checks:pyprojectmust usepackages.findOR explicitly list every subpackagescribe.mdfrom [BUG] "FileNotFoundError: Prompt file not found: prompts/01_research/scribe.md – file is missing from the installed package even after force-reinstall" #26) exist on diskpackage-datadeclaresprompts/**/*.mdAll 3 pass.
Surgical change: 4 lines removed, 7 lines added in
pyproject.toml; one new test file.