-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix tox + uv caching #29
Changes from all commits
0a87824
31d5198
9ff3c3f
fa7169d
a580397
c9ce0de
cc4dcad
7d2d3a5
10322e7
e311aff
71ac9f2
3cda093
55e3225
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,7 +7,6 @@ name: pypi-publish | |
|
||
env: | ||
PYTHONUNBUFFERED: "1" | ||
UV_SYSTEM_PYTHON: 1 | ||
|
||
jobs: | ||
pypi-publish: | ||
|
@@ -23,18 +22,7 @@ jobs: | |
uses: actions/checkout@v4 | ||
|
||
- name: Install uv | ||
uses: astral-sh/setup-uv@v3 | ||
with: | ||
enable-cache: true | ||
cache-dependency-glob: pyproject.toml | ||
|
||
- name: Setup Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version-file: pyproject.toml | ||
|
||
- name: Install Python dependencies | ||
run: uv pip install . | ||
Comment on lines
-26
to
-37
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. None of this stuff is actually necessary to build the package, so we can remove it. |
||
uses: astral-sh/setup-uv@v4 | ||
|
||
- name: Build Python dist | ||
run: uv build | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,9 @@ on: | |
|
||
name: python-build-and-test | ||
|
||
env: | ||
PYTHONUNBUFFERED: "1" | ||
|
||
jobs: | ||
build-and-test: | ||
runs-on: ubuntu-latest | ||
|
@@ -19,11 +22,11 @@ jobs: | |
uses: actions/checkout@v4 | ||
|
||
- name: Install uv | ||
uses: astral-sh/setup-uv@v3 | ||
uses: astral-sh/setup-uv@v4 | ||
with: | ||
enable-cache: true | ||
cache-dependency-glob: pyproject.toml | ||
cache-suffix: tox | ||
cache-suffix: ${{ matrix.python-version }}-tox | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is the cause of the caching issue identified in ccao-data/ccao#33. Basically, It's supposed to cache built-from-source wheels even when pruning is enabled. However, there's a race condition in the testing setup since the first-to-finish jobs are the ones to populate the cache, and those jobs won't have the built-from-source wheel. The easy fix here is to just give each Python version its own cache. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [Praise] This is wild 🤯 Great find! |
||
|
||
- name: Setup Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v5 | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -86,6 +86,9 @@ python = | |
[testenv] | ||
extras = dev | ||
commands = pytest | ||
passenv = | ||
UV_CACHE_DIR | ||
PYTHONUNBUFFERED | ||
Comment on lines
+89
to
+91
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not strictly necessary I don't think, but also can't hurt. |
||
|
||
[testenv:py{39, 310}-lowest] | ||
uv_resolution = lowest-direct | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's actually faster to run this without using the cache.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[Praise] Common uv W 🚀