Packaging¶
packaging/build.py builds a standalone bundle of the application for the current platform in dist/:
uv run python packaging/build.py --archive # PyInstaller (default)
uv run python packaging/build.py --backend nuitka --archive # Compiled with Nuitka
uv run python packaging/build.py --backend nuitka --onefile # Single executable (Linux, Windows)
| PyInstaller | Nuitka | |
|---|---|---|
| Method | Bundles the Python bytecode with an interpreter | Compiles the Python code to C and native code |
| Build time | About a minute | Tens of minutes (cached between builds) |
| Requirements | – | A C compiler: gcc/clang (Linux, with patchelf), Xcode command line tools (macOS), MSVC or a downloaded MinGW (Windows) |
| Output | dist/CANExplorer/ (.app on macOS) |
Same, or a single executable with --onefile |
--archive also zips the bundle to dist/CANExplorer-<version>-<platform>-<arch>[-nuitka].zip.
Both builds include the QML files, the Qt QML modules, the grammar files of ldfparser and lark, and all python-can
interface modules (which python-can imports by name at run time). CANExplorer's own interfaces are read from the
can.interface entry points of the installed package, so an interface registered in pyproject.toml is bundled
without further changes (run uv sync after adding one); a test compares both. The build writes can_explorer/_build_version.py
(removed afterwards) with the version, the commit (from git, else GITHUB_SHA), the build date (UTC, or
SOURCE_DATE_EPOCH for reproducible builds) and the backend; the About dialog, the crash report and the system
report show them (can_explorer/build_info.py). Nuitka also takes the version from it, as it cannot relate the
package metadata of an editable install to the package.
On Windows, --j2534-bridge PYTHON also builds the J2534 bridge
with a 32-bit Python, which needs PyInstaller, into j2534-bridge32/ of the bundle. The release workflow creates
that Python with uv:
uv venv build/j2534-bridge-python --python cpython-3.12-windows-x86-none
uv pip install --python build/j2534-bridge-python pyinstaller
uv run python packaging/build.py --archive --j2534-bridge build/j2534-bridge-python/Scripts/python.exe
The release bundles contain MQTT and the USB adapters without a vendor driver (the mqtt and usb extras, synced
with --extra mqtt --extra usb): gs_usb, CANalyst-II and the panda through pyusb, with the libusb library of
libusb-package (LGPL-2.1, loaded as a shared library like python-can itself). The drivers extra is not bundled:
cantact has no build for current Python versions and python-ics and nixnet need vendor drivers anyway.
After building, the release workflow runs --check-interfaces on each bundle (see
Command line): it fails the job when an interface or libusb does not
load, which a build itself does not notice for modules that are only loaded by name. Run it on a local build with
dist/CANExplorer/CANExplorer --check-interfaces (dist/CANExplorer.app/Contents/MacOS/CANExplorer on macOS).
MF4 log files are only supported when asammdf is installed in the build environment. The release bundles are
built without it to keep them small (it adds pandas); to include it, sync with --extra mf4 before
building.
Snap¶
snap/snapcraft.yaml packs the PyInstaller bundle (dist/CANExplorer, built first) into a snap with the core22
base and the gnome extension, with strict confinement. The release workflow builds it on Ubuntu 22.04 with
snapcore/action-build, installs it and runs canexplorer --help, and for v* tags publishes it with
snapcore/action-publish: to stable, to candidate for -rc tags and to beta for other pre-releases.
Publishing needs, once:
- The snap name:
snapcraft register canexplorerwith the Snap Store account of the project. - The repository secret
SNAPCRAFT_STORE_CREDENTIALS, fromsnapcraft export-login --snaps canexplorer --acls package_access,package_push,package_release -.
The interfaces can-bus and raw-usb are not connected automatically; users connect them (see
Installation), or the Snap Store grants auto-connection on request.
Installers¶
packaging/installer.py turns the bundle into the installers of the platform, in dist/installers:
uv run python packaging/build.py
uv run python packaging/installer.py # All formats of the platform
uv run python packaging/installer.py --formats deb # Only some
| Platform | Format | Tool |
|---|---|---|
| Windows | CANExplorer-<version>-windows-x86_64-setup.exe: Inno Setup installer for the current user or all users, with start menu entry, optional desktop icon and uninstaller, in English or German |
Inno Setup 6 (choco install innosetup) |
| Linux | ….AppImage: runs on any distribution with glibc 2.35 or newer |
appimagetool, downloaded to build/ when not installed |
| Linux | ….deb: installs to /opt/canexplorer with /usr/bin/canexplorer, a menu entry and icons |
dpkg-deb |
| macOS | ….dmg: the app and a link to Applications to drag it to |
hdiutil |
The Windows installer keeps a fixed AppId, so a new version installs over the previous one. The installers are
not code signed; signing needs certificates (an Authenticode certificate for Windows, an Apple Developer ID with
notarization for macOS), which can be added to the release workflow as secrets.
Icons¶
The application icon (.ico on Windows, .icns on macOS, .png on Linux) is set on the bundle and on the
window; on Linux, --install-desktop-entry installs a desktop menu entry with the icon (see
Installation). The icons, the logo in the
application and the logo and favicon of this documentation are generated from the vector logo
docs/assets/logo.svg by rendering it at each size. After changing the logo, run
It writes packaging/icons/, can_explorer/gui/qt/CanExplorer/images/logo.png, the desktop entry icons in
can_explorer/resources/icons/ and docs/assets/logo-transparent.png, icon.png, favicon.png and
logo-banner.png.
Continuous integration¶
| Workflow | Runs | Does |
|---|---|---|
build.yaml |
Pushes and pull requests to develop |
Ruff (lint and format check); tests on Linux, Windows and macOS with Python 3.10 and 3.14 |
release.yaml |
Pushes and merges to master; v* tags; manually; pull requests changing the packaging |
Builds the bundles and installers for Windows, Linux and macOS (PyInstaller, or Nuitka when started manually), checks that every interface loads in each bundle, installs each one to check that it starts, and stores them as workflow artifacts for 90 days. For master it publishes them to GitHub Packages (see below); for tags it publishes a GitHub release with the installers, the zip archives and SHA256SUMS.txt (a pre-release for tags such as v1.0.0-rc1) |
docs.yaml |
Pushes and pull requests to develop |
Builds the documentation strictly; publishes it to GitHub Pages from develop |
Installers in GitHub Packages¶
Every push or merge to master publishes the installers, the zip archives and SHA256SUMS.txt to GitHub Packages,
as the OCI artifact ghcr.io/akj7/canexplorer-installers (GitHub Packages has no registry for plain files; the
container registry stores them, and they are listed under the repository's Packages). Its tags:
| Tag | Points to |
|---|---|
latest |
The latest build of master |
<version>, e.g. 1.0.0 |
The latest build of master with that version in pyproject.toml |
sha-<commit>, e.g. sha-3d4a3b2 |
The build of that commit |
Download them with ORAS:
oras pull ghcr.io/akj7/canexplorer-installers:latest # Into the current directory
sha256sum -c SHA256SUMS.txt # Check the files
The package is created private on the first publish; to let anyone download it, set its visibility to public in
the package settings on GitHub (Packages → canexplorer-installers → Package settings). Private packages need a
login first: oras login ghcr.io -u <user> with a personal access token with read:packages.
Releasing a version¶
- Set the version in
pyproject.toml(uv version 1.3.0), move the Unreleased entries ofCHANGELOG.mdunder a heading for it and commit. - Tag the commit and push the tag:
git tag v1.3.0 && git push origin v1.3.0. - The release workflow checks that the tag matches the version, builds and tests the installers on the three platforms and publishes the release with them.
Manual runs (Actions → release → Run workflow) build the installers of any branch without a release; download them from the run's artifacts.