feat: backend 依存管理の uv.lock 化と devshell の Nix build 化(ADR-0021 Phase 0+1)#499
Merged
Conversation
backend 依存の SSoT を手書き requirements.txt から pyproject.toml の [project.dependencies] + uv.lock へ差し替える。3 経路(ローカル / CI / 本番 Docker)の挙動は変えず、uv2nix 適用(Phase 1 以降)の前提を整備する。 - backend/pyproject.toml: [project] を追加し全依存を == 固定のまま移設。 CVE ピン留めの根拠コメントも移設(P7 維持)。[tool.uv] package=false - backend/uv.lock: uv lock で生成しコミット(gitignore から除外)。 旧 requirements.txt の直接依存 30 件が同一バージョンで解決されることを確認済み - backend/Dockerfile: builder で uv export により lock から requirements.txt を 生成し、従来の pip wheel → pip install 経路へ渡す(本番経路の挙動は不変) - CI(test.yml / mutation.yml): uv sync --locked へ変更(lock drift で fail)。 pip-audit は lock の全依存(推移的依存込み)を export して監査 - Makefile: install-backend を uv sync 化(.venv は Phase 1 まで維持) - renovate.json5: pip_requirements → pep621 manager へ(uv.lock も同一 PR で追従) - scripts/gen-third-party-licenses.py: 収集元を pyproject [project.dependencies] へ - CLAUDE.md: SSoT 生成物テーブルに pyproject → uv.lock の系統を追加 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AmQqSTooETKvU1jDM2mCBS
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (12)
💤 Files with no reviewable changes (2)
📝 WalkthroughWalkthroughBackend dependency management now uses ChangesBackend dependency migration
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related PRs
Suggested labels: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Merged
8 tasks
8 tasks
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.
変更概要
ADR-0021 の Phase 0 と Phase 1 の実装(コミットは Phase 単位で分割・独立に revert 可能)。
Phase 0(
09970da): backend 依存の SSoT を手書きrequirements.txtからpyproject.toml [project.dependencies]+uv.lockへ差し替え。3 経路(ローカル / CI / 本番 Docker)の挙動は不変。pyproject.tomlに[project]を追加し全 30 依存を==固定のまま移設(CVE ピン留め根拠コメントも移設 / P7 維持)uv.lockを生成・コミット。旧 requirements.txt の全ピンが同一バージョンで解決されることを機械照合で確認済みuv export --frozenにより lock から requirements.txt をビルド時生成し、従来のpip wheel→pip install経路へ渡す(本番経路の挙動は不変。Nix build 化は Phase 3)uv sync --locked化(lock drift で fail)。pip-audit は lock の全依存を export して監査(--python 3.13明示)pip_requirements→pep621manager へPhase 1(
2e44d21): devshell の Python 環境を uv2nix で Nix build 化し、ローカルのbackend/.venvを廃止。ADR-0021 の発端(VS Code の.venv絶対パス直書き)を解消。flake.nixに uv2nix / pyproject-nix / pyproject-build-systems を導入(wheel 優先で uv.lock から pythonSet を構成)。transitive input は全て follows で既存 nixpkgs に集約devforge-backend-env)から PATH 解決.venv/bin/*参照 10 箇所を PATH 解決へ置換(migrate/migrate-createの nix wrap 漏れも修正)--pythonpathを明示(ローカル = devshell python3、CI = uv sync の.venv/bin/python).vscode/settings.jsonのpython.defaultInterpreterPath絶対パス直書きを撤廃(direnv 経由の PATH 解決へ)セルフレビューチェックリスト
必須確認
make ciが pass している(lint + test + build-web)※作業環境の制約(下記)により CI 相当を個別実行: 新 devshell 内(.venv削除済み)で ruff / pyright 0 errors / pytest 724 passed / eslint / lint-web-messages / vitest 382 passed / build-web / lint-env-keys / lint-adr-index / lint-tdd すべて pass条件付き確認(該当する場合のみ N/A と記入)
app/schemas//app/routers/の変更なし(codegen-types 不要)web/src/の変更なし破壊的変更
uv lock、ローカルは.venv不要で devshell が全て提供)ADR(設計判断を伴う変更の場合のみ)
レビュー時の注目点
smoke-backendが green であることを必ず確認(Dockerfile の builder 変更が Phase 0 の要。作業環境のネットワークポリシーで Docker Hub pull が拒否されローカル build 未実施)nix developが通ることを一度確認してもらえると確実nix developは Python パッケージ群の Nix build が走るため数分かかる(2 回目以降はキャッシュ)🤖 Generated with Claude Code
https://claude.ai/code/session_01AmQqSTooETKvU1jDM2mCBS