|
1 | | -name: Unit Tests (py313) |
2 | | -# Test also with Python 3.13 (experimental; workflow will not fail on error.) |
| 1 | +name: Unit Tests (py315) |
| 2 | +# Test also with Python 3.15 (experimental; workflow will not fail on error.) |
3 | 3 |
|
4 | 4 | on: workflow_call |
5 | 5 |
|
6 | 6 | jobs: |
7 | | - test313: |
8 | | - name: Test on ${{matrix.python.version}}-${{matrix.platform.runner}} (experimental) |
| 7 | + test315: |
| 8 | + name: Test (Python ${{ matrix.python.version }}, ${{ matrix.os }}) (experimental) |
9 | 9 | continue-on-error: true |
10 | | - runs-on: ${{ matrix.platform.runner }} |
| 10 | + runs-on: ${{ matrix.os }} |
11 | 11 | strategy: |
| 12 | + fail-fast: true |
12 | 13 | matrix: |
13 | | - platform: |
14 | | - - runner: ubuntu-latest |
15 | | - - runner: windows-latest |
| 14 | + os: [ubuntu-latest, windows-latest] |
16 | 15 | python: |
17 | | - - version: '3.13.0-alpha - 3.13.0' |
18 | | - uvpy: '3.13' |
| 16 | + - version: '3.15.0-alpha - 3.15.0' |
| 17 | + uvpy: '3.15' |
19 | 18 | steps: |
20 | | - - uses: actions/checkout@v4 |
| 19 | + - name: Checkout code |
| 20 | + uses: actions/checkout@v5 |
21 | 21 | - name: Install uv |
22 | | - uses: astral-sh/setup-uv@v5 |
| 22 | + uses: astral-sh/setup-uv@v7 |
23 | 23 | with: |
24 | | - enable-cache: false |
25 | | - cache-dependency-glob: "uv.lock" |
26 | | - - name: Install Python ${{ matrix.python.version }} |
27 | | - uses: actions/setup-python@v5 |
28 | | - with: |
29 | | - python-version: ${{ matrix.python.version }} |
| 24 | + enable-cache: true |
| 25 | + cache-dependency-glob: 'uv.lock' |
| 26 | + - name: Remove Python upper version constraint from pyproject.toml |
| 27 | + shell: pwsh |
| 28 | + run: | |
| 29 | + $File = Get-Item pyproject.toml |
| 30 | + $Content = Get-Content $File -Raw |
| 31 | + [regex]$RequiresPythonPattern = '(?<!-)(\brequires-python = "\s?[>=]{1,2}\s?\d+\.\d+\.?\d*\.?[\d\w]*\s?)(,\s?[<=]{1,2}\s?\d+\.?\d*\.?\d*\.?[\d\w]*\s?)?(")' |
| 32 | + if ($Content -match $RequiresPythonPattern) { |
| 33 | + $RequiresPythonFound = $Matches[0] |
| 34 | + $RequiresPythonReplacement = $Matches[1] + $Matches[3] |
| 35 | + $Content -Replace $RequiresPythonFound, $RequiresPythonReplacement | Set-Content $File -NoNewline |
| 36 | + } |
30 | 37 | - name: Install the project |
31 | | - run: uv sync -p ${{ matrix.python.uvpy }} -U --no-dev |
| 38 | + run: uv sync -p ${{ matrix.python.uvpy }} -U --no-dev --extra test |
32 | 39 | - name: Run pytest |
33 | 40 | run: > |
34 | 41 | uv run --with pytest --with pytest-cov |
|
0 commit comments