You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(zip-includes): implement type:zip support for composing builds from pre-built modules
Add support for `type: "zip"` in include configurations to enable merging zip file
contents into the output. This allows composing builds from pre-built .pyz modules.
Features:
- New config syntax: { "path": "feature.pyz", "type": "zip", "dest": "plugins/" }
- New CLI flag: --add-zip PATH[:dest] for adding zips with optional remapping
- Exclude patterns apply to zip contents
- Proper merge precedence with other include types
- Full shebang handling when reading zip files
- Metadata and entry point detection to avoid duplicates
Implementation:
- Add type: "zip" to IncludeConfig and IncludeResolved TypedDicts
- New --add-zip CLI argument with extend action
- Updated include resolution with proper precedence ordering
- Zip extraction with dest remapping and exclude filtering
- Helper function _should_exclude_file() for pattern matching
- Comprehensive test coverage (6 new tests)
Code Quality:
- Add pathspec import to build.py top-level imports
- Fix exception handling in _should_exclude_file to catch ValueError
- Convert f-strings to % formatting in logging statements
- Fix variable shadowing and naming conflicts
- Break up long lines to comply with 88-character limit
- Add proper type annotations and type ignore comments
- Update config validation pyright ignores
Documentation:
- Add --add-zip flag documentation with examples
- Update include configuration examples to show type: "zip" syntax
- Document type field in IncludeConfig section
- Update ROADMAP.md with implementation status
Testing:
- All 284 tests pass with no regressions
- 6 new comprehensive tests for zip include functionality
- 1 skipped test (expected)
Copy file name to clipboardExpand all lines: docs/cli-reference.md
+40Lines changed: 40 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -70,6 +70,7 @@ zipbundler build [OPTIONS]
70
70
-`-e, --exclude PATTERNS`: Override exclude patterns from config
71
71
-`--add-exclude PATTERNS`: Additional exclude patterns to append to config excludes (CLI only)
72
72
-`-o, --output PATH`: Override output path from config
73
+
-`--input PATH`, `--in PATH`: Use an existing zipapp as the starting point. Can be a file path or directory. When a directory is given, zipbundler resolves the zip file name using the output filename
73
74
-`-m, --main ENTRY_POINT`: Override entry point from config
74
75
-`-p, --shebang PYTHON`: Override shebang from config
0 commit comments