uv lock(): support non-quiet output from the .run target

オープン 初心者向け
#4,164 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
78/100
issue の種類
機能追加
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
python
領域
build-system

調査の方向性

@rules_python//python/uv:lock.bzl から始めて、マクロ lock() が .run ターゲットの uv コマンドをどのように組み立てているかを確認します。issue で説明されているオプションの quiet 動作を追加し、既存のデフォルトを維持したうえで、quiet = False の場合は通常の出力が可能になり、デフォルトでは引き続き --no-progress と --quiet が渡されることを検証します。

索引モデルが issue の本文から書いたものです。

説明

Problem

The lock() macro in @rules_python//python/uv:lock.bzl generates a .run target whose shell script hardcodes --no-progress --quiet when invoked via bazel run:

exec '.../uv' 'lock' '--no-python-downloads' '--no-cache' '--project' '.' '--python' '...' '--no-progress' '--quiet' "$@"

This means all uv output is suppressed. Passing --verbose does not work — uv rejects --quiet and --verbose together with an error:

error: the argument '--quiet...' cannot be used with '--verbose...'

Use case

We call bazel run //:uv_lock.run -- --check from a just recipe to verify that uv.lock is consistent with pyproject.toml (a developer workflow check, not a CI test). With --quiet hardcoded, there is no feedback on success and no details on failure about what changed. We want uv's normal output (e.g. "Resolved 562 packages in 5.75s" on success, or the list of changed packages on failure).

Proposed solution

Add an optional quiet attribute to the lock() macro (defaulting to True to preserve existing behavior) that controls whether --quiet and --no-progress are passed to the .run script:

lock(
    name = "uv_lock",
    srcs = ["pyproject.toml", "uv.lock"],
    out = "uv.lock",
    quiet = False,  # show uv output when running bazel run //:uv_lock.run
)

Workaround

We currently work around this by adding a custom Starlark rule (uv_lock_check_run) that inherits the same runfiles as .run but finds the uv binary at runtime and calls it directly without --quiet. This wrapper exists solely because the attribute is not exposed.

主要言語
Starlark
スター
690
フォーク
722
平均マージ
18時間 7分
マージ済み PR(30日)
56

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

bazel-contrib/rules_python のほかの issue

bazel-contrib/rules_python の issue をすべて見る

似ている issue

Build System の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。