michaelfeil / michaelfeil/infinity
Running infinity cli with click >8.2.1 fails with TypeError: Secondary flag is not valid for non-boolean flag
- Dominant language
- Python
- Stars
- 2.9k
- Forks
- 206
- PR merge metrics
- No merged PRs in 30d
Description
### System Info
As seen in #649
Workaround: Pin click to <8.3.0
Full error message
infinity_emb v2 --help
/home/akk/micromamba/envs/infinity077/lib/python3.12/site-packages/torch/onnx/_internal/registration.py:159: OnnxExporterWarning: Symbolic function 'aten::scaled_dot_product_attention' already registered for opset 14. Replacing the existing function with new function. This is unexpected. Please report it on https://github.com/pytorch/pytorch/issues.
warnings.warn(
╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── Traceback (most recent call last) ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ /home/akk/micromamba/envs/infinity077/bin/infinity_emb:7 in │
│ │
│ 4 if __name__ == '__main__': ╭──────────── locals ─────────────╮ │
│ 5 │ if sys.argv[0].endswith('.exe'): │ sys = │ │
│ 6 │ │ sys.argv[0] = sys.argv[0][:-4] ╰─────────────────────────────────╯ │
│ ❱ 7 │ sys.exit(cli()) │
│ 8 │
│ │
│ /media/data4/yh/git/infinity/libs/infinity_emb/infinity_emb/cli.py:413 in cli │
│ │
│ 410 │ │ │ ) │
│ 411 │ │ │ │
│ 412 │ │ │ sys.argv.insert(1, "v2") │
│ ❱ 413 │ tp() │
│ 414 │
│ 415 │
│ 416 if __name__ == "__main__": │
│ │
│ /home/akk/micromamba/envs/infinity077/lib/python3.12/site-packages/typer/main.py:338 in __call__ │
│ │
│ /home/akk/micromamba/envs/infinity077/lib/python3.12/site-packages/typer/main.py:321 in __call__ │
│ │
│ /home/akk/micromamba/envs/infinity077/lib/python3.12/site-packages/typer/main.py:360 in get_command │
│ │
│ /home/akk/micromamba/envs/infinity077/lib/python3.12/site-packages/typer/main.py:342 in get_group │
│ │
│ /home/akk/micromamba/envs/infinity077/lib/python3.12/site-packages/typer/main.py:496 in get_group_from_info │
│ │
│ /home/akk/micromamba/envs/infinity077/lib/python3.12/site-packages/typer/main.py:590 in get_command_from_info │
│ │
│ /home/akk/micromamba/envs/infinity077/lib/python3.12/site-packages/typer/main.py:566 in get_params_convertors_ctx_param_name_from_function │
│ │
│ /home/akk/micromamba/envs/infinity077/lib/python3.12/site-packages/typer/main.py:900 in get_click_param │
│ │
│ /home/akk/micromamba/envs/infinity077/lib/python3.12/site-packages/typer/core.py:427 in __init__ │
│ │
│ /home/akk/micromamba/envs/infinity077/lib/python3.12/site-packages/click/core.py:2793 in __init__ │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
TypeError: Secondary flag is not valid for non-boolean flag.
### Information
- [ ] Docker + cli
- [x] pip + cli
- [ ] pip + usage of Python interface
### Tasks
- [x] An officially supported CLI command
- [ ] My own modifications
### Reproduction
Install infinity with click 8.3.0
```bash
infinity v2 --help
```
Contributor guide
No contributing guide indexed for this repository
Research direction
Start at infinity_emb/cli.py around cli() line 413 and reproduce `infinity v2 --help` with Click 8.3.0. Trace the Typer/Click parameter setup that triggers the error, then verify that the command completes without the TypeError while preserving the CLI behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100