Is there support for making invoke.yaml context settings cli flags?
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 25/100
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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):
- Ngôn ngữ chính
- Python
- Star
- 4.8k
- Fork
- 412
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của pyinvoke/invoke
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 64/100
-
sdist is missing `pytest.ini` Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Tất cả issue của pyinvoke/invoke
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
-
enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100