Skip to content

fix(build): correct PyInstaller Qt packaging args and add Linux executable integration test - #6

Merged
RaymondSu-Public-Base merged 4 commits into
mainfrom
copilot/fix-pyinstaller-parameters
May 18, 2026
Merged

RaymondSu-Public-Base merged 4 commits into
mainfrom
copilot/fix-pyinstaller-parameters

Conversation

Copilot AI commented May 15, 2026 •

Copy link
Copy Markdown

Summary

Windows packaged executable was failing at runtime due to incomplete PyQt5 bundling. This change updates PyInstaller arguments to collect full Qt assets and adds explicit Linux executable integration coverage.

Related Issue

  • Managed by system auto-linking

Type Of Change

  • feat: new feature
  • fix: bug fix
  • docs: documentation only
  • test: tests added or updated
  • chore: maintenance/refactor/build/ci updates

What Changed

  • Build command fix
    • Replaced --hidden-import PyQt5.sip with --collect-all PyQt5 in src/hello_python/build.py to bundle required PyQt5 runtime resources.
  • Test alignment
    • Updated build-argument assertions in tests/test_build_class.py and Windows PyInstaller invocation in tests/test_build.py to match the new packaging strategy.
  • Linux executable validation
    • Added test_build_linux_executable (slow, Linux-only) in tests/test_build.py to explicitly verify Linux build output.
cmd = [
    poetry, "run", "pyinstaller",
    "--noconfirm", "--clean", "--onefile", "--windowed",
    "--collect-all", "PyQt5",
    "--name", self.name,
    "--distpath", str(self.dist_path),
    "--workpath", str(self.work_path),
    "--specpath", str(self.spec_path),
    str(self.entry_point),
]

How To Test

List exact commands and expected outcomes.

poetry run pytest -m "not slow" -v
poetry run python -m hello_python.codestyle check
poetry run pytest tests/test_build.py::TestBuildExecutable::test_build_linux_executable -m slow -v

Expected outcomes:

  • Fast suite passes.
  • Linux slow build test produces dist/linux/hello-python-linux.

Checklist

  • Pre-commit hooks pass (poetry run pre-commit run --all-files)
  • Lint passes (poetry run ruff check .)
  • Format passes (poetry run ruff format --check .)
  • Tests pass (poetry run pytest -m "not slow")
  • Build succeeds (poetry run python -m hello_python.build) (if applicable)
  • CI pipeline passes on this branch

Validation Evidence

Paste relevant output:

31 passed, 4 deselected in 0.23s
1 passed in 62.56s (tests/test_build.py::TestBuildExecutable::test_build_linux_executable -m slow)

UI/UX Changes (if applicable)

  • No UI changes
  • UI updated (attach screenshots)
  • Docs updated (README.md or docs/*)

Before/After screenshots or links:

  • Before:
  • After:

CI Checklist

  • Workflow changes reviewed (.github/workflows/*)
  • poetry.lock updated when dependencies changed
  • Headless test requirements handled (QT_QPA_PLATFORM=offscreen when needed)

Risk And Rollback

  • Risk level: Low
  • Rollback plan:
    • Revert the PyInstaller argument change in src/hello_python/build.py and corresponding test updates in tests/test_build.py / tests/test_build_class.py.

Reviewer Checklist

  • Scope is clear and focused
  • Code/docs are understandable
  • Tests are sufficient for changed behavior
  • No obvious regressions

Copilot AI and others added 2 commits May 15, 2026 09:01
Agent-Logs-Url: https://github.com/RaymondSu-Public-Base/Vibe-helloworld-python/sessions/9b755e5d-ab7f-4985-90af-4908c17bff38

Co-authored-by: RaymondSu-Public-Base <29174601+RaymondSu-Public-Base@users.noreply.github.com>
Agent-Logs-Url: https://github.com/RaymondSu-Public-Base/Vibe-helloworld-python/sessions/9b755e5d-ab7f-4985-90af-4908c17bff38

Co-authored-by: RaymondSu-Public-Base <29174601+RaymondSu-Public-Base@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix incorrect parameters for Pyinstaller in Windows executable fix(build): correct PyInstaller Qt packaging args and add Linux executable integration test May 15, 2026
…: cannot call python dll outside .exe

- Replaced build param --onefile by --onedir
Comment thread src/hello_python/build.py Resolved
@RaymondSu-Public-Base RaymondSu-Public-Base added the bug Something isn't working label May 18, 2026
@RaymondSu-Public-Base
RaymondSu-Public-Base marked this pull request as ready for review May 18, 2026 08:40
@RaymondSu-Public-Base
RaymondSu-Public-Base merged commit ed5270f into main May 18, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Pyinstaller incorrect parameters made windows executable report errors

2 participants