From c477aa61dc5ecb65a2769fff3a5caef6a5c47da7 Mon Sep 17 00:00:00 2001 From: Russell Keith-Magee Date: Wed, 9 Oct 2024 11:19:11 +0800 Subject: [PATCH 01/11] Enable allow-prereleases on all Python installs. --- .github/workflows/app-build-verify.yml | 3 ++- .github/workflows/app-create-verify.yml | 3 ++- .github/workflows/ci.yml | 2 +- .github/workflows/dep-version-bump.yml | 2 +- .github/workflows/pre-commit-run.yml | 3 ++- .github/workflows/pre-commit-update.yml | 2 +- .github/workflows/towncrier-run.yml | 3 ++- 7 files changed, 11 insertions(+), 7 deletions(-) diff --git a/.github/workflows/app-build-verify.yml b/.github/workflows/app-build-verify.yml index f12d82d..666ea6b 100644 --- a/.github/workflows/app-build-verify.yml +++ b/.github/workflows/app-build-verify.yml @@ -10,7 +10,7 @@ on: inputs: python-version: description: "Python version to use; defaults to latest Python release." - default: "3.X" + default: "3.x" type: string runner-os: description: "The OS to use to build the App; must be a fully qualified GitHub runner OS, e.g. ubuntu-latest." @@ -116,6 +116,7 @@ jobs: uses: actions/setup-python@v5.2.0 with: python-version: ${{ inputs.python-version }} + allow-prereleases: true cache: pip cache-dependency-path: | **/setup.cfg diff --git a/.github/workflows/app-create-verify.yml b/.github/workflows/app-create-verify.yml index 4cce8e0..f00fbfe 100644 --- a/.github/workflows/app-create-verify.yml +++ b/.github/workflows/app-create-verify.yml @@ -9,7 +9,7 @@ on: inputs: python-version: description: "Python version to use; defaults to latest Python release." - default: "3.X" + default: "3.x" type: string runner-os: description: "The OS to use to build the App; must be a fully qualified GitHub runner OS, e.g. ubuntu-latest." @@ -72,6 +72,7 @@ jobs: with: python-version: ${{ inputs.python-version }} cache: pip + allow-prereleases: true cache-dependency-path: | **/setup.cfg **/pyproject.toml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a5a70c2..8f757ff 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -110,7 +110,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v5.2.0 with: - python-version: 3.X + python-version: "3.x" cache: pip cache-dependency-path: | **/setup.cfg diff --git a/.github/workflows/dep-version-bump.yml b/.github/workflows/dep-version-bump.yml index 4756abd..5609f65 100644 --- a/.github/workflows/dep-version-bump.yml +++ b/.github/workflows/dep-version-bump.yml @@ -72,7 +72,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v5.2.0 with: - python-version: 3.X + python-version: "3.x" - name: Install Dependencies run: | diff --git a/.github/workflows/pre-commit-run.yml b/.github/workflows/pre-commit-run.yml index 4cb80aa..69c6800 100644 --- a/.github/workflows/pre-commit-run.yml +++ b/.github/workflows/pre-commit-run.yml @@ -9,7 +9,7 @@ on: inputs: python-version: description: "Python version to use; defaults to latest Python release." - default: "3.X" + default: "3.x" type: string repository: description: "GitHub repository to checkout; defaults to repo running this workflow." @@ -44,6 +44,7 @@ jobs: uses: actions/setup-python@v5.2.0 with: python-version: ${{ inputs.python-version }} + allow-prereleases: true cache: pip cache-dependency-path: | **/setup.cfg diff --git a/.github/workflows/pre-commit-update.yml b/.github/workflows/pre-commit-update.yml index 07219ac..974277e 100644 --- a/.github/workflows/pre-commit-update.yml +++ b/.github/workflows/pre-commit-update.yml @@ -75,7 +75,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v5.2.0 with: - python-version: 3.X + python-version: "3.x" cache: pip cache-dependency-path: | **/setup.cfg diff --git a/.github/workflows/towncrier-run.yml b/.github/workflows/towncrier-run.yml index 912f5c4..ea3fb84 100644 --- a/.github/workflows/towncrier-run.yml +++ b/.github/workflows/towncrier-run.yml @@ -9,7 +9,7 @@ on: inputs: python-version: description: "Python version to use; defaults to latest Python release." - default: "3.X" + default: "3.x" type: string repository: description: "GitHub repository to checkout; defaults to repo running this workflow." @@ -55,6 +55,7 @@ jobs: uses: actions/setup-python@v5.2.0 with: python-version: ${{ inputs.python-version }} + allow-prereleases: true cache: pip cache-dependency-path: | **/setup.cfg From 9ae5062f3f54c800bb40b0f0af6c2519cb2b76b0 Mon Sep 17 00:00:00 2001 From: Russell Keith-Magee Date: Sat, 12 Oct 2024 14:19:44 +0800 Subject: [PATCH 02/11] Fall back to default Python for most tests. --- .github/workflows/ci.yml | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8f757ff..1a55649 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -291,7 +291,7 @@ jobs: needs: pre-commit uses: ./.github/workflows/app-build-verify.yml with: - python-version: "3.11" + python-version: "3.11" # Explicitly test the python-version override repository: beeware/briefcase-template runner-os: ${{ matrix.runner-os }} framework: ${{ matrix.framework }} @@ -306,7 +306,6 @@ jobs: needs: pre-commit uses: ./.github/workflows/app-build-verify.yml with: - python-version: "3.11" repository: beeware/briefcase-android-gradle-template runner-os: ${{ matrix.runner-os }} target-platform: android @@ -323,7 +322,6 @@ jobs: needs: pre-commit uses: ./.github/workflows/app-build-verify.yml with: - python-version: "3.11" repository: beeware/briefcase-iOS-xcode-template runner-os: macos-latest target-platform: iOS @@ -355,7 +353,6 @@ jobs: needs: pre-commit uses: ./.github/workflows/app-build-verify.yml with: - python-version: "3.11" repository: beeware/briefcase-linux-appimage-template runner-os: ubuntu-latest target-platform: linux @@ -372,7 +369,6 @@ jobs: needs: pre-commit uses: ./.github/workflows/app-build-verify.yml with: - python-version: "3.11" repository: beeware/briefcase-linux-flatpak-template runner-os: ubuntu-latest target-platform: linux @@ -388,7 +384,6 @@ jobs: needs: pre-commit uses: ./.github/workflows/app-build-verify.yml with: - python-version: "3.11" repository: beeware/briefcase-macos-${{ matrix.format }}-template runner-os: macos-latest target-platform: macOS @@ -405,7 +400,6 @@ jobs: needs: pre-commit uses: ./.github/workflows/app-build-verify.yml with: - python-version: "3.11" repository: beeware/briefcase-web-static-template runner-os: ubuntu-latest target-platform: web @@ -421,7 +415,6 @@ jobs: needs: pre-commit uses: ./.github/workflows/app-build-verify.yml with: - python-version: "3.11" repository: beeware/briefcase-windows-${{ matrix.format }}-template runner-os: windows-latest target-platform: windows From 09f788ea00f3eed56efd6413aa7f7b5c92d4ae87 Mon Sep 17 00:00:00 2001 From: Russell Keith-Magee Date: Sat, 12 Oct 2024 15:27:04 +0800 Subject: [PATCH 03/11] Allow 'system' as a value for python-version. --- .github/workflows/app-build-verify.yml | 6 +++--- .github/workflows/app-create-verify.yml | 2 ++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/app-build-verify.yml b/.github/workflows/app-build-verify.yml index 666ea6b..0841a80 100644 --- a/.github/workflows/app-build-verify.yml +++ b/.github/workflows/app-build-verify.yml @@ -111,8 +111,8 @@ jobs: path: ${{ steps.config.outputs.briefcase-data-dir }} - name: Set Up Python - # Linux System apps requires python is System Python to run the app - if: ${{ !startsWith(inputs.runner-os, 'ubuntu') || !startsWith(inputs.python-version, steps.config.outputs.system-python-version) }} + # Linux System apps can only use the system Python to run the app + if: ${{ !startsWith(inputs.runner-os, 'ubuntu') || inputs.python-version != 'system' }} uses: actions/setup-python@v5.2.0 with: python-version: ${{ inputs.python-version }} @@ -223,7 +223,7 @@ jobs: - name: Build Linux System Project (Ubuntu, local) if: > startsWith(inputs.runner-os, 'ubuntu') - && startsWith(inputs.python-version, steps.config.outputs.system-python-version) + && inputs.python-version == "system" && contains(fromJSON('["", "Linux"]'), inputs.target-platform) && contains(fromJSON('["", "system"]'), inputs.target-format) working-directory: ${{ steps.create.outputs.project-path }} diff --git a/.github/workflows/app-create-verify.yml b/.github/workflows/app-create-verify.yml index f00fbfe..b1e2571 100644 --- a/.github/workflows/app-create-verify.yml +++ b/.github/workflows/app-create-verify.yml @@ -68,6 +68,8 @@ jobs: path: briefcase-template - name: Set up Python + # Linux System apps can only use the system Python to run the app + if: ${{ !startsWith(inputs.runner-os, 'ubuntu') || inputs.python-version != 'system' }} uses: actions/setup-python@v5.2.0 with: python-version: ${{ inputs.python-version }} From d142ed4a19a8bd781941fd1824a8dfca3b458747 Mon Sep 17 00:00:00 2001 From: Russell Keith-Magee Date: Sat, 12 Oct 2024 15:29:45 +0800 Subject: [PATCH 04/11] Correct quotation usage. --- .github/workflows/app-build-verify.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/app-build-verify.yml b/.github/workflows/app-build-verify.yml index 0841a80..9773f80 100644 --- a/.github/workflows/app-build-verify.yml +++ b/.github/workflows/app-build-verify.yml @@ -223,7 +223,7 @@ jobs: - name: Build Linux System Project (Ubuntu, local) if: > startsWith(inputs.runner-os, 'ubuntu') - && inputs.python-version == "system" + && inputs.python-version == 'system' && contains(fromJSON('["", "Linux"]'), inputs.target-platform) && contains(fromJSON('["", "system"]'), inputs.target-format) working-directory: ${{ steps.create.outputs.project-path }} From 3855e3f9de161b84399f602cb0c369ccbc59a3b5 Mon Sep 17 00:00:00 2001 From: Russell Keith-Magee Date: Sat, 12 Oct 2024 15:38:14 +0800 Subject: [PATCH 05/11] Actually use the system setting value. --- .github/workflows/ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1a55649..c7698fa 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -261,7 +261,7 @@ jobs: needs: [ pre-commit, test-package-python ] uses: ./.github/workflows/app-create-verify.yml with: - python-version: "3.10" # must match system python for ubuntu version + python-version: "system" # must match system python for ubuntu version repository: beeware/briefcase runner-os: ${{ matrix.runner-os }} framework: ${{ matrix.framework }} @@ -276,7 +276,7 @@ jobs: needs: [ pre-commit, test-package-python ] uses: ./.github/workflows/app-build-verify.yml with: - python-version: "3.10" # must match system python for ubuntu version + python-version: "system" # must match system python for ubuntu version repository: beeware/briefcase runner-os: ${{ matrix.runner-os }} framework: ${{ matrix.framework }} @@ -337,7 +337,7 @@ jobs: needs: pre-commit uses: ./.github/workflows/app-build-verify.yml with: - python-version: "3.10" # must match system python for ubuntu version + python-version: "system" # must match system python for ubuntu version repository: beeware/briefcase-linux-system-template runner-os: ubuntu-22.04 target-platform: linux From 6afc2d95906071c445b73caa422493daebfd0893 Mon Sep 17 00:00:00 2001 From: Russell Keith-Magee Date: Sat, 12 Oct 2024 16:16:23 +0800 Subject: [PATCH 06/11] Simplify handling of system python version. --- .github/workflows/app-build-verify.yml | 3 +-- .github/workflows/app-create-verify.yml | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/app-build-verify.yml b/.github/workflows/app-build-verify.yml index 9773f80..060ddc9 100644 --- a/.github/workflows/app-build-verify.yml +++ b/.github/workflows/app-build-verify.yml @@ -111,8 +111,7 @@ jobs: path: ${{ steps.config.outputs.briefcase-data-dir }} - name: Set Up Python - # Linux System apps can only use the system Python to run the app - if: ${{ !startsWith(inputs.runner-os, 'ubuntu') || inputs.python-version != 'system' }} + if: ${{ inputs.python-version != 'system' }} uses: actions/setup-python@v5.2.0 with: python-version: ${{ inputs.python-version }} diff --git a/.github/workflows/app-create-verify.yml b/.github/workflows/app-create-verify.yml index b1e2571..d6dbfc9 100644 --- a/.github/workflows/app-create-verify.yml +++ b/.github/workflows/app-create-verify.yml @@ -68,8 +68,7 @@ jobs: path: briefcase-template - name: Set up Python - # Linux System apps can only use the system Python to run the app - if: ${{ !startsWith(inputs.runner-os, 'ubuntu') || inputs.python-version != 'system' }} + if: ${{ inputs.python-version != 'system' }} uses: actions/setup-python@v5.2.0 with: python-version: ${{ inputs.python-version }} From afec00969787c527316070ccc307521597cf1485 Mon Sep 17 00:00:00 2001 From: Russell Keith-Magee Date: Sat, 12 Oct 2024 16:47:23 +0800 Subject: [PATCH 07/11] Tweak handling of system to avoid need for sudo. --- .github/workflows/app-build-verify.yml | 8 ++++++-- .github/workflows/app-create-verify.yml | 9 +++++++-- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/.github/workflows/app-build-verify.yml b/.github/workflows/app-build-verify.yml index 060ddc9..716f902 100644 --- a/.github/workflows/app-build-verify.yml +++ b/.github/workflows/app-build-verify.yml @@ -111,10 +111,14 @@ jobs: path: ${{ steps.config.outputs.briefcase-data-dir }} - name: Set Up Python - if: ${{ inputs.python-version != 'system' }} + # On Linux, we can use the system python as-is. On macOS/Windows, install + # a Python that matches the version provided as a system default. This is + # to avoid issues with trying to install packages into homebrew's python + # without requiring sudo. + if: ${{ !startsWith(inputs.runner-os, 'ubuntu') || inputs.python-version != 'system' }} uses: actions/setup-python@v5.2.0 with: - python-version: ${{ inputs.python-version }} + python-version: ${{ inputs.python-version == 'system' && steps.config.system-python-version || inputs.python-version }} allow-prereleases: true cache: pip cache-dependency-path: | diff --git a/.github/workflows/app-create-verify.yml b/.github/workflows/app-create-verify.yml index d6dbfc9..f4eb974 100644 --- a/.github/workflows/app-create-verify.yml +++ b/.github/workflows/app-create-verify.yml @@ -47,6 +47,11 @@ jobs: runs-on: ${{ inputs.runner-os }} timeout-minutes: 30 steps: + - name: Workflow Configuration + id: config + run: | + SYSTEM_PYTHON_VER=$(python3 -c 'import sys; print(f"{sys.version_info.major}.{sys.version_info.minor}")') + echo "system-python-version=${SYSTEM_PYTHON_VER}" | tee -a ${GITHUB_OUTPUT} - name: Checkout ${{ inputs.repository }} uses: actions/checkout@v4.2.0 @@ -68,10 +73,10 @@ jobs: path: briefcase-template - name: Set up Python - if: ${{ inputs.python-version != 'system' }} + # Always set up a Python, so that dependencies can be installed without sudo access uses: actions/setup-python@v5.2.0 with: - python-version: ${{ inputs.python-version }} + python-version: ${{ inputs.python-version == 'system' && steps.config.system-python-version || inputs.python-version }} cache: pip allow-prereleases: true cache-dependency-path: | From 464871dcd4c23938973cc2ed60a32539754ed730 Mon Sep 17 00:00:00 2001 From: Russell Keith-Magee Date: Sat, 12 Oct 2024 16:57:58 +0800 Subject: [PATCH 08/11] Correct step output lookup. --- .github/workflows/app-build-verify.yml | 2 +- .github/workflows/app-create-verify.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/app-build-verify.yml b/.github/workflows/app-build-verify.yml index 716f902..da08da9 100644 --- a/.github/workflows/app-build-verify.yml +++ b/.github/workflows/app-build-verify.yml @@ -118,7 +118,7 @@ jobs: if: ${{ !startsWith(inputs.runner-os, 'ubuntu') || inputs.python-version != 'system' }} uses: actions/setup-python@v5.2.0 with: - python-version: ${{ inputs.python-version == 'system' && steps.config.system-python-version || inputs.python-version }} + python-version: ${{ inputs.python-version == 'system' && steps.config.outputs.system-python-version || inputs.python-version }} allow-prereleases: true cache: pip cache-dependency-path: | diff --git a/.github/workflows/app-create-verify.yml b/.github/workflows/app-create-verify.yml index f4eb974..5260497 100644 --- a/.github/workflows/app-create-verify.yml +++ b/.github/workflows/app-create-verify.yml @@ -76,7 +76,7 @@ jobs: # Always set up a Python, so that dependencies can be installed without sudo access uses: actions/setup-python@v5.2.0 with: - python-version: ${{ inputs.python-version == 'system' && steps.config.system-python-version || inputs.python-version }} + python-version: ${{ inputs.python-version == 'system' && steps.config.outputs.system-python-version || inputs.python-version }} cache: pip allow-prereleases: true cache-dependency-path: | From 02b0580fa29e099f477c0077950d60cee9331afc Mon Sep 17 00:00:00 2001 From: Russell Keith-Magee Date: Mon, 14 Oct 2024 17:06:40 +0800 Subject: [PATCH 09/11] Make system an invalid value on macOS/Windows. --- .github/workflows/app-build-verify.yml | 9 ++++----- .github/workflows/app-create-verify.yml | 7 +++++-- .github/workflows/ci.yml | 13 ++++++++++--- 3 files changed, 19 insertions(+), 10 deletions(-) diff --git a/.github/workflows/app-build-verify.yml b/.github/workflows/app-build-verify.yml index da08da9..9b390bb 100644 --- a/.github/workflows/app-build-verify.yml +++ b/.github/workflows/app-build-verify.yml @@ -111,14 +111,13 @@ jobs: path: ${{ steps.config.outputs.briefcase-data-dir }} - name: Set Up Python - # On Linux, we can use the system python as-is. On macOS/Windows, install - # a Python that matches the version provided as a system default. This is - # to avoid issues with trying to install packages into homebrew's python - # without requiring sudo. + # On Linux, accept "system" as a proxy for "don't install Python"; this will + # fall back to the system-provided Python package. Providing "system" as a value + # on macOS or Windows will cause an error. if: ${{ !startsWith(inputs.runner-os, 'ubuntu') || inputs.python-version != 'system' }} uses: actions/setup-python@v5.2.0 with: - python-version: ${{ inputs.python-version == 'system' && steps.config.outputs.system-python-version || inputs.python-version }} + python-version: ${{ inputs.python-version }} allow-prereleases: true cache: pip cache-dependency-path: | diff --git a/.github/workflows/app-create-verify.yml b/.github/workflows/app-create-verify.yml index 5260497..1e6b0eb 100644 --- a/.github/workflows/app-create-verify.yml +++ b/.github/workflows/app-create-verify.yml @@ -73,10 +73,13 @@ jobs: path: briefcase-template - name: Set up Python - # Always set up a Python, so that dependencies can be installed without sudo access + # On Linux, accept a value of "system", which will install a version of + # Python matching the system version. We can't use the actual system + # install because we need to install dependencies, which would either + # require the use of sudo, or extra workarounds for user-space packages. uses: actions/setup-python@v5.2.0 with: - python-version: ${{ inputs.python-version == 'system' && steps.config.outputs.system-python-version || inputs.python-version }} + python-version: ${{ startsWith(inputs.runner-os, 'ubuntu') && inputs.python-version == 'system' && steps.config.outputs.system-python-version || inputs.python-version }} cache: pip allow-prereleases: true cache-dependency-path: | diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c7698fa..38faa8c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -261,7 +261,6 @@ jobs: needs: [ pre-commit, test-package-python ] uses: ./.github/workflows/app-create-verify.yml with: - python-version: "system" # must match system python for ubuntu version repository: beeware/briefcase runner-os: ${{ matrix.runner-os }} framework: ${{ matrix.framework }} @@ -270,13 +269,16 @@ jobs: matrix: framework: [ toga, pyside6 ] runner-os: [ macos-latest, windows-latest, ubuntu-22.04 ] + includes: + # Ubuntu apps need to run on the system Python + - runner-os: ubuntu-22.04 + python-version: "system" test-verify-apps-briefcase: name: Verify Briefcase needs: [ pre-commit, test-package-python ] uses: ./.github/workflows/app-build-verify.yml with: - python-version: "system" # must match system python for ubuntu version repository: beeware/briefcase runner-os: ${{ matrix.runner-os }} framework: ${{ matrix.framework }} @@ -285,6 +287,10 @@ jobs: matrix: framework: [ toga ] runner-os: [ macos-latest, windows-latest, ubuntu-22.04 ] + includes: + # Ubuntu apps need to run on the system Python + - runner-os: ubuntu-22.04 + python-version: "system" test-verify-apps-briefcase-template: name: Verify Briefcase Template @@ -337,7 +343,8 @@ jobs: needs: pre-commit uses: ./.github/workflows/app-build-verify.yml with: - python-version: "system" # must match system python for ubuntu version + # Ubuntu apps need to run on the system Python + python-version: "system" repository: beeware/briefcase-linux-system-template runner-os: ubuntu-22.04 target-platform: linux From d1220eb2dbc14639fbc4eaf6c22fdd307bf2ad8b Mon Sep 17 00:00:00 2001 From: Russell Keith-Magee Date: Tue, 15 Oct 2024 08:20:10 +0800 Subject: [PATCH 10/11] Correct some errors in python version specification. --- .github/workflows/app-build-verify.yml | 3 --- .github/workflows/ci.yml | 2 ++ 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/app-build-verify.yml b/.github/workflows/app-build-verify.yml index 9b390bb..c73b103 100644 --- a/.github/workflows/app-build-verify.yml +++ b/.github/workflows/app-build-verify.yml @@ -82,9 +82,6 @@ jobs: fi echo "cache-key=$(date +%Y-%m)|${CACHE_KEY}" | tee -a ${GITHUB_OUTPUT} - SYSTEM_PYTHON_VER=$(python3 -c 'import sys; print(f"{sys.version_info.major}.{sys.version_info.minor}")') - echo "system-python-version=${SYSTEM_PYTHON_VER}" | tee -a ${GITHUB_OUTPUT} - - name: Checkout ${{ inputs.repository }} uses: actions/checkout@v4.2.0 with: diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 38faa8c..436411b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -261,6 +261,7 @@ jobs: needs: [ pre-commit, test-package-python ] uses: ./.github/workflows/app-create-verify.yml with: + python-version: ${{ matrix.python-version}} # Falls back to 3.x if undefined repository: beeware/briefcase runner-os: ${{ matrix.runner-os }} framework: ${{ matrix.framework }} @@ -279,6 +280,7 @@ jobs: needs: [ pre-commit, test-package-python ] uses: ./.github/workflows/app-build-verify.yml with: + python-version: ${{ matrix.python-version}} # Falls back to 3.x if undefined repository: beeware/briefcase runner-os: ${{ matrix.runner-os }} framework: ${{ matrix.framework }} From 599f2fbb61c17aa94a962f26647f31a879a31052 Mon Sep 17 00:00:00 2001 From: Russell Keith-Magee Date: Tue, 15 Oct 2024 09:11:59 +0800 Subject: [PATCH 11/11] Handle fallback when python-version is empty. --- .github/workflows/app-build-verify.yml | 2 +- .github/workflows/app-create-verify.yml | 2 +- .github/workflows/ci.yml | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/app-build-verify.yml b/.github/workflows/app-build-verify.yml index c73b103..389cf52 100644 --- a/.github/workflows/app-build-verify.yml +++ b/.github/workflows/app-build-verify.yml @@ -114,7 +114,7 @@ jobs: if: ${{ !startsWith(inputs.runner-os, 'ubuntu') || inputs.python-version != 'system' }} uses: actions/setup-python@v5.2.0 with: - python-version: ${{ inputs.python-version }} + python-version: ${{ inputs.python-version || '3.x' }} allow-prereleases: true cache: pip cache-dependency-path: | diff --git a/.github/workflows/app-create-verify.yml b/.github/workflows/app-create-verify.yml index 1e6b0eb..4ce57be 100644 --- a/.github/workflows/app-create-verify.yml +++ b/.github/workflows/app-create-verify.yml @@ -79,7 +79,7 @@ jobs: # require the use of sudo, or extra workarounds for user-space packages. uses: actions/setup-python@v5.2.0 with: - python-version: ${{ startsWith(inputs.runner-os, 'ubuntu') && inputs.python-version == 'system' && steps.config.outputs.system-python-version || inputs.python-version }} + python-version: ${{ startsWith(inputs.runner-os, 'ubuntu') && inputs.python-version == 'system' && steps.config.outputs.system-python-version || inputs.python-version || '3.x' }} cache: pip allow-prereleases: true cache-dependency-path: | diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 436411b..e6bd8b8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -261,7 +261,7 @@ jobs: needs: [ pre-commit, test-package-python ] uses: ./.github/workflows/app-create-verify.yml with: - python-version: ${{ matrix.python-version}} # Falls back to 3.x if undefined + python-version: ${{ matrix.python-version }} # Falls back to 3.x if undefined repository: beeware/briefcase runner-os: ${{ matrix.runner-os }} framework: ${{ matrix.framework }} @@ -280,7 +280,7 @@ jobs: needs: [ pre-commit, test-package-python ] uses: ./.github/workflows/app-build-verify.yml with: - python-version: ${{ matrix.python-version}} # Falls back to 3.x if undefined + python-version: ${{ matrix.python-version }} # Falls back to 3.x if undefined repository: beeware/briefcase runner-os: ${{ matrix.runner-os }} framework: ${{ matrix.framework }}