Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 52 additions & 0 deletions .github/actions/setup-pyenv-python/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: setup-pyenv-python
description: Setup Python via pyenv
inputs:
python-version:
description: Python version to setup
pyenv-version:
description: Pyenv version to setup
default: "v2.4.19"
runs:
using: "composite"
steps:
- name: Clone pyenv
uses: actions/checkout@v4
with:
repository: "pyenv/pyenv"
ref: ${{ inputs.pyenv-version }}
path: pyenv

- name: Setup environment variables
shell: bash
run: |
echo PATH="${PWD}/pyenv/bin:${PATH}" >> "${GITHUB_ENV}"
echo PYENV_ROOT="${PWD}/pyenv" >> "${GITHUB_ENV}"

- name: Setup pyenv into profile
shell: bash
run: |
eval "$(pyenv init -)" >> ~/.profile

- name: Install required packages
shell: bash
run: |
sudo apt-get update
sudo apt-get install -y libncurses5-dev libbz2-dev libreadline-dev libsqlite3-dev libssl-dev zlib1g-dev liblzma-dev

- name: Setup Python
shell: bash
run: |
set -x
pyenv install ${{ inputs.python-version }}
pyenv global ${{ inputs.python-version }}
echo PATH="$(dirname $(pyenv which python${{ inputs.python-version }})):$PATH" >> ${GITHUB_ENV}

- name: Use python as python3
shell: bash
run: |
set -x
ls -l ~/.local/bin/
ln -sf $(which pip${{ inputs.python-version }}) ~/.local/bin/pip
ln -sf $(which python${{ inputs.python-version }}) ~/.local/bin/python
ln -sf $(which pip${{ inputs.python-version }}) ~/.local/bin/pip3
ln -sf $(which python${{ inputs.python-version }}) ~/.local/bin/python3
6 changes: 3 additions & 3 deletions .github/workflows/build-test-gpu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ on:
description: Ignore pytest.skip
type: boolean
default: false
use_system_python:
description: Use system Python
use_pyenv_python:
description: Use Python built with pyenv
type: boolean
default: false

Expand All @@ -64,4 +64,4 @@ jobs:
skip_list: ${{ inputs.skip_list }}
run_name: ${{ inputs.run_name || format('Build and test {0}', inputs.runner_label) }}
enable_unskip: ${{ inputs.enable_unskip }}
use_system_python: ${{ inputs.use_system_python || false }}
use_pyenv_python: ${{ inputs.use_pyenv_python || false }}
5 changes: 5 additions & 0 deletions .github/workflows/build-test-python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ on:
description: Ignore pytest.skip
type: boolean
default: false
use_pyenv_python:
description: Use Python built with pyenv
type: boolean
default: false

permissions: read-all

Expand Down Expand Up @@ -79,3 +83,4 @@ jobs:
skip_list: ${{ inputs.skip_list }}
run_name: ${{ inputs.run_name }}
enable_unskip: ${{ inputs.enable_unskip }}
use_pyenv_python: ${{ inputs.use_pyenv_python || false }}
14 changes: 10 additions & 4 deletions .github/workflows/build-test-reusable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ on:
description: Runner label for version
type: string
default: runner-0.0.20
use_system_python:
description: Use system Python
use_pyenv_python:
description: Use Python built with pyenv
type: boolean
default: false

Expand Down Expand Up @@ -94,12 +94,18 @@ jobs:
path: $HOME/.cache/pip
key: pip-${{ inputs.python_version }}-${{ hashFiles('python/pyproject.toml', 'python/setup.py') }}-${{ env.CACHE_NUMBER }}

- name: Install Python ${{ inputs.python_version }}
if: ${{ !inputs.use_system_python }}
- name: Install Python (using actions/setup-python) ${{ inputs.python_version }}
if: ${{ !inputs.use_pyenv_python }}
uses: actions/setup-python@v5
with:
python-version: ${{ inputs.python_version }}

- name: Install Python (from pyenv) ${{ inputs.python_version }}
if: ${{ inputs.use_pyenv_python }}
uses: ./.github/actions/setup-pyenv-python
with:
python-version: ${{ inputs.python_version }}

- name: Identify Python version
run: |
PYTHON_VERSION="$(python -c 'import sys; print(f"{sys.version_info[0]}.{ sys.version_info[1]}")')"
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ on:
description: Ignore pytest.skip
type: boolean
default: false
use_pyenv_python:
description: Use Python built with pyenv
type: boolean
default: false

pull_request:
branches:
Expand Down Expand Up @@ -130,3 +134,4 @@ jobs:
skip_list: ${{ inputs.skip_list }}
run_name: ${{ inputs.run_name }}
enable_unskip: ${{ inputs.enable_unskip || false }}
use_pyenv_python: ${{ inputs.use_pyenv_python || false }}
13 changes: 10 additions & 3 deletions .github/workflows/triton-benchmarks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,11 @@ on:
description: JSON list of benchmarks to skip
type: string
default: "[]"
use_system_python:
description: Use system Python
use_pyenv_python:
description: Use Python built with pyenv
type: boolean
default: false

schedule:
- cron: "5 23 * * *"
pull_request:
Expand Down Expand Up @@ -71,11 +72,17 @@ jobs:
key: pip-$PYTHON_VERSION-$GITHUB_SHA

- name: Install Python
if: ${{ !(inputs.use_system_python || false) }}
if: ${{ !(inputs.use_pyenv_python || false) }}
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}

- name: Install Python (from pyenv) ${{ inputs.python_version }}
if: ${{ inputs.use_pyenv_python }}
uses: ./.github/actions/setup-pyenv-python
with:
python-version: ${{ env.PYTHON_VERSION }}

- name: Identify Python version
run: |
PYTHON_VERSION="$(python -c 'import sys; print(f"{sys.version_info[0]}.{ sys.version_info[1]}")')"
Expand Down
Loading