Skip to content

Build standalone Windows exe in CI - #2

Open
LeeHudsonDLS wants to merge 2 commits into
mainfrom
windows-exe-build
Open

LeeHudsonDLS wants to merge 2 commits into
mainfrom
windows-exe-build

Conversation

@LeeHudsonDLS

Copy link
Copy Markdown
Collaborator

Freeze dls-plc-tools into a single Windows .exe with PyInstaller on a windows-latest runner, so IT-locked DLS workstations without uv/pip can run the tool by downloading one file. Because _release.yml attaches every run artifact, the exe lands on the GitHub release on tags; the windows-exe job also runs on push/PR to catch freeze breakage early, and release now needs it.

The spec force-collects aphyt/openpyxl submodules (the CLI/GUI lazy-import aphyt and it loads CIP classes dynamically, so the static graph misses them); console=True keeps the read CLI's stdout working.

Claude-Session: https://claude.ai/code/session_01A1NtKmMT92DTBWro4vVEL5

LeeHudsonDLS and others added 2 commits July 27, 2026 06:48
Freeze dls-plc-tools into a single Windows .exe with PyInstaller on a
windows-latest runner, so IT-locked DLS workstations without uv/pip can run
the tool by downloading one file. Because _release.yml attaches every run
artifact, the exe lands on the GitHub release on tags; the windows-exe job
also runs on push/PR to catch freeze breakage early, and release now needs it.

The spec force-collects aphyt/openpyxl submodules (the CLI/GUI lazy-import
aphyt and it loads CIP classes dynamically, so the static graph misses them);
console=True keeps the read CLI's stdout working.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01A1NtKmMT92DTBWro4vVEL5
Freezing dls_plc_tools/__main__.py directly made it the top-level script with
no parent package, so its `from . import ...` relative imports raised
"ImportError: attempted relative import with no known parent package" at
startup (the CI smoke test caught it). Freeze packaging/entrypoint.py instead,
which imports the package absolutely so those imports resolve. Verified locally
by freezing on Linux and running --version / --help / read --help.

Also harden the workflow: build with `uv run --with pyinstaller` (a plain
`uv run pyinstaller` re-syncs to the lockfile and uninstalls pyinstaller first),
and upload the exe with `if: always()` so a failed smoke test still leaves an
artifact to inspect while still failing the job.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01A1NtKmMT92DTBWro4vVEL5

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant