Commit 1c1c905
Fix factor selection via TOX_FACTORS environment variable (#3557)
The argparse action type for `-f`/`--factors` is `_AppendAction` with
`nargs="+"`, which produces `list[list[str]]` at runtime. But `get_type()`
only inferred `list[str]`, so `get_env_var()` produced a flat list of strings.
When `_parse_factors()` iterated over this, it treated each character as a
separate factor instead of each string.
Fix `get_type()` to detect `nargs` on `_AppendAction` and return the correct
nested type `list[list[str]]`. The existing `Convert` infrastructure already
handles nested generics — semicolons separate OR groups, commas separate AND
factors within a group.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>1 parent 0ee48ce commit 1c1c905
3 files changed
Lines changed: 32 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
69 | | - | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
70 | 73 | | |
71 | 74 | | |
72 | 75 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
152 | 152 | | |
153 | 153 | | |
154 | 154 | | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
155 | 181 | | |
156 | 182 | | |
157 | 183 | | |
| |||
0 commit comments