|
9 | 9 | # - cron: "13 20 * * 3" |
10 | 10 |
|
11 | 11 | jobs: |
| 12 | + |
| 13 | + # Python 3.10 and later, running against the development tooling that |
| 14 | + # 'uv.lock' pins. These runs are fully reproducible. |
12 | 15 | tests-ci: |
13 | 16 |
|
14 | 17 | strategy: |
15 | 18 | #fail-fast: true |
16 | 19 | matrix: |
17 | | - # These should span the range declared by 'requires-python' in |
18 | | - # pyproject.toml. uv downloads whichever interpreter is missing from |
19 | | - # the runner, so testing older pythons no longer needs an old (and by |
20 | | - # now unavailable) runner image. |
21 | 20 | python-version: |
22 | | - - "3.8" |
23 | | - - "3.9" |
24 | 21 | - "3.10" |
25 | 22 | - "3.11" |
26 | 23 | - "3.12" |
|
41 | 38 |
|
42 | 39 | - name: 'Run tests' |
43 | 40 | run: uv run --frozen pytest |
| 41 | + |
| 42 | + |
| 43 | + # Older pythons, down to the oldest one that the GitHub-hosted runners can |
| 44 | + # still provide. 'uv.lock' deliberately covers python 3.10 and later only |
| 45 | + # (see [tool.uv.dependency-groups] in pyproject.toml), so pytest is resolved |
| 46 | + # on the fly here and uv picks whichever release still supports the |
| 47 | + # interpreter. These runs are therefore not pinned; a pytest release could |
| 48 | + # in principle break them without any change on our side. |
| 49 | + # |
| 50 | + # The library is pure python and has no runtime dependencies, so there is |
| 51 | + # nothing to build: it is used straight from the source tree via PYTHONPATH. |
| 52 | + tests-ci-oldpy: |
| 53 | + |
| 54 | + strategy: |
| 55 | + #fail-fast: true |
| 56 | + matrix: |
| 57 | + python-version: |
| 58 | + - "3.7" |
| 59 | + - "3.8" |
| 60 | + - "3.9" |
| 61 | + |
| 62 | + # 'ubuntu-22.04' is the newest runner image for which 'actions/setup-python' |
| 63 | + # still provides python 3.7. uv's own python downloads only start at 3.8, |
| 64 | + # which is why the interpreter comes from 'actions/setup-python' here and |
| 65 | + # from 'astral-sh/setup-uv' in the job above. |
| 66 | + runs-on: 'ubuntu-22.04' |
| 67 | + |
| 68 | + steps: |
| 69 | + - uses: actions/checkout@v4 |
| 70 | + |
| 71 | + - name: 'Set up python ${{ matrix.python-version }}' |
| 72 | + uses: actions/setup-python@v5 |
| 73 | + with: |
| 74 | + python-version: '${{ matrix.python-version }}' |
| 75 | + |
| 76 | + - name: 'Set up uv' |
| 77 | + uses: astral-sh/setup-uv@v7 |
| 78 | + with: |
| 79 | + enable-cache: true |
| 80 | + |
| 81 | + # '--no-project' keeps uv from consulting uv.lock (which does not describe |
| 82 | + # this interpreter); '$(which python)' is the interpreter that |
| 83 | + # 'actions/setup-python' just put on the PATH. |
| 84 | + - name: 'Run tests (pytest resolved outside of uv.lock)' |
| 85 | + env: |
| 86 | + PYTHONPATH: '.' |
| 87 | + run: >- |
| 88 | + uv run --no-project --python "$(which python)" --with pytest |
| 89 | + pytest |
0 commit comments