UnifyPy is a configuration-driven, cross-platform Python application packaging orchestrator (PyInstaller + native Windows/macOS/Linux installers).
unifypy/__main__.py&unifypy/cli/: CLI argument parsing and--initinteractive configuration wizard.unifypy/core/: LifecycleEngine, fail-fastEventBus,BuildContext, layeredConfigManager, format resolution, and platform/arch normalization.unifypy/plugins/: Lifecycle stage plugins subscribed toEventBusby explicitpriority.unifypy/pyinstaller/: PyInstaller option tables,.specpure renderer (spec_renderer.py), andPyInstallerConfigBuilder.unifypy/platforms/:BasePackager+PackagerRegistry+ OS packagers (windows/: Inno Setup EXE & WiX MSI;macos/: DMG & post-processing;linux/: sharedcommon.py+ DEB, RPM, AppImage).unifypy/utils/: Sharedpaths.py,ProgressManager(TTY rolling tail + GitHub Actions::group::), streamingSilentRunner, single-probeToolManager,CacheManager,RollbackManager, andIconConverter.
- Self-Explanatory Naming: Distinguish
config_manager(ConfigManager),build_config(merged dict),macos_config(platform dict), anddmg_options/inno_options(installer dict). - Single Responsibility & Shared Base: Keep rendering functions pure; put cross-module path/asset helpers in
unifypy/utils/paths.pyand shared Linux staging inunifypy/platforms/linux/common.py. - Unified Output: Never embed decorative emojis or manual indentation in plugin/packager strings. Route all user-facing progress, commands, warnings, and errors through
ProgressManager(orunifypy.core.logutilin library helpers). - Flat & Explicit Control Flow: Use guard clauses (max 2–3 indentation levels). Catch specific exceptions (
OSError,ValueError,subprocess.SubprocessError) at clear boundaries instead of silentexcept Exception: pass. - Security Invariants:
SilentRunner.run_commandmust default toshell=False.- Auto-downloaded binaries must verify pinned SHA256 hashes; zip extraction must reject path traversal (Zip Slip); Inno Setup is never silent-installed.
- macOS entitlements default to production unless
--developmentis passed.
Run the unit test suite before committing:
python3 -m pytest tests/ -q