Repository navigation
Conversation
| default: false | ||
|
|
||
| env: | ||
| TOX_UV_PATH: uv |
There was a problem hiding this comment.
I don't think tox-uv reads TOX_UV_PATH anywhere. It always runs the binary from the uv wheel it depends on (find_uv_bin()), so this is a no-op and tox ends up using a different uv than the one setup-uv installs. The cache is still shared because setup-uv exports UV_CACHE_DIR, so I think we can just drop this line.
| if: startsWith(matrix.os, 'ubuntu') | ||
| - name: Install dependencies | ||
| run: python -m pip install -U tox | ||
| - name: Set up uv |
There was a problem hiding this comment.
This step is copied verbatim into five jobs, and #1638 then has to edit all five copies. Actions supports YAML anchors now, so let'st try using &setup-uv on this one and use - *setup-uv in the others.
| uses: astral-sh/setup-uv@07a047e608db84b3d8c06cd9a7c7dcc9c355c18e # v10.3.2 | ||
| with: | ||
| enable-cache: true | ||
| cache-suffix: ${{ github.job }}-${{ matrix.python-version || matrix.toxenv || 'tools' }} |
There was a problem hiding this comment.
Doesn't setup-uv already put the OS in the cache key? If so I think the 'tools' fallback isn't buying anything, since it only kicks in for jobs without a matrix and github.job already tells those apart.
| setup.cfg | ||
| setup.py | ||
| tox.ini | ||
| .github/workflows/*.yml |
There was a problem hiding this comment.
Why the workflow files? With this, any edit to publish.yml throws away every uv cache. I guess it's for the darker pin, but that only matters to the darker job.
| - name: Run tox on the wheel | ||
| shell: bash | ||
| run: python -m tox --installpkg "$(ls dist/*.whl)" | ||
| run: tox -x "testenv:py.base_python=${{ steps.python.outputs.python-path }}" --installpkg "$(ls dist/*.whl)" |
There was a problem hiding this comment.
This override is not needed, since tox will already run the py environment in whatever Python it itself is running under (which we set up with setup_python.
That said, I am reconsidering the idea of using setup_python — I think instead we should have tox and all its dependencies running on some stable Python and then let uv handle picking up the Python version. I think it will be slightly slower for cache misses, but it makes it so that tox or something being incompatible with the Python we're trying to test doesn't break our tests.
Same applies in the sdist tests.
Summary of changes
This uses uv and tox-uv for CI environment creation and dependency installation, with the uv cache shared between runs. The existing interpreter matrix and distribution testing remain in place, so the packaging migration can follow separately.
Pull Request Checklist