Skip to content

ci: keep built wheels across lockfile changes and pin the packaging smoke test - #40

Closed
notdodo wants to merge 1 commit into
mainfrom
tests/locked-packaging-smoke
Closed

notdodo wants to merge 1 commit into
mainfrom
tests/locked-packaging-smoke

Conversation

@notdodo

@notdodo notdodo commented Nov 15, 2026

Copy link
Copy Markdown
Member

Problem

After #38, Python 3.15 CI still spent about 85 s in one test, test_packaging.py::test_wheel_contains_py_typed:

  • It installed the built wheel with uv run --isolated --no-project --with <wheel>. That resolves the newest dependency releases and ignores uv.lock.
  • setup-uv's cache is keyed on uv.lock with no fallback. After any lockfile change, uv's cache was empty, so the test compiled pydantic-core, regex, zstandard, pyyaml and uuid-utils from source. 3.15 has no wheels for them yet.

Fix

  • Test: export the locked dependencies (uv export --locked), create a fresh venv, and install the wheel with --constraint. The base-install checks stay the same: py.typed is present, and the redaction extra isn't installed. The test is now deterministic too.
  • CI:
    • setup-uv's cache is turned off. One actions/cache entry now holds .venv, .mypy_cache and the uv cache, keyed per Python version and lockfile, with restore-keys falling back to the latest entry.
    • uv cache prune --ci runs at the end, so the cache keeps locally built wheels and drops re-downloadable ones.
    • The uv python install step from ci: reuse the previous venv when the lockfile changes #38 still provides the interpreter.

Validation

  • task format check test: 154 passed.
  • The packaging test takes 1.5 s on Python 3.15 locally.
  • actionlint and zizmor are clean.
  • The real check is CI. This PR's first run warms the new -deps- cache. After that, any lockfile change (e.g. release: prepare 0.5.0 and keep Python 3.15 CI fast #39, or the next Dependabot PR) should keep the 3.15 Tests step at about 10 s.

🤖 Generated with Claude Code

…moke test

The packaging test installed the built wheel with `uv run --with`, which
resolves the newest releases instead of uv.lock. Setup-uv's cache is keyed on
the lockfile with no fallback, so after a lockfile change Python 3.15 compiled
pydantic-core, regex, zstandard and others inside that test (about 85s).

Install the wheel into a fresh venv constrained to `uv export --locked`, and
cache the uv directory together with the venv under one key that falls back
to the latest entry for the same Python version. Prune the uv cache with
`--ci` so only locally built wheels are kept.
@github-actions

Copy link
Copy Markdown

kics-logo

KICS version: v2.2.1

Category Results
CRITICAL CRITICAL 0
HIGH HIGH 0
MEDIUM MEDIUM 0
LOW LOW 0
INFO INFO 0
TRACE TRACE 0
TOTAL TOTAL 0
Metric Values
Files scanned placeholder 3
Files parsed placeholder 3
Files failed to scan placeholder 0
Total executed queries placeholder 4
Queries failed to execute placeholder 0
Execution time placeholder 0

Queries Results

|
|

@notdodo

notdodo commented Nov 15, 2026

Copy link
Copy Markdown
Member Author

Folded into #39.

@notdodo notdodo closed this Nov 15, 2026
@notdodo
notdodo deleted the tests/locked-packaging-smoke branch November 15, 2026 11:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant