-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
closes #167 implements workaround for installing python on ubuntu arm
- Loading branch information
1 parent
0ea667b
commit e577a32
Showing
4 changed files
with
102 additions
and
27 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
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
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
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 |
---|---|---|
|
@@ -120,32 +120,41 @@ inputs: | |
default: 'true' | ||
# Python | ||
python-version: | ||
description: "Version range or exact version of Python or PyPy to use, using SemVer's version range syntax. Reads from .python-version if unset." | ||
description: "Version range or exact version of Python or PyPy to use, specified using SemVer's version range syntax. If unset, it reads from .python-version. Please note that on ARM, the list of available versions differs, and you can find the list of Python distributions at https://launchpad.net/~deadsnakes/+archive/ubuntu/ppa/+packages." | ||
default: "3.11" | ||
python-version-file: | ||
description: "File containing the Python version to use. Example: .python-version" | ||
description: "File containing the Python version to use. Example: .python-version (not supported on arm)" | ||
python-cache: | ||
description: "Used to specify a package manager for caching in the default directory. Supported values: pip, pipenv, poetry." | ||
description: "Used to specify a package manager for caching in the default directory. Supported values: pip, pipenv, poetry. (not supported on arm)" | ||
required: false | ||
python-architecture: | ||
description: "The target architecture (x86, x64) of the Python or PyPy interpreter." | ||
description: "The target architecture (x86, x64) of the Python or PyPy interpreter. (not supported on arm)" | ||
python-check-latest: | ||
description: "Set this option if you want the action to check for the latest available version that satisfies the version spec." | ||
description: "Set this option if you want the action to check for the latest available version that satisfies the version spec. (not supported on arm)" | ||
default: "false" | ||
python-token: | ||
description: "The token used to authenticate when fetching Python distributions from https://github.com/actions/python-versions. When running this action on github.com, the default value is sufficient. When running on GHES, you can pass a personal access token for github.com if you are experiencing rate limiting." | ||
description: "The token used to authenticate when fetching Python distributions from https://github.com/actions/python-versions. When running this action on github.com, the default value is sufficient. When running on GHES, you can pass a personal access token for github.com if you are experiencing rate limiting. (not supported on arm)" | ||
default: ${{ github.server_url == 'https://github.com' && github.token || '' }} | ||
python-cache-dependency-path: | ||
description: "Used to specify the path to dependency files. Supports wildcards or a list of file names for caching multiple dependencies." | ||
description: "Used to specify the path to dependency files. Supports wildcards or a list of file names for caching multiple dependencies. (not supported on arm)" | ||
python-update-environment: | ||
description: "Set this option if you want the action to update environment variables." | ||
description: "Set this option if you want the action to update environment variables. (not supported on arm)" | ||
default: 'true' | ||
python-allow-prereleases: | ||
description: "When 'true', a version range passed to 'python-version' input will match prerelease versions if no GA versions are found. Only 'x.y' version range is supported for CPython." | ||
description: "When 'true', a version range passed to 'python-version' input will match prerelease versions if no GA versions are found. Only 'x.y' version range is supported for CPython. (not supported on arm)" | ||
default: "false" | ||
python-enabled: | ||
description: 'Whether to install python or not' | ||
default: 'true' | ||
python-deadsnakes-debug: | ||
description: 'Whether to use debug version of python (deadnakes arm only)' | ||
required: false | ||
default: false | ||
python-deadsnakes-nogil: | ||
description: 'Whether to use free-threaded version of python (deadnakes arm only)' | ||
required: false | ||
default: false | ||
|
||
# misc | ||
overwrite: | ||
description: 'Defines whether on hosted runners the present version should be overwritten' | ||
|
@@ -248,10 +257,12 @@ runs: | |
cache-prefix: ${{ inputs.java-cache-prefix }} | ||
cache-path: ${{ inputs.java-cache-path }} | ||
cache-path-add: ${{ inputs.java-cache-path-add }} | ||
|
||
# Install Python, it's absent on self-hosted runners | ||
- name: Install Python3 | ||
- name: Install Python3 (std install) | ||
uses: actions/setup-python@v5 | ||
if: ${{ inputs.python-enabled == 'true' && ( env.python_missing == 'true' || inputs.overwrite == 'true' ) }} | ||
# actions/setup-python doesn't yet support ARM | ||
if: ${{ !contains(runner.arch, 'arm') && inputs.python-enabled == 'true' && ( env.python_missing == 'true' || inputs.overwrite == 'true' ) }} | ||
with: | ||
python-version: ${{ inputs.python-version }} | ||
python-version-file: ${{ inputs.python-version-file }} | ||
|
@@ -262,6 +273,26 @@ runs: | |
cache-dependency-path: ${{ inputs.python-cache-dependency-path }} | ||
update-environment: ${{ inputs.python-update-environment }} | ||
allow-prereleases: ${{ inputs.python-allow-prereleases }} | ||
|
||
- name: Install Python3 (arm install) | ||
uses: deadsnakes/[email protected] | ||
# actions/setup-python doesn't yet support ARM, see https://github.com/actions/setup-python/issues/705#issuecomment-1756948951 | ||
if: ${{ contains(runner.arch, 'arm') && inputs.python-enabled == 'true' && ( env.python_missing == 'true' || inputs.overwrite == 'true' ) }} | ||
with: | ||
python-version: ${{ inputs.python-version }} | ||
debug: ${{ inputs.python-deadsnakes-debug }} | ||
nogil: ${{ inputs.python-deadsnakes-nogil }} | ||
|
||
- name: Add Python3 Shortcut and add pip (ARM) | ||
if: ${{ contains(runner.arch, 'arm') && inputs.python-enabled == 'true' && ( env.python_missing == 'true' || inputs.overwrite == 'true' ) }} | ||
shell: bash | ||
run: | | ||
sudo update-alternatives --install /usr/bin/python python /usr/bin/python3 1 | ||
: # install pip | ||
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py | ||
/usr/bin/python get-pip.py | ||
- name: Unset Environment variables | ||
shell: bash | ||
run: | | ||
|