Skip to content

Commit

Permalink
Merge pull request #172 from beeware/auto-dev-python
Browse files Browse the repository at this point in the history
Enable allow-prereleases on all Python installs.
  • Loading branch information
freakboy3742 authored Oct 16, 2024
2 parents 414bfb3 + 599f2fb commit e6da492
Show file tree
Hide file tree
Showing 7 changed files with 40 additions and 26 deletions.
16 changes: 8 additions & 8 deletions .github/workflows/app-build-verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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."
Expand Down Expand Up @@ -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/[email protected]
with:
Expand All @@ -111,11 +108,14 @@ 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) }}
# 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/[email protected]
with:
python-version: ${{ inputs.python-version }}
python-version: ${{ inputs.python-version || '3.x' }}
allow-prereleases: true
cache: pip
cache-dependency-path: |
**/setup.cfg
Expand Down Expand Up @@ -222,7 +222,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 }}
Expand Down
14 changes: 12 additions & 2 deletions .github/workflows/app-create-verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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."
Expand Down Expand Up @@ -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/[email protected]
Expand All @@ -68,10 +73,15 @@ jobs:
path: briefcase-template

- name: Set up Python
# 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/[email protected]
with:
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: |
**/setup.cfg
**/pyproject.toml
Expand Down
26 changes: 14 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ jobs:
- name: Set up Python
uses: actions/[email protected]
with:
python-version: 3.X
python-version: "3.x"
cache: pip
cache-dependency-path: |
**/setup.cfg
Expand Down Expand Up @@ -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: ${{ matrix.python-version }} # Falls back to 3.x if undefined
repository: beeware/briefcase
runner-os: ${{ matrix.runner-os }}
framework: ${{ matrix.framework }}
Expand All @@ -270,13 +270,17 @@ 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: "3.10" # must match system python for ubuntu version
python-version: ${{ matrix.python-version }} # Falls back to 3.x if undefined
repository: beeware/briefcase
runner-os: ${{ matrix.runner-os }}
framework: ${{ matrix.framework }}
Expand All @@ -285,13 +289,17 @@ 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
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 }}
Expand All @@ -306,7 +314,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
Expand All @@ -323,7 +330,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
Expand All @@ -339,7 +345,8 @@ jobs:
needs: pre-commit
uses: ./.github/workflows/app-build-verify.yml
with:
python-version: "3.10" # 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 All @@ -355,7 +362,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
Expand All @@ -372,7 +378,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
Expand All @@ -388,7 +393,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
Expand All @@ -405,7 +409,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
Expand All @@ -421,7 +424,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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/dep-version-bump.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ jobs:
- name: Set up Python
uses: actions/[email protected]
with:
python-version: 3.X
python-version: "3.x"

- name: Install Dependencies
run: |
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/pre-commit-run.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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."
Expand Down Expand Up @@ -44,6 +44,7 @@ jobs:
uses: actions/[email protected]
with:
python-version: ${{ inputs.python-version }}
allow-prereleases: true
cache: pip
cache-dependency-path: |
**/setup.cfg
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pre-commit-update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ jobs:
- name: Set up Python
uses: actions/[email protected]
with:
python-version: 3.X
python-version: "3.x"
cache: pip
cache-dependency-path: |
**/setup.cfg
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/towncrier-run.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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."
Expand Down Expand Up @@ -55,6 +55,7 @@ jobs:
uses: actions/[email protected]
with:
python-version: ${{ inputs.python-version }}
allow-prereleases: true
cache: pip
cache-dependency-path: |
**/setup.cfg
Expand Down

0 comments on commit e6da492

Please sign in to comment.