Skip to content
This repository was archived by the owner on Nov 21, 2026. It is now read-only.

CI: run Python tools with uvx and uv run, not pip or uv pip - #380

Merged
tae898 merged 1 commit into
mainfrom
ci/uv-not-pip
Oct 20, 2026
Merged

tae898 merged 1 commit into
mainfrom
ci/uv-not-pip

Conversation

@tae898

@tae898 tae898 commented Oct 20, 2026

Copy link
Copy Markdown

Closes #379.

The workflows no longer install anything with pip install or uv pip. One-off tools run with uvx at the pins they had, inline Python with dependencies runs with uv run --no-project --with, and the built wheel is tested in a throwaway uv run environment instead of the runner's interpreter.

  • docs-build: uvx --from mkdocs==1.6.1 --with <the three plugins> mkdocs build --strict.
  • deploy-python-docs: mike is a shell function around uvx --from mike==2.2.0 --with mkdocs....
  • lint-workflows: the trigger-coverage check runs with uv run --no-project --with pyyaml==6.0.3.
  • bandit: uvx "bandit==1.9.4".
  • pip-audit: uvx "pip-audit==2.10.1". The uv pip compile floor resolution is replaced by a PEP 723 header written from the declared dependencies and the same extras (requires-python ==<v>.*, resolution = "lowest-direct"), resolved with uv lock --script and printed with uv export --script. The export is universal, so the audited set is a superset of the old one (it adds platform packages such as colorama and cffi).
  • Wheel build: the "Install Python build dependencies" steps are gone; build.sh runs under uv run --no-project --python <v> --with build --with wheel --with setuptools, which puts the build tools first on PATH for build-native.sh on macOS and Windows (Linux builds in Docker as before).
  • Tests: the same package list and pins go into a requirements file, and pytest runs as uv run --no-project --python <v> --with ./test-install/*.whl --with-requirements ... pytest. The install step builds that environment first, so a dependency that cannot be resolved fails there.
  • Examples: the wheel and the per-platform requirements (the numpy split kept) go through uv run the same way; torch comes from the PyTorch CPU index via UV_INDEX with UV_INDEX_STRATEGY=unsafe-best-match.
  • uv is still installed with the pinned installer (0.12.0); the step is copied into the three jobs that did not have it. ci-setup.md, documentation.md and release.md describe the new commands.

Checked locally on this tree: actionlint (no new findings against main), pre-commit on bindings/python and the workflows, the strict docs build as the new step runs it, the trigger-coverage check, both bandit runs, the floor audit for 3.11 to 3.14, the pytest/examples/build/mike command shapes with a dummy wheel, and the torch resolution for linux, arm64, macOS and Windows (torch resolves to the CPU build, numpy and requests from PyPI). Not checked locally: the macOS and Windows build and examples paths, which this PR's CI runs.

Left for a follow-up: bindings/python/scripts/ (Dockerfile.build, ensure-build-tools.sh, after_tag_verify.sh) still use uv pip; they are not workflow steps.

🤖 Generated with Claude Code

Bandit, pip-audit, the mkdocs toolchain and mike run with uvx at their existing pins. The inline pyyaml check runs with uv run --with. The wheel tests and the examples run in a throwaway uv run environment (wheel plus the same package lists), with torch from the PyTorch CPU index via UV_INDEX and unsafe-best-match. The macOS and Windows wheel builds run build.sh under uv run --with build. The dependency floor audit resolves through a generated PEP 723 header with uv lock --script and uv export --script instead of uv pip compile. ci-setup.md and the two docs that described the old deploy install are updated.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@tae898
tae898 merged commit bcc9b9f into main Oct 20, 2026
42 of 44 checks passed
@tae898
tae898 deleted the ci/uv-not-pip branch October 20, 2026 22:20
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CI: install and run tools with uvx and uv run, not pip or uv pip

1 participant