Repository navigation
ci(uv): install with uv and move the lazy-namespace check into the suite - #17
Merged
Merged
Conversation
Every job spent 5-15 s in pip: upgrading pip, then installing two dependencies (tests), build + twine (release build) or the wheel (release verify). astral-sh/setup-uv (pinned to v10.3.3; there is no floating v10 tag) replaces those steps: tests.yml uv pip install --system -e . build uv build, uvx twine check --strict verify uv pip install --system dist/*.whl, uv pip check --system setup-python still provides the interpreter, so `python` in later steps is unchanged and 3.15 comes from the runner's tool cache. uv caching is off: restoring a cache costs about what downloading numpy and safetensors does. Dependencies still resolve to the latest release on every run, as with pip; there is no lockfile. publish-pypi now only runs on a published release. A workflow_dispatch run builds, verifies and stops at TestPyPI (skip-existing), so the release workflow can be exercised from a branch without publishing it.
tests.yml checked a hand-written list of 20 top-level names, so a new public name was only covered if someone also edited the workflow. tests/config/test_lazy_namespace.py walks every __init__.pyi under aether/ instead and, per package, checks that the stub's re-exports match its __all__, that the stub's __all__ matches the runtime __all__ built from the lazy map, and that every name resolves. That enforces the rule that a public name goes in both the lazy map and the stub. It found four names the top-level map resolves but aether/__init__.pyi did not list: Accuracy, Optimizer, Preprocess and deserialize (merged in from the subpackage maps), so editors had no completion for them. They are now in the stub; nothing changes at runtime. tests.yml drops the steps the suite already covers: the import check (the suite imports aether first), the lazy-namespace list, the declared dependencies check (a missing one fails the suite's imports on a clean install) and the no-CuPy check (config only enables CuPy with a device, so a leaked cupy dependency would skip the GPU tests, not fake them). release.yml keeps its import-every-submodule check.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Context
CI spent most of each install step inside pip, and
tests.ymlchecked a few things the suite already covers, or should. This PR moves both workflows to uv, stops manual release runs from publishing to PyPI, and moves the lazy-namespace check into the suite. Two commits, neither mechanical:58df4e6(uv and the publish guard) and798d4d9(namespace test, stub fix, CI steps removed).uv (
58df4e6)Step times from the latest runs on
main:Install package(pip upgrade +pip install -e .)Install build tooling(pip upgrade + build + twine)Install the wheel(4 verify jobs)astral-sh/setup-uvreplaces those withuv pip install --system -e .,uv build+uvx twine check --strict, anduv pip install --system dist/*.whl+uv pip check --system. It's pinned tov10.3.3, since there's no floatingv10tag, so updates are manual.setup-pythonstill provides the interpreter, so every laterpythonstep is unchanged. uv's cache is off because restoring it costs about as much as downloading numpy and safetensors. As with pip, dependencies resolve to their latest release on every run, and there's no lockfile.The time saved is a few seconds per job (the jobs run in parallel), plus around 15–20 s across the release build and verify jobs. The two publish jobs (~45 s together) are mostly upload time and don't change.
Manual release runs
publish-pypihad noif:, so aworkflow_dispatchrun from a branch went on to publish to PyPI if that version wasn't released yet, unless thepypienvironment's protection rules stopped it. It now runs only onrelease: published. A manual run builds, verifies and stops at TestPyPI (skip-existing), which is also how this PR'srelease.ymlchanges can be tested.Lazy namespace check (
798d4d9)tests.ymlchecked a hand-written list of 20 top-level names, so a new public name was only covered if someone also edited the workflow.tests/config/test_lazy_namespace.pyinstead finds every__init__.pyiunderaether/, and for each package it checks that:__all____all__matches the runtime__all__built from the lazy mapThat enforces the CLAUDE.md rule that a public name goes in both the lazy map and the
.pyi.On
mainit fails for the top-levelaetherpackage.ae.Accuracy,ae.Optimizer,ae.Preprocessandae.deserializeresolve at runtime because the top-level map merges the subpackage maps, butaether/__init__.pyidoesn't list them, so editors had no autocomplete for them. They're now in the stub.Steps removed from
tests.ymlbecause the suite covers them:aetherfirst.config.pyonly enables CuPy when a device is present, so a cupy package leaking into the dependencies would skip the GPU tests, not fake them.release.ymlkeeps its check that every submodule imports without a GPU backend.Behavior changes
Accuracy,Optimizer,Preprocessanddeserializeon top-levelaether. Runtime is unchanged.release.ymlno longer publishes to PyPI.Testing
python3 -m unittest discover tests: 1144 tests pass on NumPy and CuPy (65 skipped).test_lazy_map_matches_stub_and_resolvesfails onmain'saether/__init__.pyion both backends and passes with the stub fix. The file takes ~6 ms, and a fresh process running it isn't measurably slower than a bareimport aether.