chore(pytest): migrate Python tooling from rye to uv#489
Merged
Conversation
rye is in maintenance mode and its upstream recommends uv. This also fixes two latent issues rye could not catch: - requirements*.lock baked in machine-local absolute paths for the c2aenum path dependency; uv.lock records it as a relative path - requires-python claimed >= 3.7 but c2a-pytest-gaia requires >= 3.9, and the locked pytest 7.4.0 violated the pytest~=7.2.2 constraint; uv resolves both correctly CI now uses astral-sh/setup-uv and `uv sync --locked`, which fails if pyproject.toml and uv.lock drift apart. Python 3.11.3 is still pinned via .python-version and fetched by uv on demand. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
This PR migrates the pytest-focused Python tooling used by the examples/mobc and examples/subobc environments from rye to uv, updating project metadata, lockfiles, CI, and related documentation so dependency resolution is reproducible and aligned with uv’s workflow.
Changes:
- Converted the two pytest
pyproject.tomlfiles from rye-specific configuration to uv-compatible configuration (dependency groups +[tool.uv.sources]for localc2aenum). - Replaced the two
requirements*.locklockfiles withuv.lockfor both examples. - Updated CI (
pytest.yml) and development docs to useuv sync/uv run.
Reviewed changes
Copilot reviewed 5 out of 11 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| examples/subobc/src/src_user/test/uv.lock | Adds uv lockfile for subobc pytest environment. |
| examples/subobc/src/src_user/test/requirements.lock | Removes rye-generated lockfile. |
| examples/subobc/src/src_user/test/requirements-dev.lock | Removes rye-generated dev lockfile. |
| examples/subobc/src/src_user/test/pyproject.toml | Migrates subobc pytest project config to uv (sources + dependency-groups) and fixes project name / Python version constraint. |
| examples/mobc/src/src_user/test/uv.lock | Adds uv lockfile for mobc pytest environment. |
| examples/mobc/src/src_user/test/requirements.lock | Removes rye-generated lockfile. |
| examples/mobc/src/src_user/test/requirements-dev.lock | Removes rye-generated dev lockfile. |
| examples/mobc/src/src_user/test/README.md | Updates local setup/run instructions from rye to uv. |
| examples/mobc/src/src_user/test/pyproject.toml | Migrates mobc pytest project config to uv (sources + dependency-groups) and updates Python version constraint. |
| docs/development/development_environment.md | Updates development environment documentation from rye to uv. |
| .github/workflows/pytest.yml | Switches CI from setup-rye/rye sync+run to setup-uv/uv sync --locked + uv run. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Toshifumi Akima (ToshiAki64)
approved these changes
Jun 11, 2026
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.
概要
pytest 環境の Python ツーリングを rye から uv に移行する
Issue
詳細
examples/{mobc,subobc}/src/src_user/test/pyproject.tomlを uv 形式に書き換えc2aenum @ file:///${PROJECT_ROOT}/...という rye 独自の直接参照を[tool.uv.sources]の相対 path 指定に置き換え[tool.rye] dev-dependenciesを標準 (PEP 735) の[dependency-groups]に置き換え[tool.hatch.metadata]を削除c2a-example-mobc-pytestのままだったのを修正requirements*.lockを削除しuv.lockを生成pytest.yml):sksat/setup-rye→astral-sh/setup-uv(hash 固定),rye sync→uv sync --locked,rye run pytest→uv run pytestdevelopment_environment.md, test README) を uv に更新移行で発覚した rye 時代の問題(すべて解消)
requirements.lockには lock したマシンの絶対パス (file:///home/sksat/...) がコミットされていた.uv.lockは相対パス (directory = "../../src_core/enum-loader") で記録される>= 3.7と宣言していたが c2a-pytest-gaia が>= 3.9を要求しており,uv のユニバーサル解決がこれを検出.実態に合わせて>= 3.9に修正pytest~=7.2.2(=<7.3) という宣言に対して pytest 7.4.0 を解決していた.uv は 7.2.2 に正しく解決する検証結果
uv run pytest -m sils -v ./src_core/system/watchdog_timer ./src_core/system/mode_manager→ 2 passed影響範囲
rye sync→uv syncに変わる(C2A 本体・flight code への影響なし)uv sync --lockedになったため,今後 pyproject.toml だけ変えて lock 更新を忘れると CI が落ちるようになる補足
Python 3.11.3 の固定は従来どおり
.python-versionで行われ,uv が実行時に自動取得するため CI に setup-python 系のステップは不要🤖 Generated with Claude Code