Professional Cross-Platform Python Application Packaging Solution
UnifyPy 2.0 is an enterprise-grade cross-platform Python application packaging tool that supports packaging Python projects into native installers for Windows, macOS, and Linux platforms.
- 🔄 Multi-Platform Support (64-bit): Windows (
exe/msi), macOS (dmg+ notarization), Linux (deb/rpm/appimage) - ⚡ Parallel Building: Multi-format parallel generation to significantly speed up multi-target releases
- 🛡️ Enterprise Features: Automatic rollback, session management, actionable error diagnostics
- 🎨 Dual-Native Terminal Output: Live 5-line rolling log window on interactive TTYs (auto-collapses on stage completion) and native collapsible
::group::blocks on GitHub Actions - 🔧 Validated Configuration: 30+ PyInstaller parameters with optional JSON Schema validation
- 📦 Automated Tooling: Single-probe memoized tool detection and SHA256-verified tool downloads
- 🍎 macOS Permissions & Signing: Standard-library
plistlibgeneration forentitlements.plistandInfo.plist, ad-hoc / Developer ID signing, andnotarytoolnotarization - 🖼️ Cross-Platform Icon Conversion: Automatic
PNG → ICO(Windows) andPNG → ICNS(macOS) conversion - 🧩 Plugin Architecture: Fail-fast event-driven lifecycle engine supporting external plugins
- Python 3.8+
- Windows 10+ / macOS 10.14+ / Linux (Ubuntu 18.04+)
💡 Note: UnifyPy invokes
PyInstallerinside the active Python environment to analyze imports—install it into the target project's virtual environment.
# pip (recommended with [schema] extra for build.json validation)
pip install "unifypy[schema]"
# uv-managed projects (recommended as a dev dependency inside .venv)
uv add --dev "unifypy[schema]"
uv run unifypy . --config build.json- Windows: Inno Setup (auto-detected)
- macOS: create-dmg (bundled), Xcode Command Line Tools
- Linux: dpkg-dev, rpm-build, fakeroot (auto-install guidance as needed)
Use the interactive wizard to quickly generate configuration files:
# Launch interactive configuration wizard
unifypy . --init
# Or specify project directory
unifypy /path/to/project --initThe wizard will guide you through:
- Basic information (name, version, entry file, etc.)
- Target platform selection (macOS/Windows/Linux)
- PyInstaller packaging configuration
- Platform-specific configuration (permissions, icons, install options, etc.)
- Generate
build.jsonconfiguration file - Optionally start building immediately
💡 Tip: After the wizard completes, it generates a standard
build.jsonfile that you can manually edit to add advanced configurations. See Interactive Wizard Guide for details.
# Package using configuration file
unifypy . --config build.json
# Quick packaging via command line
unifypy . --name myapp --app-version 1.0.0 --entry main.py --onefile
# Multi-format parallel build
unifypy . --config build_comprehensive.json --parallel --max-workers 4
# Verbose output mode
unifypy . --config build.json --verbose
# Clean rebuild
unifypy . --config build.json --clean --verbose
# Generate executable only, skip installer
unifypy . --config build.json --skip-installer
# Specify specific format
unifypy . --config build.json --format dmg --parallel
# macOS development mode (automatic permission configuration)
unifypy . --config build.json --development --verbose
# Dry run (env check + prepare only)
unifypy . --config build.json --dry-run- Lifecycle events:
on_start → handle_rollback_commands → load_config → environment_check → prepare → build_executable → generate_installers → on_success → on_exit - Extend by subscribing to events with your plugin class.
- External plugins (top-level in build.json):
{
"plugins": [
"my_package.my_plugin:MyPlugin"
]
}Create build.json — define shared metadata and pyinstaller options once at the top level; per-OS sections (windows / macos / linux) inherit top-level values automatically unless explicitly overridden (legacy platforms.<os> nesting remains 100% supported):
{
"name": "MyApp",
"display_name": "My Application",
"version": "1.0.0",
"publisher": "My Company <dev@example.com>",
"description": "My Cross-Platform Python Application",
"url": "https://example.com/myapp",
"entry": "main.py",
"icon": "assets/icon.png",
"license": "LICENSE",
"pyinstaller": {
"onefile": false,
"windowed": true,
"add_data": ["assets:assets", "config:config"],
"hidden_import": ["requests"]
},
"windows": {
"pyinstaller": {
"contents_directory": "."
},
"inno_setup": {
"create_desktop_icon": true,
"create_start_menu_icon": true,
"run_after_install": true,
"languages": ["english", "chinesesimplified"]
}
},
"macos": {
"bundle_identifier": "com.mycompany.myapp",
"microphone_usage_description": "Microphone access required for voice features",
"camera_usage_description": "Camera access required for video features",
"dmg": {
"window_size": [600, 400],
"icon_size": 100
}
},
"linux": {
"deb": {
"depends": ["python3 (>= 3.8)", "libgtk-3-0"]
},
"rpm": {
"license": "MIT"
}
},
"plugins": [
"my_package.my_plugin:MyPlugin"
]
}unifypy <project_dir> [options]| Parameter | Description | Example |
|---|---|---|
project_dir |
Python project root directory path (defaults to .) |
. or /path/to/project |
--config CONFIG |
Configuration file path (JSON format) | --config build.json |
--name NAME |
Application name | --name MyApp |
--display-name DISPLAY_NAME |
Application display name | --display-name "My Application" |
--entry ENTRY |
Entry Python file | --entry main.py |
--app-version VERSION |
Application version | --app-version 1.0.0 |
--version |
Print UnifyPy tool version and exit | --version |
--publisher PUBLISHER |
Publisher name | --publisher "My Company" |
| Parameter | Description | Example |
|---|---|---|
--icon ICON |
Icon file path | --icon assets/app.png |
--license LICENSE |
License file path | --license LICENSE.txt |
--readme README |
README file path | --readme README.md |
--hooks HOOKS |
Runtime hooks directory | --hooks hooks/ |
| Parameter | Description | Example |
|---|---|---|
--onefile |
Generate single-file executable | --onefile |
--onedir, --no-onefile |
Generate directory bundle (overrides onefile: true in config) |
--onedir |
--windowed |
Windowed mode (no console) | --windowed |
--console |
Console mode (overrides windowed: true in config) |
--console |
| Parameter | Description | Example |
|---|---|---|
--skip-exe |
Skip executable build | --skip-exe |
--skip-installer |
Skip installer build | --skip-installer |
--clean |
Clean previous build files | --clean |
--init |
Launch inline interactive wizard to generate build.json |
--init |
--dry-run |
Run config validation, tool check, and staging check without building | --dry-run |
--format FORMAT |
Specify output format (exe,msi,dmg,deb,rpm,appimage) |
--format dmg |
--notarize |
Submit macOS artifact to Apple notarytool and staple ticket |
--notarize |
--allow-auto-install |
Auto-install missing tools (enabled by default; Inno Setup remains manual) | --allow-auto-install |
--no-allow-auto-install |
Disable auto-install and print setup instructions only | --no-allow-auto-install |
| Parameter | Description | Example |
|---|---|---|
--inno-setup-path INNO_SETUP_PATH |
Inno Setup executable path | --inno-setup-path /path/to/ISCC.exe |
| Parameter | Description | Example |
|---|---|---|
--verbose, -v |
Show verbose output | --verbose or -v |
--quiet, -q |
Silent mode | --quiet or -q |
| Parameter | Description | Example |
|---|---|---|
--parallel |
Enable parallel building | --parallel |
--max-workers MAX_WORKERS |
Maximum parallel worker threads | --max-workers 4 |
| Parameter | Description | Example |
|---|---|---|
--no-rollback |
Disable automatic rollback | --no-rollback |
--rollback SESSION_ID |
Execute rollback for specified session | --rollback abc123 |
--list-rollback |
List available rollback sessions | --list-rollback |
| Parameter | Description | Example |
|---|---|---|
--development |
Force development version (enable debug permissions) | --development |
--production |
Production version (disable debug permissions, for signed apps only) | --production |
| Parameter | Description | Example |
|---|---|---|
-h, --help |
Show help information and exit | --help |
The interactive wizard provides a friendly interface that guides you through configuration file creation via Q&A.
# Launch in current project directory
unifypy . --init
# Specify project directory
unifypy /path/to/project --init| Configuration | Description | Default | Purpose |
|---|---|---|---|
| Entry file | Python entry file | main.py |
Specifies the main program entry point, PyInstaller analyzes dependencies from this file |
| Project name | Project name | Inferred from entry file | Used for executable file name, automatically converted to legal file name format |
| Display name | Display name | Same as project name | Name displayed in installer and application menu, supports Chinese and spaces |
| Version | Version number | 1.0.0 |
Application version, recommended to use semantic versioning (e.g. 1.0.0, 2.1.3) |
| Publisher | Publisher | Optional | Publisher or company name, used for installer and application info |
| Description | Application description | Optional | Brief application description, used for package managers and installers |
| Icon path | Icon path | assets/icon.png |
Application icon, supports PNG/ICO/ICNS formats, UnifyPy auto-converts |
Operation:
- Enter text and press
Enterto confirm - Press
Enterdirectly to use default value - Enter
?to view detailed help
| Platform | Supported Formats | Description |
|---|---|---|
| macOS | DMG disk image | Standard macOS installer format, drag-and-drop installation |
| Windows | EXE installer | Standard Windows installer based on Inno Setup |
| Linux | DEB, RPM, AppImage | DEB (Debian/Ubuntu), RPM (RedHat/CentOS), AppImage (universal portable) |
Operation:
- Use
↑↓arrow keys to move cursor - Press
Spaceto select/deselect - Press
Enterto confirm selection - Current platform is selected by default
| Configuration | Options | Description | Recommended Scenarios |
|---|---|---|---|
| Single file mode | Yes / No | onefile: true/false |
Yes: Single executable file, easy to distribute but slower startup No: Directory mode, includes dependencies, fast startup but more files |
| Windowed mode | Yes / No | windowed: true/false |
Yes: Window application, hides console window (GUI apps) No: Console application, shows command-line window (CLI tools) |
| Data directories | Multi-select | Resource directories to package | Auto-scans project directories, recommends common directories (assets, models, src, etc.) Selected directories will be packaged into the application |
Operation:
- Single file mode / Windowed mode: Use
←→left/right arrow keys to switch,Enterto confirm - Data directories: Use
↑↓up/down keys to move,Spaceto select,Enterto confirm
Data Directory Notes:
- ✅ Auto-recommended:
assets,resources,data,models,src,config, etc. - 🚫 Auto-excluded:
__pycache__,.git,venv,build,dist, etc. - 📊 Display info: File count and directory size
| Configuration | Description | Example | Purpose |
|---|---|---|---|
| Bundle Identifier | macOS app unique identifier | com.company.appname |
Used to identify the application, format: reverse domain + app name |
| Minimum macOS version | Minimum supported system version | 10.13 |
Specifies the minimum macOS version the app supports |
| App category | Application category | Productivity | Category in App Store and Launchpad |
| Permissions | System permissions selection | Multi-select | Select system permissions the app needs (microphone, camera, etc.) |
| Copyright | Copyright notice | © 2024 Company |
Copyright text displayed in application info |
Available Permissions List:
| Permission | Use Case | Corresponding Info.plist Key |
|---|---|---|
| Microphone (麦克风) | Recording, speech recognition | NSMicrophoneUsageDescription |
| Camera (摄像头) | Photography, video calls | NSCameraUsageDescription |
| Speech Recognition (语音识别) | Speech-to-text | NSSpeechRecognitionUsageDescription |
| Local Network (本地网络) | LAN access | NSLocalNetworkUsageDescription |
| Audio (音频) | Audio playback | NSAppleMusicUsageDescription |
| Accessibility (辅助功能) | Global shortcuts, automation | NSAccessibilityUsageDescription |
| Documents Folder (文档文件夹) | Read/write documents | NSDocumentsFolderUsageDescription |
| Downloads Folder (下载文件夹) | Manage downloads | NSDownloadsFolderUsageDescription |
| Apple Events (自动化) | AppleScript, inter-app communication | NSAppleEventsUsageDescription |
| Calendar (日历) | Read/write calendar events | NSCalendarsUsageDescription |
| Contacts (通讯录) | Read/write contacts | NSContactsUsageDescription |
| Location (位置) | Get geographic location | NSLocationUsageDescription |
| Photos (照片) | Access photo library | NSPhotoLibraryUsageDescription |
Operation:
- Use
↑↓arrow keys to move - Press
Spaceto select/deselect - Press
Enterto confirm selection
💡 Tip: Permission descriptions use generic text, you can customize description text in the generated
build.json.
| Configuration | Options | Description |
|---|---|---|
| Desktop icon | Yes / No | Whether to create desktop shortcut |
| Start menu shortcut | Yes / No | Whether to create start menu shortcut |
| Allow run after install | Yes / No | Whether to ask user to run app immediately after installation |
| Languages | Multi-select | Installer supported languages (Chinese, English, Japanese, etc.) |
Available Languages:
- Simplified Chinese (chinesesimplified)
- Traditional Chinese (chinesetraditional)
- English (english)
- Japanese (japanese)
- Korean (korean)
- French (french)
- German (german)
- Spanish (spanish)
Operation:
- Icons and shortcuts: Use
←→arrow keys,Enterto confirm - Languages: Use
↑↓up/down keys,Spaceto select,Enterto confirm
| Configuration | Options | Description |
|---|---|---|
| Package formats | DEB / RPM / AppImage | Select package formats to generate (multi-select) |
| Package name | Text | Package name (lowercase letters, numbers, hyphens) |
| Desktop categories | Multi-select | Application categories in desktop environment |
Package Format Description:
- DEB: Used by Debian, Ubuntu, Linux Mint, etc.
- RPM: Used by RedHat, CentOS, Fedora, etc.
- AppImage: Universal portable format, no installation required, double-click to run
Desktop Categories:
- AudioVideo (audio/video)
- Development (development)
- Education (education)
- Game (games)
- Graphics (graphics)
- Network (network)
- Office (office)
- Utility (utility)
- System (system)
The wizard displays a complete configuration summary, including:
- 📋 Project info (name, version, publisher, etc.)
- 📦 Packaging configuration (mode, console, data directories)
- 🌍 Target platforms and detailed configurations for each platform
After confirmation:
- Save as
build.jsonfile - Show advanced configuration options (can be manually edited)
- Ask whether to start building immediately
Immediate Build Option:
- Yes: Execute
unifypy . --config build.json --cleanto start packaging - No: Only save configuration, manually run later
After the wizard completes, it displays a prompt explaining how to manually edit build.json to add advanced configurations:
💡 You can manually edit build.json to add advanced configurations:
📘 PyInstaller Advanced Options:
• hidden_import: Dynamically imported modules
• exclude_module: Exclude unnecessary modules to reduce size
• runtime_hook: Runtime hook scripts
• splash: Splash screen
→ Reference: https://pyinstaller.org/en/stable/usage.html
🪟 Windows Advanced Options:
• compression: Compression algorithm
• license_file: License file
→ Reference: https://jrsoftware.org/ishelp/
🍎 macOS Advanced Options:
• target_architecture: Architecture selection
• codesign_identity: Code signing certificate
→ Reference: https://developer.apple.com/documentation/
🐧 Linux Advanced Options:
• depends: Dependency package list
• postinst_script: Post-installation script
→ See documentation in "Advanced Configuration Reference" section below
📚 Complete Configuration Examples:
• View build_comprehensive.json
- EXE (Inno Setup) - Standard wizard installer
- MSI (WiX Toolset) - Windows Installer package (experimental)
- DMG - Disk image installer (bundled
create-dmg, supports--notarize)
- DEB - Debian/Ubuntu package
- RPM - RHEL/CentOS/Fedora package
- AppImage - Portable single-file bundle
{
"name": "Application Name",
"display_name": "Display Name",
"version": "Version Number",
"publisher": "Publisher",
"entry": "Entry File",
"icon": "Icon File",
"license": "License File",
"readme": "README File"
}{
"pyinstaller": {
"onefile": false,
"windowed": true,
"clean": true,
"noconfirm": true,
"optimize": 2,
"strip": true,
"add_data": ["source_path:target_path"],
"hidden_import": ["module_name"],
"exclude_module": ["excluded_module"]
}
}{
"platforms": {
"macos": {
"bundle_identifier": "com.company.app",
"minimum_system_version": "10.14.0",
"category": "public.app-category.productivity",
"microphone_usage_description": "Microphone access required for voice features",
"camera_usage_description": "Camera access required for video features",
"dmg": {
"volname": "Installer Name",
"window_size": [600, 400],
"icon_size": 100
}
}
}
}UnifyPy supports all native configuration items of underlying tools. Configuration items are directly mapped to corresponding tool parameters, so you can refer to official documentation of each tool to use advanced features.
For detailed advanced configuration options, see:
📖 Advanced Configuration Documentation
Including:
- PyInstaller Advanced Configuration: hidden_import, exclude_module, runtime_hook, splash and 30+ configuration items
- Windows Advanced Configuration: Inno Setup script configuration, compression algorithms, installer wizard styles, etc.
- macOS Advanced Configuration: Info.plist configuration, DMG customization, code signing, architecture selection, etc.
- Linux Advanced Configuration: DEB/RPM package configuration, dependency management, installation scripts, etc.
The project provides strictly validated configuration examples for reference:
| File | Description |
|---|---|
build.json |
Minimal quick-start configuration |
build_comprehensive.json |
Complete Feature Reference, covering Windows/macOS/Linux multi-format and permission options |
View Complete Configuration:
# View complete configuration example (including all advanced options)
cat build_comprehensive.json
# Copy as your own configuration
cp build_comprehensive.json my_build.jsonUnifyPy 2.0 supports multi-format parallel building to significantly improve build efficiency:
# Enable parallel building
unifypy . --config build_comprehensive.json --parallel
# Specify number of worker threads
unifypy . --parallel --max-workers 4
# View parallel building effects
unifypy . --config build_comprehensive.json --parallel --verboseAutomatically track build operations with one-click rollback support:
# List available rollback sessions
unifypy . --list-rollback
# Execute rollback
unifypy . --rollback SESSION_ID
# Disable automatic rollback
unifypy . --config build.json --no-rollbackUnifyPy 2.0 provides a complete permission management solution for macOS applications:
# Development mode - auto-generate permission files, suitable for development and testing
unifypy . --config build.json --development
# Production mode - for signed applications
unifypy . --config build.json --production{
"platforms": {
"macos": {
"bundle_identifier": "com.company.myapp",
"microphone_usage_description": "Microphone access required for voice features",
"camera_usage_description": "Camera access required for video features",
"location_usage_description": "Location access required for location-based services"
}
}
}- ✅ Auto-generate entitlements.plist
- ✅ Auto-update Info.plist permission descriptions
- ✅ Auto ad-hoc code signing
- ✅ Auto icon format conversion (PNG → ICNS)
UnifyPy 2.0 solves path issues when packaging across directories:
# Packaging other projects from UnifyPy directory
cd /path/to/UnifyPy
unifypy ../my-project --config ../my-project/build.jsonRelative paths in configuration files are automatically resolved relative to the target project directory:
- ✅
"icon": "assets/icon.png"→/path/to/my-project/assets/icon.png - ✅
"add_data": ["data:data"]→/path/to/my-project/data:data - ✅ Support nested configurations and platform-specific paths
- Single files:
icon,license,readme,entry,setup_icon,version_file - Array fields:
add_data,add_binary,datas,binaries - Formats: Support both
source:destandsource;destseparators
UnifyPy 2.0 adopts an event-driven plugin-based architecture:
Engine + EventBus
UnifyPy 2.0's core uses an engine-driven plugin architecture that coordinates plugin lifecycle through an event bus:
# Build lifecycle events
ON_START → HANDLE_ROLLBACK_COMMANDS → LOAD_CONFIG →
ENVIRONMENT_CHECK → PREPARE → BUILD_EXECUTABLE →
GENERATE_INSTALLERS → ON_SUCCESS → ON_EXITPlugin System
All features are implemented as plugins, supporting priority control and external plugin extensions:
class MyPlugin(BasePlugin):
name = "my_plugin"
priority = 50 # Lower number = higher priority
def register(self, bus: EventBus):
bus.subscribe(ON_START, self.on_start, priority=self.priority)
bus.subscribe(BUILD_EXECUTABLE, self.on_build, priority=self.priority)External Plugin Support
Declare external plugins in configuration file:
{
"plugins": [
"my_package.my_plugin:MyPlugin",
"company.custom_plugin:CustomPlugin"
]
}Registry Pattern
# Dynamically register and lookup packagers
packager_registry = PackagerRegistry()
packager_class = packager_registry.get_packager("macos", "dmg")Strategy Pattern
# Each packager implements specific format packaging strategy
class DMGPackager(BasePackager):
def package(self, format_type, source_path, output_path):
# DMG-specific packaging logicEvent-Driven Pattern
# Plugins respond to different build phases by subscribing to events
bus.subscribe(PREPARE, self.prepare_build, priority=10)
bus.subscribe(BUILD_EXECUTABLE, self.build, priority=50)flowchart TD
CLI["CLI Entry & Wizard (__main__.py / cli/)"] --> Engine["Engine"]
Engine --> Bus["EventBus (Priority Ordered + Fail-Fast)"]
Engine --> Ctx["BuildContext"]
Bus --> PCfg["ConfigPlugin / EnvironmentPlugin / DryRunPlugin"]
Bus --> PExe["PyInstallerPlugin"]
Bus --> PPkg["PackagingPlugin / ParallelBuilder / MacOSNotarizePlugin"]
Bus --> PRb["AutoRollbackPlugin / SummaryPlugin / CleanupPlugin"]
PCfg --> CfgMgr["ConfigManager (Schema + 3-Layer Merge + Path Resolution)"]
PCfg --> ToolMgr["ToolManager (Memoized Probe + SHA256 Downloads)"]
PExe --> SpecBuilder["PyInstallerConfigBuilder + spec_renderer.py"]
PExe --> IconConv["IconConverter (PNG -> ICNS / ICO)"]
PExe --> MacPost["MacOSPostProcessor (plistlib + codesign)"]
PPkg --> Reg["PackagerRegistry + BasePackager"]
Reg --> WinPkg["Windows: InnoSetupPackager (iss_builder) & MSIPackager"]
Reg --> MacPkg["macOS: DMGPackager (create-dmg)"]
Reg --> LinPkg["Linux: common.py + DEB / RPM / AppImage"]
PExe --> Runner["SilentRunner Live Line Streaming (shell=False default)"]
Reg --> Runner
Runner --> Prog["ProgressManager (TTY 5-Line Tail / GitHub ::group::)"]
-
Initialization Phase (
ON_START)- Start adaptive
ProgressManager(TTY live rolling tail / GitHub Actions::group::) - Initialize
BuildContextand load external plugins
- Start adaptive
-
Config Loading Phase (
LOAD_CONFIG)- Validate against Draft-07 JSON Schema (when
[schema]is installed) - Merge Global → Platform → CLI arguments (supporting
--onedir/--consoleoverrides) - Resolve relative asset paths against the target project directory
- Validate against Draft-07 JSON Schema (when
-
Environment Check Phase (
ENVIRONMENT_CHECK)- Probe and memoize packaging tool paths once per run via
ToolManager - Perform SHA256-verified tool downloads or print setup instructions (supports
--dry-run)
- Probe and memoize packaging tool paths once per run via
-
Preparation Phase (
PREPARE)- Prepare staging/output directories and clean previous artifacts on
--clean - Initialize
RollbackManagersession snapshot
- Prepare staging/output directories and clean previous artifacts on
-
Executable Building (
BUILD_EXECUTABLE)- Convert icons (
PNG → ICNS / ICO) and render.specvia purespec_renderer.py - Stream
pyinstaller -youtput line-by-line viaSilentRunner - Update macOS
Info.plist/entitlements.plistviaplistliband runcodesign
- Convert icons (
-
Installer Generation (
GENERATE_INSTALLERS)- Dispatch OS packagers via
PackagerRegistry(serial orParallelBuilder) - Optionally submit macOS artifacts to
notarytoolandstapler
- Dispatch OS packagers via
-
Completion & Cleanup (
ON_SUCCESS/ON_EXIT)- Render borderless, copy-friendly artifact table without path truncation
- Clean temporary staging directories and persist
.unifypy/cache metadata
UnifyPy/
├── pyproject.toml # Package metadata, dependencies, Ruff & Pytest config
├── build.json # Minimal quick-start configuration example
├── build_comprehensive.json # Complete schema-validated configuration reference
├── docs/ # Bilingual advanced configuration guides
├── tests/ # Unit test suite (pytest)
└── unifypy/ # Source package
├── __main__.py # Unified CLI entry point
├── cli/ # Argument parser & interactive/ inline wizard
├── core/ # Engine, EventBus, BuildContext, ConfigManager, FormatResolver
├── plugins/ # Priority-ordered lifecycle stage plugins
├── pyinstaller/ # Option tables, PyInstallerConfigBuilder & pure spec_renderer.py
├── platforms/ # BasePackager, PackagerRegistry & OS packagers
│ ├── windows/ # Inno Setup (.exe / iss_builder.py) & WiX (.msi)
│ ├── macos/ # DMGPackager & MacOSPostProcessor
│ └── linux/ # Shared common.py + DEB / RPM / AppImage
├── schemas/ # build.schema.json (Draft-07)
├── templates/ # Inno Setup & packaging templates
├── tools/ # Bundled create-dmg script & tool manifests
└── utils/ # paths.py, ProgressManager, SilentRunner, ToolManager, IconConverter
Q: PyInstaller packaging failed?
# Check dependencies
pip install pyinstaller>=5.0
# Clean and retry
unifypy . --config build.json --clean --verboseQ: macOS permission configuration issues?
# Use development mode to auto-generate permission files
unifypy . --config build.json --development --verbose
# Check generated permission files
cat entitlements.plist- Check permission descriptions in configuration file
- Ensure Bundle ID format is correct (
com.company.appname) - Refer to PERMISSIONS.md and
build_comprehensive.json
Q: Linux dependencies missing?
# Ubuntu/Debian
sudo apt-get install dpkg-dev fakeroot
# CentOS/RHEL
sudo yum install rpm-buildQ: Parallel build failed?
# Reduce number of worker threads
unifypy . --parallel --max-workers 2
# Or disable parallel building
unifypy . --config build.jsonQ: Configuration file paths not found?
# Ensure relative paths are relative to project directory
# ✅ Correct: Project at /path/to/myapp, icon at /path/to/myapp/assets/icon.png
"icon": "assets/icon.png"
# ❌ Wrong: Using paths relative to UnifyPy directory
"icon": "../myapp/assets/icon.png"
# Check path resolution
unifypy . --config build.json --verbose- Enable verbose output:
--verbose - Check logs: View detailed build process information
- Step-by-step build: Use
--skip-exeor--skip-installer - Rollback testing: Use
--list-rollbackto view history - Path issues: Check if relative paths in config file are correct
- Permission issues: Use
--developmentmode on macOS for debugging
- Use different configuration files for different environments (development, testing, production)
- Include configuration file templates in version control
- Use environment variables for sensitive information
- Enable parallel building to improve efficiency
- Configure
exclude_moduleappropriately to reduce package size - Use
cleanto ensure clean build environment
- Use
/for path separators or let tools handle automatically - Let tools automatically convert icon formats (PNG→ICNS/ICO)
- Test dependency compatibility across different platforms
- Important: Relative paths in config files are automatically resolved to absolute paths relative to project directory
When jsonschema is installed, build.json is validated against unifypy/schemas/build.schema.json (Draft-07) at load time:
pip install "unifypy[schema]"Submit built .app / .dmg artifacts to Apple notarization via notarytool + stapler (requires Xcode Command Line Tools and a valid Developer ID signing certificate):
# Developer ID certificate (recommended via env var; also supported in macos.codesign_identity)
export UNIFYPY_CODESIGN_IDENTITY="Developer ID Application: Your Name (TEAMID)"
# Apple notarization credentials (env vars or keychain profile)
export UNIFYPY_APPLE_ID="you@example.com"
export UNIFYPY_TEAM_ID="TEAMID"
export UNIFYPY_APPLE_PASSWORD="app-specific-password"
# Or use a stored keychain profile:
# export UNIFYPY_NOTARY_PROFILE="AC_PASSWORD"
unifypy . --config build.json --clean --notarizeBuild .msi installers via WiX Toolset (candle and light in PATH):
unifypy . --config build.json --format msiMIT License - See LICENSE file for details
Issues and Pull Requests are welcome!
UnifyPy 2.0 - Making Python Application Packaging Simple and Efficient 🚀