From a4ba5e855bf5eeb514d3491f1ecdc5e705970ba6 Mon Sep 17 00:00:00 2001 From: Andreas Motl Date: Thu, 18 Jul 2024 01:52:05 +0200 Subject: [PATCH] Setup: Fix PyInstaller's `Failed to import module` PyInstaller.exceptions.ImportErrorWhenRunningHook: Failed to import module __PyInstaller_hooks_0_importlib_metadata required by hook for module /Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/PyInstaller/hooks/hook-importlib_metadata.py. --- .github/workflows/release-app.yml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release-app.yml b/.github/workflows/release-app.yml index 588863e0..d00f8c23 100644 --- a/.github/workflows/release-app.yml +++ b/.github/workflows/release-app.yml @@ -42,7 +42,16 @@ jobs: cache-dependency-path: 'pyproject.toml' - name: Set up project - run: pip install --use-pep517 --prefer-binary --editable='.[cfr,release-cfr]' + run: | + + # `setuptools 64` adds support for editable install hooks (PEP 660). + # https://github.com/pypa/setuptools/blob/main/CHANGES.rst#v6400 + # `setuptools 71` significantly re-vendors setuptools packages, causing hiccups on Python 3.8. + # https://github.com/pypa/setuptools/pull/4457 + pip install "setuptools>=64,<71" --upgrade + + # Install package in editable mode. + pip install --use-pep517 --prefer-binary --editable='.[cfr,release-cfr]' - name: Build application bundle run: poe build-cfr