Skip to content

Commit

Permalink
Make system an invalid value on macOS/Windows.
Browse files Browse the repository at this point in the history
  • Loading branch information
freakboy3742 committed Oct 14, 2024
1 parent 464871d commit 02b0580
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 10 deletions.
9 changes: 4 additions & 5 deletions .github/workflows/app-build-verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand Down
7 changes: 5 additions & 2 deletions .github/workflows/app-create-verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand Down
13 changes: 10 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand All @@ -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 }}
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 02b0580

Please sign in to comment.