Case handling for `Choice` help output (values forced to lowercase)
还没有人认领这个 Issue。
评估
调研方向
使用 lean live deploy --help 重现回归,并比较 Click 8.1.8 与 8.2.0 或 8.2.1。首先检查 Click Choice 的行为以及 PR #2796 中的注册变更。当帮助输出保留已注册的大小写,同时不区分大小写的解析仍能正常工作时,即表示完成。
由索引模型根据 Issue 内容生成。
描述
Expected Behavior
Values passed to click.Choice should preserve their original casing when displayed in --help output.
Example:
--brokerage [Interactive Brokers|Tradier|Oanda|Bitfinex|Coinbase Advanced Trade|Binance|Zerodha|Samco|Terminal Link|Trading Technologies|Kraken|CharlesSchwab|IQFeed|Polygon|CoinApi|ThetaData|Custom data only|Bybit|TradeStation|Alpaca|Tastytrade|Eze]
Actual Behavior
Since Click 8.2.0, all values are displayed in lowercase, regardless of how they were registered:
--brokerage [paper trading|interactive brokers|tradier|oanda|bitfinex|coinbase advanced trade|binance|zerodha|samco|terminal link|trading technologies|kraken|charlesschwab|bybit|tradestation|alpaca|tastytrade|eze]
This misleads users into thinking only lowercase values are accepted.
Potential Solution
- create custom class
MyChoice(Choice)override get_metavar(...)
- Continue using case-folding for parsing input when case_sensitive=False.
- The regression likely comes from PR #2796, which lowercases values when registering.
Reproducing the Problem
-
run:
lean live deploy --help -
Click 8.1.8: casing preserved ✅
-
Click 8.2.0+: values all lowercase ❌
System Information
- Click version(s): 8.2.0, 8.2.1 (regression)
- Last working version: 8.1.8
- OS: All (confirmed on Windows 10, Ubuntu 22.04)
- Python: 3.11
Checklist
- I have completely filled out this template
- I have confirmed that this issue exists on the current
masterbranch - I have confirmed that this is not a duplicate issue by searching issues
- I have provided detailed steps to reproduce the issue
- 主要语言
- Python
- 星标
- 326
- 派生
- 168
- 平均合并
- 3 天 50 分钟
- 30 天内合并 PR
- 3
贡献指南
这个仓库没有索引到贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
QuantConnect/lean-cli 的其他 Issue
-
难度 4/5 3-5 天 新手友好度 55/100
QuantConnect/lean-cli#661 · 1 条评论 ·
-
难度 5/5 一周以上 新手友好度 25/100
QuantConnect/lean-cli#619 ·
-
feature
QuantConnect/lean-cli#602 · 6 条评论 · 3 个 reaction · 已指派 1 人 ·
-
难度 4/5 3-5 天 新手友好度 35/100
QuantConnect/lean-cli#579 ·
-
bug feature
难度 3/5 1-2 天 新手友好度 35/100
QuantConnect/lean-cli#574 · 1 条评论 · 1 个 reaction ·
查看 QuantConnect/lean-cli 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 75/100
anthropics/skills#1811 · 1 条评论 ·
-
难度 2/5 1-3 小时 新手友好度 75/100
speaches-ai/speaches#678 ·
-
bug
难度 2/5 1-3 小时 新手友好度 75/100
datalayer/mcp-compose#42 ·
-
难度 2/5 1-3 小时 新手友好度 75/100
conda-forge/spacy-feedstock#177 ·
-
难度 2/5 1-3 小时 新手友好度 70/100
UKGovernmentBEIS/inspect_evals#2523 ·