-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Tweak handling of system to avoid need for sudo.
- Loading branch information
1 parent
6afc2d9
commit afec009
Showing
2 changed files
with
13 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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/[email protected] | ||
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: | | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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] | ||
|
@@ -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/[email protected] | ||
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: | | ||
|