Skip to content

bug: CI が ubuntu-latest の PEP 668 で全 push / PR 失敗 #15

Description

@k-buchi4696

症状

.github/workflows/ci.ymllint / test ジョブが全て失敗し、
少なくとも 2026-04-12 以降 main への push は連続 5 回失敗中。

error: The interpreter at /usr is externally managed, and indicates the following:
  To install Python packages system-wide, try apt install python3-xyz, ...
hint: Virtual environments were not considered due to the `--system` flag
Process completed with exit code 2.

原因

Ubuntu 24.04 (現 ubuntu-latest) のシステム Python は
PEP 668EXTERNALLY-MANAGED
フラグを持つ。uv pip install --system/usr の Python を対象に
するため PEP 668 に引っかかり拒否される。

該当行 (.github/workflows/ci.yml):

  • L16: uv pip install --system ruff
  • L29: uv pip install --system -e ".[dev]"

uv python install 3.12 で uv 管理の Python は入るが、--system
それを無視してシステム Python に書こうとするため噛み合っていない。

影響

対応案

いずれか。最小の差分は 案 A:

案 A: --system を外し uv-managed Python を使う

- uses: astral-sh/setup-uv@v4
- run: uv python install 3.12
- run: uv venv
- run: uv pip install ruff
- run: uv run ruff check autoforge/ tests/

または UV_SYSTEM_PYTHON=1 を設定し uv の「システム Python」を
uv 管理版にリダイレクトする。

案 B: pyproject.toml + uv.lockuv sync

- run: uv sync --frozen --extra dev
- run: uv run pytest -v ...

再現性が高い反面、uv.lock の追加・運用が必要。

案 C (非推奨): --break-system-packages を付ける

PEP 668 を蹴り飛ばす。CI 環境変更に弱く今後また壊れる。

再現

gh run view 24436462925 --log-failed

備考

このスコープは PR #14 (Java/Kotlin/Ruby 対応) の範囲外。
PR #14 のテストはローカルで 612/612 緑なので、CI 修正後に再実行で
通るはず。

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions