Skip to content

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

Merged
SilverRainZ merged 4 commits into
sphinx-notes:v3from
arunoruto:feat/uv-installer
Oct 20, 2026
Merged

SilverRainZ merged 4 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.
SilverRainZ added a commit to SilverRainZ/silverrainz.github.io that referenced this pull request Oct 13, 2026
Use the installer input added by sphinx-notes/pages#61.

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
SilverRainZ added a commit to SilverRainZ/silverrainz.github.io that referenced this pull request Oct 13, 2026
Temporarily use the action from the PR's head (pinned to commit),
revert to sphinx-notes/pages@v3 once it is merged.

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
- Fall back to pip when INPUT_PYPI_INSTALLER is unset, so main.sh keeps
  working without going through action.yml
- Merge the two Setup python steps: a conditional cache expression
  avoids non-complementary if conditions (both steps were skipped for
  an invalid installer value with cache enabled) and keeps
  python-version in one place
- Bump setup-uv to v10.3.0

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
@SilverRainZ

SilverRainZ commented Oct 20, 2026 •

Copy link
Copy Markdown
Member

Thanks for the PR, the implementation looks solid — I also verified it against my own (dependency-heavy) site and the uv path works great: https://github.com/SilverRainZ/silverrainz.github.io/actions/runs/38355204509

Since "Allow edits by maintainers" is enabled, I'm pushing a small follow-up commit directly to this branch:

  • Rename the installer input to pypi_installer for clarity
  • Fall back to pip when INPUT_PYPI_INSTALLER is unset, so main.sh keeps working standalone
  • Merge the two Setup python steps into one with a conditional cache expression (the two if conditions were not complementary: an invalid installer value with cache: true skipped both steps)
  • Bump setup-uv to v10.3.0

Hope you don't mind.

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>

@SilverRainZ SilverRainZ left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@SilverRainZ
SilverRainZ merged commit 3b962c1 into sphinx-notes:v3 Oct 20, 2026
4 checks passed
SilverRainZ added a commit to SilverRainZ/silverrainz.github.io that referenced this pull request Oct 20, 2026
sphinx-notes/pages#61 is merged.

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
@arunoruto

Copy link
Copy Markdown
Contributor Author

Hope you don't mind.

Ofc not! Thanks for the merge!

@arunoruto
arunoruto deleted the feat/uv-installer branch October 20, 2026 12:40
SilverRainZ added a commit to SilverRainZ/silverrainz.github.io that referenced this pull request Oct 20, 2026
Use the pypi_installer input added by sphinx-notes/pages#61,
which is usually much faster than pip.

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
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

2 participants