Skip to content

ci: run uv from the flake dev shell via nix-setup - #422

Merged
furedea merged 3 commits into
mainfrom
ci/23-dev-shell
Nov 9, 2026
Merged

furedea merged 3 commits into
mainfrom
ci/23-dev-shell

Conversation

@furedea-agent

@furedea-agent furedea-agent Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

概要

CI の Python ジョブから astral-sh/setup-uv をやめ,flake の devShell の uv で動かす.Nix の準備は reusable-workflows の nix-setup(v1.3.0)に統一する.これで ci.yml に言語のツールを入れる action がなくなる.

Refs furedea/reusable-workflows#23

変更

コミット 内容
feat(nix): add uv to the dev shell devShell に Home Manager と同じ unstable.uv を足す.devShell は x86_64-linux でも出る(既存)
ci: run uv from the flake dev shell via nix-setup setup-uv と install-nix-action を nix-setup に置き換え,Python ジョブの shell を nix develop --command bash -eo pipefail {0} にする
chore(nix): update nixpkgs-unstable for uv 0.13.5 nix flake update nixpkgs-unstable(下記)
  • job 名と all-green の needs は変えていない(必須チェックは同じ).
  • Python 本体は devShell に入れない.手元と同じく uv が .python-version と pyproject.toml の指定(3.15.1)を取得する.python_315.nix を入れると Linux でソースからビルドになり遅いため.
  • nixpkgs-unstable の更新が必要だった理由:更新前の uv 0.13.4 は Python 3.15.0 までしか知らず,requires-python >= 3.15.1 を満たせず CI が落ちた(setup-uv は最新の uv を入れていたので落ちなかった).uv 0.13.5 が 3.15.1 を追加している.この更新は unstable.* の他のパッケージ(lefthook 2.2.2,dprint 0.64.3 など)も上げる.

検証

  • nix flake check --all-systems --no-build --option allow-import-from-derivation false が通った(lock 更新の前後とも).
  • devShell 内で uv run ruff check,uv run ty check,uv run pytest -m 'not integration'(163 件)が通った(lock 更新後).
  • CI の全ジョブと all-green,claude-review,codex-review が緑.

CI の時間

比較は main の run 42612982268(変更前)と,この PR の run 42622651969(変更後).レビュー系(codex-review 2 分 36 秒など)は PR にだけ走るので除く.

ジョブ 変更前 変更後
bats-tests 84 秒 66 秒
nix-check 98 秒 78 秒
format-check 47 秒 37 秒
shell-lint 35 秒 42 秒
lua-lint 33 秒 36 秒
test-python 16 秒 46 秒
lint-python 8 秒 37 秒
audit-python 9 秒 47 秒
最も長いジョブ(全体の目安) 98 秒 78 秒

Python のジョブは uv の Python とパッケージのキャッシュがなくなり,Nix の準備も加わるため 30 秒ほど延びた.並列で走るので,全体の待ち時間(最も長いジョブ)は延びていない.変更前後の差は Runner のばらつきも含む(1 回ずつの測定).

計画との差

なし.

🤖 Generated with Claude Code

furedea and others added 2 commits November 9, 2026 21:39
CI runs uv from the dev shell instead of setup-uv, so the Home Manager
profile and CI use the same uv from flake.lock. uv still fetches the
Python that .python-version and pyproject.toml request.

Refs furedea/reusable-workflows#23

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Replace setup-uv and install-nix-action with the shared nix-setup
action, and run the Python jobs through nix develop, so CI uses the
uv pinned by flake.lock.

Refs furedea/reusable-workflows#23

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@furedea

furedea commented Nov 9, 2026

Copy link
Copy Markdown
Owner

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-09T13:09:50.179714Z 18f2c96 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions

github-actions Bot commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

Review summary: no findings.

Checked:

  • setup-uv is removed from all four uv jobs (bats-tests, lint-python, test-python, audit-python). Each job now uses [email protected] and runs its steps through nix develop. The devShell for x86_64-linux now includes shellUnstable.uv, the same uv the Home Manager profile uses, so uv run resolves inside the shell.
  • UV_LOCKED=1 is still set at the workflow level, and uv still fetches the Python pinned in .python-version.
  • Job names and the needs list in all-green are unchanged, so the required checks stay the same.

One non-blocking note: the uv/Python cache that setup-uv provided (enable-cache, cache-python) is gone. That may make CI slower, but it is not a correctness problem.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 🎉

Reviewed commit: e0ee050f19

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

uv 0.13.4 only knows Python 3.15.0, so uv in the dev shell cannot satisfy
requires-python >= 3.15.1 on CI. uv 0.13.5 adds the 3.15.1 download.

Refs furedea/reusable-workflows#23

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@furedea

furedea commented Nov 9, 2026

Copy link
Copy Markdown
Owner

@codex review

@github-actions

github-actions Bot commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

Review summary: no blocking issues found.

  • The Python jobs now get uv from the flake dev shell, which pins it to shellUnstable.uv through flake.lock. The dev shell has no Nix Python, so uv still picks the 3.15 interpreter that .python-version asks for.
  • bats-tests already ran uv run under nix develop. With setup-uv gone, it now gets uv from the dev shell, so that job still works.
  • Not blocking: the flake.lock change moves the root nixpkgs-unstable input to a newer revision. That also updates every unstable.* package in the Home Manager profile, not just uv. The PR description doesn't mention it, so it may be worth adding a line.
  • The setup-uv Python and package cache is gone, so each job now downloads Python again. That only costs time; the description already marks the CI duration as still being measured.

No P0/P1 findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Bravo.

Reviewed commit: 18f2c969f7

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@furedea
furedea merged commit be738e6 into main Nov 9, 2026
21 checks passed
@furedea
furedea deleted the ci/23-dev-shell branch November 9, 2026 13:29
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