Conversation
89f6898 to
5aa0956
Compare
5aa0956 to
7db38a1
Compare
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #9413 +/- ##
==========================================
- Coverage 76.52% 76.48% -0.04%
==========================================
Files 85 86 +1
Lines 14819 14907 +88
Branches 2214 2248 +34
==========================================
+ Hits 11340 11402 +62
- Misses 2802 2819 +17
- Partials 677 686 +9 ☔ View full report in Codecov by Sentry. |
14adfd2 to
c6452f7
Compare
|
@mauvilsa can you have a look, please? maybe look at the individual commits. is that had to import some internal stuff to implement guess this can soon be merged - it does not use most features of jsonargparse, but that should be in future PRs. |
c6452f7 to
5b9b450
Compare
mauvilsa
left a comment
There was a problem hiding this comment.
I haven't tried to run the code yet. But might do that in case I see weird behaviors.
d39fa19 to
2675b31
Compare
21f7548 to
e4e484f
Compare
|
(rebased on current master, added auto env var support) |
|
Hmm, I can't get "store_true" stuff working correctly: With that and without the value being set in the default config, overriding via If I set the value in the default config, it works, but I can not overwrite it with the env var. A hack with ActionYesNo also didn't work, because it does not like short options like Another weird hack: omni-us/jsonargparse#497 - is that the intended way? |
This I would consider this a bug. I will fix it. |
5ecc8e4 to
2347bd0
Compare
Previously, ArgparsePatternAction and ArgparsePatternFileAction appended recursion roots directly to args.paths. This mixed CLI positional paths with paths derived from patterns (e.g., using the `R` root path command in a pattern file), complicating downstream argument parsing and future jsonargparse integration. This commit introduces `args.pattern_roots` as a dedicated list for these accumulated root paths: - All argparse definition sites now initialize `pattern_roots=[]` alongside `paths=[]` - ArgparsePatternAction and ArgparsePatternFileAction write directly to `args.pattern_roots` - The build_matcher utility accepts both `include_paths` and `pattern_roots` and concatenates them internally - `create_cmd` iterations explicitly concatenate both lists before processing This ensures `args.paths` strictly reflects exactly what the user provided positionally, paving the way for a clean jsonargparse implementation without regressions in pattern behavior.
Guess it was triggered due to naming the variable "token", maybe "sort_key" is less problematic.
other validators / specs are also there and it is easier to maintain as Python code. the compress module is Cython code.
…approach The old code worked around argparse's flat namespace by appending _maincommand / _midcommand / _subcommand suffixes to every common option's dest (e.g. log_level_subcommand), then resolving them with CommonOptions.resolve() after parsing. This polluted config key names and env var names (BORG_LOG_LEVEL_SUBCOMMAND instead of BORG_LOG_LEVEL). jsonargparse nests subcommand arguments automatically, so the workaround is no longer needed. Each parser level now registers common options with their clean dest name. flatten_namespace() is updated to a two-pass depth-first walk so the most-specific (innermost) value wins naturally: borg --info create --debug → log_level = "debug" (subcommand wins) borg --info create → log_level = "info" (top-level fills gap) For append-action options (--debug-topic) values from all levels are merged (outer + inner) to preserve the accumulation behaviour.
Borg's ArgumentParser (in borg.helpers.argparsing) now subclasses jsonargparse's ArgumentParser and pre-sets two defaults that every borg parser uses: formatter_class = RawDescriptionHelpFormatter add_help = False
2347bd0 to
49ffccd
Compare
|
TODO before merging this:
|
Description
Adopt jsonargparse, fixes #6551.
Checklist
master(or maintenance branch if only applicable there)toxor the relevant test subset)