PyOZ v0.4.0
What's New in v0.4.0
Added
-
Automatic
.pyistub generation - Type stubs are now generated at compile time- Full Python type hints for all exported functions, classes, methods, and properties
- Supports complex types:
list[T],dict[K, V],tuple[...],Optional[T],Union[...] - Docstrings are included in generated stubs
- Stubs are automatically embedded in the compiled binary and extracted during wheel building
- Works with stripped binaries via dedicated
.pyozstubsection that survives stripping - New
--no-stubsflag forpyoz buildto disable stub generation - New
--stubsflag (default) to explicitly enable stub generation
-
Strip support in pyproject.toml - Binary stripping now fully functional
- Added
strip = trueoption in[tool.pyoz]section - Stubs survive stripping via section-based embedding with
PYOZSTUBmagic header - Works with all optimization levels including
ReleaseSmall
- Added
-
Cross-platform symreader - Extract embedded data from compiled modules
- Supports ELF (Linux), PE (Windows), and Mach-O (macOS) binary formats
- Section-based extraction (
.pyozstub) for stripped binaries - Symbol-based extraction (
__pyoz_stubs_data__,__pyoz_stubs_len__) as fallback - Comprehensive test suite with cross-compiled test binaries for all formats
-
Symreader tests in build.zig - Test infrastructure for binary format parsing
- Cross-compiles test stub libraries for x86_64-linux, x86_64-windows, x86_64-macos
- Tests ELF, PE, and Mach-O parsers with real binaries
- Uses
b.addWriteFiles()to inject test code at build time
Changed
- Generated
build.zigtemplate now includes-Dstripoption support - Stubs are embedded in both symbol form (for non-stripped) and section form (for stripped)
- Section names:
.pyozstub(ELF/PE),__DATA,__pyozstub(Mach-O)
Installation
Download the binary for your platform and add it to your PATH:
| Platform | Binary |
|---|---|
| Linux x86_64 | pyoz-x86_64-linux |
| Linux ARM64 | pyoz-aarch64-linux |
| macOS x86_64 | pyoz-x86_64-macos |
| macOS ARM64 (Apple Silicon) | pyoz-aarch64-macos |
| Windows x86_64 | pyoz-x86_64-windows.exe |
| Windows ARM64 | pyoz-aarch64-windows.exe |
Source
Download PyOZ-0.4.0.tar.gz for the source code.
Quick Start
pyoz init mymodule
cd mymodule
pyoz build
pip install dist/*.whl