Recommended way to forward arguments to commands
まだ誰も着手していません。
評価
調査の方向性
Start with Invoke's command-line parsing and Context entry points, focusing on the -- delimiter described in the issue. Determine whether forwarding is intended or needs an explicit API; done means the supported behavior is documented or the requested Context handling is specified and covered by an appropriate test.
索引モデルが issue の本文から書いたものです。
説明
It'd like to know the recommended way to forward arguments to a command. For example, I have a test task that runs PyTest and I'd like to forward any extra arguments along to pytest. The best way I've found to do this is delimit my task's arguments from those of pytest with --. If I do this invoke seems to ignore all the following arguments. Ultimately this means I can do the following:
import sys
from invoke import task
try:
EXTRA_ARGS = sys.argv[sys.argv.index("--") + 1: ]
except ValueError:
EXTRA_ARGS = []
@task
def test(ctx):
ctx.run(f"pytest {' '.join(EXTRA_ARGS)}"
Where usage could then be:
invoke test -- test_something.py::test_feature --maxfail=2
While this works, I searched through the documentation and even a bit of the code, but didn't see anything that would explicitly allow for this sort of "argument forwarding" pattern. Is this behavior intended or is there a better way to achieve this? If it is something that invoke intentionally supports, perhaps these extra args (everything following --) could be attached to the Context.
- 主要言語
- Python
- スター
- 4.8k
- フォーク
- 414
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
pyinvoke/invoke のほかの issue
-
[Security] Shell injection via Context.cd() path argument — metacharacters not escaped (CWE-78)対応中かも @HarshRajSinghania が 13 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
-
Runner.respond uses join leading to slowness対応中かも @aryansk が 50 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
-
Long tasks name make `invoke --list | grep a` crash with "invalid width"対応中かも @cyphercodes が 125 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
-
Type hints of config do not accept other values than str対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 64/100
pyinvoke/invoke の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
NousResearch/hermes-agent#133181 ·
メンテナーはふだん 1 日以内に返信
-
[oblt-aw][security] SEC-022 — findings (2026-10-05)対応中かも @elastic-vault-github-plugin-prod が今日担当しました。 オープンoblt-aw/ai/fix-ready oblt-aw/detector/security oblt-aw/triage/security-secrets
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
elastic/oblt-aw#2304 · コメント 2 件 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1時間未満 初心者へのやさしさ 90/100
huggingface/huggingface_hub#5083 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 64/100
deepset-ai/haystack#13107 ·
メンテナーはふだん 1 日以内に返信
-
[Bug]: index worker dies on LOG_LEVEL=info / empty / numeric before it can report a missing bootstrap対応中かも @sxh313 が今日担当しました。 オープンtriage/confirmed
難易度 2/5 1〜3時間 初心者へのやさしさ 90/100
agentscope-ai/agentscope#3130 ·
メンテナーはふだん 1 日以内に返信