Is there support for making invoke.yaml context settings cli flags?
まだ誰も着手していません。
評価
調査の方向性
Start with the configuration documentation and the task parameter handling represented by @task, Context, Collection.configure, and Collection.from_module. Determine whether configured values can become task parameters or CLI flags, and define completion as either a documented supported mechanism with tests or a clear explanation of the limitation.
索引モデルが issue の本文から書いたものです。
説明
CLI frameworks like Cobra work like this, your params aren't just settable as cli flags, but also in a config file.
It appears pyinvoke separates the two.
I can define cli flags on the individual funcs
@task
def show_config(ctx: Context, myflag: str, myotherflag: str):
But "configuration" is an entirely separate thing: https://docs.pyinvoke.org/en/latest/concepts/configuration.html
Is it at all possible to define flags as part of configuration like this:
ns = Collection()
col = Collection.from_module("my_module")
col.configure({"myflag": "default value", "myotherflag": "default value"})
ns.add_collection(col)
@task
def show_config(ctx: Context) # Have the decorator magically inject myflag and myotherflag from config
Is there a way I could add this myself if its not supported?
I looks like I can't expand a dict like this right?
d = dict(p1=1, p2=2)
@task
def my_cmd(ctx: Context, **d):
- 主要言語
- Python
- スター
- 4.8k
- フォーク
- 412
- PR マージ指標
- 30日以内にマージされた PR はありません
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
pyinvoke/invoke のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 64/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
pyinvoke/invoke の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100