Skip to content

Commit ceddcef

Browse files
baremetalgoCopilot
andcommitted
Fix Windows PyInstaller packaging dependency
Run PyInstaller outside the local packaging package and install a compatible packaging release in CI. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 96c09cc commit ceddcef

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

.github/workflows/release.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ jobs:
4949
run: |
5050
python -m pip install --upgrade pip
5151
python -m pip install -r requirements.txt
52+
python -m pip install "packaging>=23,<25"
5253
python -m pip install pyinstaller
5354
python -m pip install Pillow
5455

packaging/packager.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,10 @@ def build(*, clean: bool, runtime_dir: Path | None = None, gpu: bool = False) ->
148148
),
149149
str(PACKAGING_ROOT / "runtime_launcher.py"),
150150
]
151-
subprocess.run(command, cwd=ROOT, check=True)
151+
# Run PyInstaller outside the repository root. The application has a
152+
# local ``packaging`` package, which would otherwise shadow the
153+
# third-party ``packaging`` dependency imported by PyInstaller.
154+
subprocess.run(command, cwd=work_dir, check=True)
152155

153156
bundle = _require_path(dist_dir / APP_NAME, directory=True)
154157
if runtime_dir is None:

0 commit comments

Comments
 (0)