feature: add version parsing from Pipfile

This commit is contained in:
Aramís Segovia 2025-03-26 22:46:53 -04:00
parent 1264885983
commit 9485ba7ca7
5 changed files with 222 additions and 3 deletions

View file

@ -284,6 +284,108 @@ jobs:
with:
python-version-file: .tool-versions
setup-versions-from-pipfile-with-python_version:
name: Setup ${{ matrix.python }} ${{ matrix.os }} Pipfile with python_version
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
[
macos-latest,
windows-latest,
ubuntu-20.04,
ubuntu-22.04,
ubuntu-22.04-arm,
macos-13,
ubuntu-latest,
ubuntu-24.04-arm
]
python: [3.9.13, 3.10.11, 3.11.9, 3.13.2]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: build-version-file ${{ matrix.python }}
run: |
echo '[requires]
python_version = "${{ matrix.python }}"
' > Pipfile
- name: setup-python ${{ matrix.python }}
id: setup-python
uses: ./
with:
python-version-file: Pipfile
- name: Check python-path
run: ./__tests__/check-python-path.sh '${{ steps.setup-python.outputs.python-path }}'
shell: bash
- name: Validate version
run: |
$pythonVersion = (python --version)
if ("Python ${{ matrix.python }}".replace("==", "") -ne "$pythonVersion"){
Write-Host "The current version is $pythonVersion; expected version is ${{ matrix.python }}"
exit 1
}
$pythonVersion
shell: pwsh
- name: Run simple code
run: python -c 'import math; print(math.factorial(5))'
setup-versions-from-pipfile-with-python_full_version:
name: Setup ${{ matrix.python }} ${{ matrix.os }} Pipfile with python_full_version
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
[
macos-latest,
windows-latest,
ubuntu-20.04,
ubuntu-22.04,
ubuntu-22.04-arm,
macos-13,
ubuntu-latest,
ubuntu-24.04-arm
]
python: [3.9.13, 3.10.11, 3.11.9, 3.13.2]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: build-version-file ${{ matrix.python }}
run: |
echo '[requires]
python_full_version = "${{ matrix.python }}"
' > Pipfile
- name: setup-python ${{ matrix.python }}
id: setup-python
uses: ./
with:
python-version-file: Pipfile
- name: Check python-path
run: ./__tests__/check-python-path.sh '${{ steps.setup-python.outputs.python-path }}'
shell: bash
- name: Validate version
run: |
$pythonVersion = (python --version)
if ("Python ${{ matrix.python }}".replace("==", "") -ne "$pythonVersion"){
Write-Host "The current version is $pythonVersion; expected version is ${{ matrix.python }}"
exit 1
}
$pythonVersion
shell: pwsh
- name: Run simple code
run: python -c 'import math; print(math.factorial(5))'
setup-pre-release-version-from-manifest:
name: Setup 3.14.0-alpha.6 ${{ matrix.os }}
runs-on: ${{ matrix.os }}