Commit 2fcd54e
committed
Fix jsonargparse ValueError on Windows CI by using custom ArgumentGroup
Refactor jap_wrapper.py to explicitly define a custom ArgumentGroup class instead of relying on jsonargparse's dynamic subclass generation.
jsonargparse attempts to create an ArgumentGroup subclass that inherits add_argument from the parser by reading source code with inspect.getsource(). This mechanism is fragile and can fail on Windows CI (and likely frozen binaries), causing it to fall back to the standard ArgumentGroup.
When falling back, the standard ArgumentGroup lacks our add_argument wrapper that strips type when action is present. This results in ValueError: Providing both type and action not allowed because jsonargparse forbids this combination.
By explicitly defining ArgumentGroup with our mixin and setting self._group_class, we ensure our compatibility logic is always used.1 parent 7c35724 commit 2fcd54e
1 file changed
+19
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
21 | 22 | | |
22 | 23 | | |
23 | 24 | | |
| |||
56 | 57 | | |
57 | 58 | | |
58 | 59 | | |
59 | | - | |
60 | | - | |
| 60 | + | |
| 61 | + | |
61 | 62 | | |
62 | 63 | | |
63 | 64 | | |
| |||
108 | 109 | | |
109 | 110 | | |
110 | 111 | | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
111 | 128 | | |
112 | 129 | | |
113 | 130 | | |
| |||
0 commit comments