Skip to content

Support uv as an optional, faster installer (with CI tests) - #61

Open
arunoruto wants to merge 2 commits into
sphinx-notes:v3from
arunoruto:feat/uv-installer
Open

Support uv as an optional, faster installer (with CI tests)#61
arunoruto wants to merge 2 commits into
sphinx-notes:v3from
arunoruto:feat/uv-installer

Conversation

@arunoruto

Copy link
Copy Markdown
Contributor

Closes #43, supersedes #58.

On #58, @SilverRainZ asked for this to be "optional and fully tested" — this PR is built around exactly that:

Optional: a new installer input, default pip. Nothing changes for existing users; installer: uv is pure opt-in, and unknown values fail fast with a clear error.

Fully tested: a new test.yml workflow builds this repository's own docs through the local action (publish: false) across the full matrix of installer (pip, uv) × cache (false, true), and asserts HTML output exists. It runs on every future PR, so the repo gains regression CI beyond this feature. Green run on my fork: https://github.com/arunoruto/sphinx-pages/actions/runs/30932486228 (uv jobs: 16–17s, pip jobs: 20–23s — even on this small docs project).

How it differs from #58

  • No virtual environment. Instead of uv venv + source activate, all uv installs use uv pip install --system, targeting the same setup-python interpreter that pip uses. This eliminates the venv/cache interaction concern raised in use uv #58 — the cache input works identically for both installers (covered by the test matrix).
  • Covers the PEP 735 pyproject_group path added in feat: support installing PEP 735 dependency groups from pyproject.toml #60: uv supports --group pyproject.toml:NAME natively, so the pip ≥ 25.1 self-upgrade is skipped on the uv path.
  • uv is provisioned by the official astral-sh/setup-uv action (pinned to v9.0.0; setup-uv no longer publishes major tags), with its cache tied to the existing cache input. When installer: uv, the pointless pip cache in setup-python is skipped.
  • All pip3 install call sites route through one small pkg_install() wrapper in main.sh, so future install paths automatically support both installers. As a drive-by, sphinxnotes-incrbuild>=1.0 is now quoted — previously the unquoted >= was parsed as a shell redirection.

README documents the new input and a short "Speed up installation with uv" tip.

🤖 Generated with Claude Code

…stallation

Add an opt-in `installer` input (default: `pip`) that switches all
dependency installation to `uv pip install --system`. Installs target
the interpreter provided by setup-python directly, so no virtual
environment is needed and all existing inputs (requirements_path,
pyproject_extras, pyproject_group, sphinx_version, cache) work
unchanged. uv itself is provisioned via the official astral-sh/setup-uv
action, with its cache tied to the existing `cache` input.

Closes sphinx-notes#43
Build the repository's own documentation through the local action
(publish: false) for every combination of installer (pip, uv) and
cache (false, true), and assert that HTML output is produced.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Switch to or add uv as an option for installing python requirements

1 participant