Application packaging
Packaging a JadeUI Python app is usually two steps:
- Front-end assets: plaintext JAPK (development) or a JadePack signed package (production)
- Python host:
jadeui buildinto a standalone.exe(Nuitka by default, PyInstaller optional)
See CLI for the full command surface and project conventions.
Front-end assets (JAPK)
# Requires Node.js and: npm install -g @electron/asar
jadeui japk
jadeui japk --src web -o dist/my-app.japkLoad at runtime:
from jadeui import Window
Window(title="My App").run(japk="dist/my-app.japk")Or via LocalServer:
from jadeui import LocalServer
server = LocalServer()
url = server.start("myapp", japk="dist/my-app.japk")Host exe (jadeui build)
Packagers (auto-install)
jadeui build installs a missing packager automatically by default — you no longer need the old GitHub Nuitka rc zip:
- Nuitka (default): installs
nuitka>=4.0from PyPI (do not use the obsolete4.0rc7zip) --packager pyinstaller: runspip install pyinstaller
Use --no-auto-deps for offline environments or when you do not want the environment mutated.
Nuitka 2.x onefile builds may miss VCRUNTIME140.dll on clean Windows. This was fixed in stable 4.0 (Nuitka#3706). Use PyPI 4.0+ (currently 4.1.x); do not install the old in-repo nuitka-4.0.rc7.zip.
You can still preinstall manually:
pip install "nuitka>=4.0"
# or
pip install jadeui[pyinstaller]Toolchain checks:
pip install jadeui[dev]
jadeui doctorBasic usage
jadeui build
jadeui build app.py
jadeui build app.py -o MyApp
jadeui build --packager pyinstaller
jadeui build -i app.ico -o MyApp --output-dir dist
jadeui build --include-data-dir assets=assets --console
jadeui build --no-onefile -c 2Defaults:
- Onefile mode
- Compress level 1 (basic LTO)
- Auto-include JadeView DLL (matched to the current Python arch:
x86/x64/arm64) - Auto-include sibling
web/when present - Auto-use
web/favicon.pngas icon when present - Without
-o, the output name followspyproject.toml(see CLI conventions)
Flags
| Flag | Description |
|---|---|
source | Python entry (default tool.jadeui.entry or app.py) |
--packager | nuitka (default) or pyinstaller |
-i, --icon | Icon (.ico / .png) |
-o, --output | Output basename (no extension) |
--output-dir | Output directory (default dist) |
--include-data-dir | Data dir mapping src=dest (repeatable) |
--include-data-file | Data file mapping src=dest (repeatable) |
--console | Show a console window |
--upx | Enable UPX (Nuitka) |
--no-jadeui-dll | Do not auto-include JadeView DLL |
-c, --compress | Nuitka compress level 0-3 (default 1) |
--no-onefile | Directory build instead of onefile |
--no-auto-deps | Do not auto-install missing Nuitka / PyInstaller |
Compress levels (Nuitka)
| Level | Notes | Speed | Size |
|---|---|---|---|
| 0 | No extra compression | Fastest | Largest |
| 1 | Basic LTO | Fast | Larger |
| 2 | LTO + strip docstrings / asserts | Slower | Smaller |
| 3 | Full opts + Python -OO | Slowest | Smallest |
-c 2 is a good daily default.
Suggested layout
my_app/
├── app.py
├── pyproject.toml # [project] + [tool.jadeui]
├── web/ # front end (auto-included / japk source)
│ ├── index.html
│ └── favicon.png
└── assets/ # extra data (pass --include-data-dir)End-to-end example
jadeui init my-app --frontend html
cd my-app
jadeui doctor
jadeui run
jadeui japk
jadeui build -o MyApp -c 2Typical output:
dist/
├── my-app.japk # front-end assets (if you ran japk)
└── MyApp.exe # host executableLegacy script
scripts/build.py in the repo still forwards to the same implementation. New projects should call jadeui build directly.
FAQ
Q: Missing DLL / VC++ runtime after packaging?
A: Use Nuitka >=4.0 (pip install "nuitka>=4.0"), and make sure the bundled JadeView DLL matches the Python interpreter architecture used for the build.
Q: Does the SDK auto-upgrade JadeView?
A: Only within the adapted release tag (for example builds under v2.3.0). It will not jump to 2.4 automatically.
Q: How do I shrink the binary?
A: Raise -c, optionally --upx, drop unused data dirs, or use an older Python.
Q: web/ was not included?
A: Keep web next to the entry script, or pass --include-data-dir.
Q: How do I debug the packaged app?
A:
jadeui build app.py --consoleDuring development, enable DevTools / context menu:
app.initialize(enable_dev_tools=True)
window = Window(disable_right_click=False, ...)