From 923073b5e83037a28e14b9492ea7dcc12c3caaee Mon Sep 17 00:00:00 2001 From: Andreas Motl Date: Thu, 18 Jul 2024 01:39:21 +0200 Subject: [PATCH 1/2] Setup: Fix `ImportError: cannot import name 'tarfile' from 'backports'` /path/to/lib/python3.8/site-packages/setuptools/_vendor/jaraco/context.py:17: ImportError ImportError: cannot import name 'tarfile' from 'backports' (/opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/site-packages/backports/__init__.py) --- .github/workflows/main.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 89fca0e3..620f512c 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -64,12 +64,14 @@ jobs: - name: Set up project run: | - # `setuptools 0.64.0` adds support for editable install hooks (PEP 660). + # `setuptools 64` adds support for editable install hooks (PEP 660). # https://github.com/pypa/setuptools/blob/main/CHANGES.rst#v6400 - pip install "setuptools>=64" --upgrade + # `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=.[full,test,develop] + pip install --use-pep517 --prefer-binary --editable='.[full,test,develop]' - name: Run linter and software tests env: From a4ba5e855bf5eeb514d3491f1ecdc5e705970ba6 Mon Sep 17 00:00:00 2001 From: Andreas Motl Date: Thu, 18 Jul 2024 01:52:05 +0200 Subject: [PATCH 2/2] 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