Changelog
All notable changes to this project will be documented in this file. Versions
follow Semantic Versioning
(<major>.<minor>.<patch>). Backward incompatible (breaking) changes will
only be introduced in major versions with advance notice in the Deprecated
section of releases.
The semantic versioning only considers the public API as described in API Reference. Components not mentioned in API Reference or different import paths are considered internals and can change in minor and patch releases.
v4.50.0 (unreleased)
Added
FromConfigMixin.from_configwithconfig_read_mode_fsspec_enabled=Truenow supports fsspec config loading including the resolving of relative paths (#918).
Changed
Drop support for Python 3.9. The minimum supported Python version is now 3.10 (#916).
v4.49.0 (2026-05-15)
Added
Support
DequeandFrozenSetin type hints (#905).
Fixed
Detect loops in config files that recursively load subconfig files and raise an error showing the config chain instead of recursing indefinitely (#910).
Changed
Deprecated
Implicit component discovery in
auto_cli(calling without acomponentsargument) was deprecated and will be removed in v5.0.0. Pass components explicitly; explicit is better than implicit (#895).instantiate_classesis deprecated and will be removed in v5.0.0. Instead useinstantiate(#896).ArgumentParser.add_instantiatoris deprecated and will be removed in v5.0.0. Use the global functionjsonargparse.add_instantiatorinstead (#899).Namespace.get_sorted_keysandNamespace.get_value_and_parentare deprecated and will be removed in v5.0.0. Instead run.keys()and then sort or get the parent and leaf separately. (#900).Path.get_contentis deprecated and will be removed in v5.0.0. Instead usePath.read_textfor text andPath.openfor binary content (#906).enable_pathparameter ofArgumentParser.add_argumentwas deprecated and will be removed in v5.0.0. Usesub_configsinstead, which is consistent with thesub_configsparameter of the signature methods,ArgumentParser.add_class_argumentsetc. (#907).enable_pathparameter ofActionJsonSchemawas deprecated and will be removed in v5.0.0. Usesub_configinstead (#907).
v4.48.0 (2026-04-10)
Added
AST resolver now supports nested attribute calls like
module.submodule.function(**kwargs)(#878).register_typenow supportsTypeAliasType(python 3.12+) in addition to classes, and registered aliases no longer add subclass help actions (#875).add_class_argumentsskip support for callable return class parameters (#882).FromConfigMixinis now an official public API feature (#884).
Fixed
Fix resolving forward references in generic aliases (e.g.
list["ForwardReferenced"]) when the forward-referenced type is not imported in the using module (#871).auto_clino longer fails when a single function, a class__init__, or a function/class in a list/dict of components has a parameter namedconfig(#873).
Changed
Now all missing required options are listed in the error message (#876).
class_from_functionandlazy_instanceare now located injsonargparse.typingwhile the previous import locations are kept for compatibility (#877).Most argparse tests from the Python standard library are run against jsonargparse. Also the explicit deviations from argparse are documented (#881).
Replace black and yesqa with ruff in pre-commit (#883).
Removed
reconploggerintegration (#886).Avoid expensive inspect.stack in parse_args path and other optimizations to speed up test suite (#887).
Rely on
requiredattributes to improve compatibility with third-party argparse extensions (#890, #893).
v4.47.0 (2026-03-13)
Added
Improved
shtabbash typehint completions forUnionandLiteral: choices for unions that also accept open values now require a prefix to be completed, and literal booleans/Nonenow complete asfalse/trueandnull(#851).auto_clinow supports areturn_instanceparameter to instantiate class components directly instead of exposing methods as subcommands (#855).New
ArgumentParser.get_completion_script(completion_type)public method to generate completion scripts programmatically, and newset_parsing_settings(add_print_completion_argument=...)setting andJSONARGPARSE_ADD_PRINT_COMPLETION_ARGUMENTenvironment variable to opt-in automatic addition of--print_completionwhenshtabis installed (#859).
Fixed
Positional arguments with
nargs="*"ornargs="?"now correctly allow default values, matching standard argparse behavior (#846).Parsing of floats with implicit leading zero (e.g.
-.5) not working (#847).Subcommand names now correctly take precedence over top-level option strings with the same name, fixing a failure during typed sub-default processing (#853).
--helpno longer fails withIndexErrorfor options without explicit help text while keepingargparsecompatibility forhelp=None(#854).store_trueandstore_falsearguments now parse boolean environment variable values astrue/falseand raise a clear error for invalid values (#858).Environment variable overrides now correctly take precedence over
default_config_filesvalues for subcommands and nested subsubcommands (#862).omegaconf+incorrectly applied fordefault_config_files(#865).ActionSubCommands.add_subcommand()missing from API reference (#863).
Changed
Tests are no longer installed by default, there is a separate
jsonargparse_testswheel file for that (#843).Adding argument giving both
typeandactionis now allowed (#845).Parsers no longer auto-add
--print_shtabby default. Completion script generation now usesshtab-*completion types, and whenget_completion_scriptis used the parser instance is invalidated for further use. A hidden--print_shtabargument remains to guide users to the new opt-in completion setting (#859).JSONARGPARSE_DEBUGcan only be enabled withtrue(case-insensitive) (867).
v4.46.0 (2026-02-02)
Added
Public interface for enabling/disabling support of type subclasses (#817).
Fixed
Choices with an int type not working correctly (#827).
Union of dataclasses not discarding parameters on class change (#833).
Targets of links applied on parse not being instantiated (#834).
Validation of defaults getting stuck for path with
-(stdin) default (#837).Failure when parsing deeply nested dataclass with a union parent (#839).
v4.45.0 (2025-12-26)
Added
Fixed
Dict override syntax to allow standard form: –cfg.dict.key val (#824).
Evaluation of postponed annotations for dataclass inheritance across modules not working correctly (#814).
Getting parameter descriptions from docstrings not working for dataclass inheritance (#815).
default_env=Trueconflicting withdefault_config_files(#818).default_config_fileswith settings for multiple subcommands not working correctly (#819).register_typenot checking that the given type is a class (#820).
Changed
v4.44.0 (2025-11-25)
Fixed
Changed
Improved error messages when not accepted options are given, referencing which parser/subcommand the option was given to. Also suggests running
--helpfor the corresponding parser/subcommand (#809).The
yaml_commentsparameter ofArgumentParser.dumphas been renamed towith_commentsto allow future comments support of other formats (#811).
Deprecated
ArgumentParser.default_metaproperty andwith_metaparameter ofArgumentParser.parse_*are deprecated and will be removed in v5.0.0. Instead use.clone(with_meta=...)(#810).The
yaml_commentsparameter ofArgumentParser.dumpis deprecated and will be removed in v5.0.0. Usewith_commentsinstead (#811).
v4.43.0 (2025-11-11)
Added
Non-public experimental mixin class to override init defaults and instantiate from config (#800).
Fixed
Prevent extra environment variables in helptext when default_env=True, for version actions and subcommands (#787).
Unionwith path type and non-path value incorrectly dumped as string (#789).Misleading error message for invalid value for
Literalstrings (#790).Changing
omegaconf_absolute_to_relative_pathsnot taking effect after parsing once (#805).
Changed
parse_optionals_as_positionalsandapplied_instantiation_linksno longer marked as experimental (#788).Moved location of
Pathclass fromjsonargparsetojsonargparse.typing(#792).Non-parsing actions now have a common base class to ease identification (#793).
jsonargparse.*modules now use Python 3.9+ syntax (#798).
Deprecated
Path.__call__is deprecated and will be removed in v5.0.0. Use theabsoluteorrelativeproperties instead (#794).strip_metais deprecated and will be removed in v5.0.0. Instead use.clone(with_meta=False)(#795).compose_dataclassesis deprecated and will be removed in v5.0.0. There is no direct replacement, whoever is interested can copy the code (#796).dict_to_namespaceis deprecated and will be removed in v5.0.0. No replacement is provided because blindly converting a dictionary to a namespace may not yield the same results as using a parser, which could lead to confusion (#797).
v4.42.0 (2025-10-14)
Added
set_parsing_settingsnow supports settingallow_py_filesto enable stubs resolver searching in.pyfiles in addition to.pyi(#770).Experimental support for dataclass inheritance (#775).
Experimental support for pydantic
BaseModelsubclasses (#781).Argument to print help for dataclasses nested in types, e.g.
Optional[Data],Union[Data1, Data2](#783).set_parsing_settingsnow supportsomegaconf_absolute_to_relative_pathsto enable backward compatibility ofomegaconf+parser mode by converting absolute paths to relative in interpolations (#774).
Fixed
Stubs resolver in some cases failing with maximum recursion error (#770).
dataclasswith default failing whenvalidate_defaults=True(#771).Misleading error message when a namespace is used in a list comprehension (#772).
omegaconf+parser mode failing when there areinf,-infornanvalues (#773).savewithmultifile=Truenot saving separate subconfigs for items in a list (#779).omegaconfparser mode failing on spawned processes (#784).
v4.41.0 (2025-09-04)
Added
Support for Python 3.14 (#753).
Support callable protocols for instance factory dependency injection (#758).
New
ActionFailfor arguments that should fail parsing with a given error message (#759).Experimental
omegaconf+parser mode that supports variable interpolation and resolving across configs and command line arguments. Depending on community feedback, in v5.0.0 this new mode could replace the currentomegaconfmode, introducing a breaking change (#765).
Fixed
Improved parameter kind handling for argument requirement determination.
KEYWORD_ONLYparameters now correctly use--flagstyle (#756).Some deprecations not shown in the API documentation (#760).
Environment variable names not shown in help for positional arguments when
default_envis true (#763).parse_objectnot parsing correctly configs (#765).
Changed
Deprecated
DefaultHelpFormatter.*_yaml*_comment*methods are deprecated and will be removed in v5.0.0. This logic has been moved to a new private classYAMLCommentFormatter. If deemed necessary, this class might be made public in the future (#754).The
ruyamloptional dependency is deprecated and will be removed in v5.0.0. Instead use theruameloptional dependency (#768).
v4.40.2 (2025-08-06)
Fixed
v4.40.1 (2025-07-24)
Fixed
print_shtabincorrectly parsed from environment variable (#726).adapt_class_typeused a locally defined partial_instance wrapper function that is not pickleable (#728).ArgumentParser with dashes incorrectly resolves paths to default values (#736).
Fix failing tests due to new version of
typeshed-client(#740).Require new version of
docstring-parserto avoid deprecation warnings (#741).
v4.40.0 (2025-05-16)
Added
New
auto_parserfunction for convenience and more visibility of thecapture_parserfeature (#721).
Fixed
set_parsing_settings(validate_defaults=True)fails when the parser has a config action (#718).Regression causing dump/save to fail when
skip_link_targets=Trueand target being an entire required dataclass (#717).TypedDictvalues not validated when types are forward references (#722).Stubs-only resolver incorrectly triggered when
inspect.signatureavailable leading to missing parameter defaults (#724).
Changed
Use latest jsonnet release that works on all platforms and python versions (#682).
Deprecated
v4.39.0 (2025-04-29)
Added
shtabhint for positionals in bash now includes the argument name (#699).shtabsupport for optionals parsed as positionals (#700).auto_clinow supports class@property(#701).Resolve parameters completely from stubs when
inspect.signaturefails (#698).Option to enable validation of default values (#711).
Experimental support for custom instantiators receiving values applied by instantiation links (#716).
Changed
Fixed
Deprecated
get_config_read_mode,set_config_read_modeandset_docstring_parse_optionsare deprecated and will be removed in v5.0.0. Instead ofset_config_read_modeandset_docstring_parse_optionsuseset_parsing_settings. There will be no replacement forget_config_read_modesince this is considered internal (#712).
v4.38.0 (2025-03-26)
Added
Changed
Fixed
add_class_argumentswith dashes in thenested_keyfail to instantiate (#679).Regression parsing strings with omegaconf as the parser mode (#686).
Help incorrectly showing environment variable name for
--print_shtab.add_argumentraises error when type is assigned withaction=None(#687).shtabfailing when parser has positional arguments (#693).
v4.37.0 (2025-02-14)
Added
Experimental support for sub-classing
ArgumentParserto customizeadd_argument(#661).
Fixed
Incorrect instantiation order when instantiation targets share a parent (#662).
Pydantic discriminated unions handled incorrectly (#667).
Failure when a link target has an undefined parent (#668).
Functions that create types now have
TypeAliasreturn type to avoid mypy errors (#671).Regression when using old
CLIand inferring components from the local context (#676).
v4.36.0 (2025-01-17)
Added
Changed
jsonargparse.CLIrenamed tojsonargparse.auto_clito follow PEP 8 functions naming convention (#640).ArgumentParser.check_configrenamed tovalidateandskip_checkparameter ofArgumentParser.{dump, save, get_defaults}renamed toskip_validation(#639).Fail when
Namespaceis used as a type to make it clear about being unsupported (#656).
Fixed
Deprecated
ArgumentParser.check_configandskip_checkparameter ofArgumentParser.{dump, save, get_defaults}are deprecated and will be removed in v5.0.0, instead usevalidateandskip_validation(#639).
v4.35.0 (2024-12-16)
Added
Support for
print configargument to reuse the name of the config argument by using%s(#630).
Changed
Fixed
Account for change in
ArgumentParser._parse_known_argssince Python 3.12.8 and 3.13.1 (#644).
Deprecated
v4.34.1 (2024-12-02)
Fixed
v4.34.0 (2024-11-08)
Added
Support for PEP 692, i.e.,
Unpack[TypedDict]annotations for**kwargs(#586).
Fixed
Empty tuples are now parsed correctly instead of raising an error (#592).
Required and optional
TypedDictkeys are now correctly inferred when one inherits oneTypedDictfrom another with different totality (#597).Callables that return class not considering previous values (#603).
Custom instantiators not working for nested dependency injection (#608).
Failure when resolving forward references from dataclass parameter types (#611).
Fix callable protocol inheritance. (#599).
Changed
Callables that return class with class default now normalizes the default to a subclass spec with
class_path(#603).
v4.33.2 (2024-10-07)
Fixed
Fix parse_argv_item to address the behavior change in argparse since Python 3.12.7 (#591).
v4.33.1 (2024-09-26)
Fixed
Use
jsonnet-sdistfor python 3.13 to be allowed to push package to pypi (#584).
v4.33.0 (2024-09-25)
Added
Fixed
Changed
v4.32.1 (2024-08-23)
Fixed
v4.32.0 (2024-07-19)
Added
Fixed
dumpfailing when a link target requires serialization andskip_link_targets=False(#542).default_config_filesmaking parse fail for subcommands and nested subclass types (#549).Fixes related to transformers
PreTrainedModel.from_pretrained(#551):Import path of inherited classmethod not resolving correctly (#548).
Resolved parameters leading to multiple values for keyword argument (#551).
Function with return type a class in
class_pathin some cases fails with unexpectedinstantiateparameter error (#551).Ignore incorrectly resolved
config_file_nameparameter for transformers modelfrom_pretrained(#551).
v4.31.0 (2024-06-27)
Added
Fixed
Changed
Now
--*.helpoutput shows options withoutinit_args(#533).
v4.30.0 (2024-06-18)
Added
Allow adding config argument with
action="config"avoiding need to import action class (#512).Allow providing a function with return type a class in
class_path(#513).Automatic
--print_shtaboption whenshtabis installed, providing completions for many type hints without the need to modify code (#528).
Fixed
Parsing incorrectly provides file content when type is a union with a subclass, PathLike and string (#518).
--print_configfailing in some cases (#531).Callable that returns class not using required parameter default from lambda (#523).
Failing to parse list of dataclasses with nested optional dataclass (#527).
List of union of classes not accepted by
add_subclass_argumentsinpython>=3.11(#522).Optional pydantic model failing to parse with __pydantic_private__ error (#530).
v4.29.0 (2024-05-24)
Added
Fixed
Parameter resolving falling back to assumptions resolver for optional
Uniontypes (#498).Nested parameters failing to parse from command line when value includes space (#499).
format_usage()not working (#502).Not able to modify init args for callable with class return and default class (#504).
Nested values not validated when type not subclass and nested keys for subclass (#506).
Dataclass with nested optional dataclass and default field factory failing to parse (#508).
Changed
When parsing fails due to unexpected key, now there are specific error messages for the cases of groups and subcommands (#506).
v4.28.0 (2024-04-17)
Added
Support for “-” as value for Path class initialization so that user can ask to use standard input/output instead of file (#463).
Option in
CLIto provide subcommands help when components given in a dict (litgpt#996 comment).TypeAliasType support added (#480).
Fixed
Account for breaking change in
argparse.ArgumentParser._parse_optionalaffecting python>=3.11.9and>=3.12.3(#484).lazy_instancenot working for callable classes (#473 comment).Callabletype with class return and zero arguments not working (lightning#19574 comment).Attrs and Pydantic 2 dataclasses with non-init fields fail to instantiate (#480).
Default values/factories for Pydantic 2 dataclasses with Field initializers are not right (#480).
Annotated fields in dataclass-likes (eg FastAPI types) resolve incorrectly (#480).
v4.27.7 (2024-03-21)
Fixed
v4.27.6 (2024-03-15)
Fixed
Failure when getting parameters from a class created with
class_from_functionfrom aclassmethodwithout parameter types (#454).Subsubcommand parse failing when
default_env=True(#465).Optional callable that returns a class instance with a lambda default, produces an invalid string default.
dataclass single parameter change incorrectly resetting previous values (#464).
Add function signature failing when conditionally calling different functions (#467).
v4.27.5 (2024-02-12)
Fixed
Importable class instances fail to parse and serialize (#446).
Failure when trying to pickle instances created with
lazy_instance.Confusing error message when creating a link with a target that is already a target of another link.
v4.27.4 (2024-02-01)
Fixed
argcompletenot working when type and choices given (#442).Confusing error message when
CLIis used with a class that defines asubcommandmethod (#430 comment).CLIcrashes when a method has aconfigparameter. Due to redundancy,--configargument should not be added.
v4.27.3 (2024-01-26)
Fixed
Argument links not working for target
init_argsin an optional list (#433).Signature parameter default that doesn’t match its type failing on instantiation and serialization (lightning#19289 comment).
v4.27.2 (2024-01-18)
Fixed
reconplogger’s logger level being unexpectedly overwritten.
Signature parameter default value that doesn’t match its type considered invalid (lightning#19289 comment).
v4.27.1 (2023-11-23)
Fixed
Confusing error message when adding signature parameters that conflict with existing arguments.
Deprecation warnings not printing the correct file and line of code.
sub_configs=Truenot working for callable types that return a class (#419).
v4.27.0 (2023-11-02)
Added
Support for pydantic’s
SecretStrtype.New
SecretStrtype injsonargparse.typingto provide secret support without additional dependency.
Fixed
Links applied on parse failing when source is a class with a nested callable.
v4.26.2 (2023-10-26)
Fixed
Failure to parse subclass added via add_argument and required arg as link target.
choicesworking incorrectly whennargsis+,*or number.Unable link two deep level arguments sharing the same root class (#297).
v4.26.1 (2023-10-23)
Fixed
Failures when choices is a
dict_keysobject and value non-hashable.AST resolver not using the correct component globals in some cases.
v4.26.0 (2023-10-19)
Added
Support for on parse argument links with target subclasses in a list (#394, lightning#18161).
AST resolver now supports some local import cases.
Fixed
Changed
Subclass types no longer allow class instance to be set as default (lightning#18731).
JSONARGPARSE_DEBUGmust now have a non-empty value to enable debug mode.
v4.25.0 (2023-09-25)
Added
Support for user-defined generic types (#366).
New function
extend_base_typefor easy creation and registering of custom types that extend a base type (#195).Support for
Annotatedtypes either ignoring the metadata or using it for validation in case of pydantic types (#384).Support for Python 3.12.
Fixed
--print_configfails when parser has shallow links.Argument links unnecessarily applied when
--print_configused and parser has subcommands (#311).Parsing fails when data type is a
Callablewith multiple input arguments (#372).Postponed annotations not working for dataclasses.
Unsupported pop/get default incorrectly sets default as
None(lightning#18616).Pydantic models and dataclasses not working for
pydantic>=2.0.0(#361).
Changed
Provide a more informative error message to remind user to select and provide a subcommand when a subcommand is required but not given (#371).
Now when an argument link
compute_fnfails, the error message will say this (#311).add_subclass_argumentsnow shows a better error message when an empty tuple is given (lightning#18546).Document the requirements for creating and using custom types (#195).
Parameters with default and without type, now get as type
Union[type(default), Any].Removed support for python 3.6.
v4.24.1 (2023-09-06)
Fixed
Remove private
linked_targetsparameter from API Reference (#317).Dataclass nested in list not setting defaults (#357).
AST resolver
kwargs.pop()with conflicting defaults not setting the conditional default (#362).ActionJsonSchemanot setting correctly defaults when schema usesoneOf.Recommended
print_configsteps not working whendefault_config_filesused due to the config file initially being empty (#367).
v4.24.0 (2023-08-23)
Added
New option in
dumpfor including link targets.Support
decimal.Decimalas a type.CLInow accepts components as a dict, such that the keys define names of the subcommands (#334).Resolve types that use
TYPE_CHECKINGblocks (#337 comment).Improved resolving of nested forward references in types.
The
ext_varsfor anActionJsonnetargument can now have a default.New method
ArgumentParser.add_instantiatorthat enables developers to implement custom instantiation (#170).
Deprecated
ActionJsonnetExtVarsis deprecated and will be removed in v5.0.0. Instead usetype=dict.
v4.23.1 (2023-08-04)
Fixed
savefails when a link target is a required parameter nested in a subclass (#332).typing.Literaltypes skipped when typing_extensions is installed (lightning#18184).class_from_functionfailing when called on the same function multiple times (lightning#18180).Prevent showing errors when running
pson windows.
v4.23.0 (2023-07-27)
Added
Classes created with
class_from_functionnow have a valid import path (#309).
Fixed
Invalid environment variable names when
env_prefixis derived from aprogcontaining dashes.Pylance unable to resolve types from
jsonargparse.typing.Inconsistent
ARG:and missingENV:in help whendefault_env=True.typing.Literaltypes skipped on python 3.9 when typing_extensions is installed (lightning#18125 comment).
Changed
- Subcommands main parser help changes:
Set notation of subcommands choices now only included in usage.
In subcommands section, now each subcommand is always shown separately, including the name, and if available aliases and help.
When
default_env=Trueinclude subcommand environment variable name.
v4.22.1 (2023-07-07)
Fixed
Parameter without default and type optional incorrectly added as a required argument (#312).
class_from_functionnot failing when return annotation is missing.add_subclass_argumentswith single base class and no docstring, incorrectly shown as tuple in help.When all arguments of a group are derived from links, a config load option is incorrectly shown in help.
Printing help fails for parsers that have a link whose target is an argument lacking type and help.
v4.22.0 (2023-06-23)
Added
Parameters that receive a path now also accept
os.PathLiketype.class_from_functionnow supportsfunc_returnparameter to specify the return type of the function (lightning-flash#1564 comment).Support for postponed evaluation of annotations PEP 563
from __future__ import annotations(#120).Backport types in python<=3.9 to support PEP 585 and 604 for postponed evaluation of annotations (#120).
Support for
rangeas a type.
Fixed
Changed
Added
_prefix to module names to be explicit about non-public API.
Deprecated
Importing from original non-public module paths (without
_prefix) now gives aDeprecationWarning. From v5.0.0 these imports will fail.
v4.21.2 (2023-06-08)
Fixed
Failure for nested argument in optional dataclass type (#289).
Argument links applied on parse silently ignored when the source validation fails.
v4.21.1 (2023-05-09)
Fixed
AST resolver not working for dict used in a method when the dict is created using the curly braces syntax.
Failure on multiple deep arguments linked on instantiation (#275).
v4.21.0 (2023-04-21)
Added
Fixed
str parameter in subclass incorrectly parsed as dict with implicit null value (#262).
Wrong error indentation for subclass in union (lightning#17254).
dataclassfrom pydantic not working (#100 comment).add_dataclass_argumentsnot forwardingsub_configsparameter.Failure to instantiate nested class group without arguments (lightning#17263).
Changed
Switched from
setup.cfgtopyproject.tomlfor configuration.Removed
build_sphinxfromsetup.pyand documented how to build.Include enum members in error when invalid value is given (lightning#17247).
The
signaturesextras now installs thetyping-extensionspackage on python<=3.9.CLInow when given a class without methods, the class instance is returned.
Deprecated
Support for python 3.6 will be removed in v5.0.0. New features added in >=4.21.0 releases are not guaranteed to work in python 3.6.
v4.20.1 (2023-03-30)
Fixed
Dump not working for partial callable with return instance (lightning#15340 comment).
Allow
discard_init_args_on_class_path_changeto handle more nested contexts (#247).Failure with dataclasses that have field with
init=False(#252).Failure when setting individual dict key values for subclasses and
.init_args.is included in argument (#251).
v4.20.0 (2023-02-20)
Added
Fixed
add_subcommandsfails when parser has required argument and default config available (#232).
Changed
Deprecated
Path
skip_checkparameter is deprecated and will be removed in v5.0.0. Instead use as typestroros.PathLike.Modifying Path attributes is deprecated. In v5.0.0 they will be properties without a setter and two renamed:
rel_path -> relativeandabs_path -> absolute.ActionPathListis deprecated and will be removed in v5.0.0. Instead use as typeList[<path_type>]withenable_path=True.ArgumentParser.error_handleris deprecated and will be removed in v5.0.0. Instead use the new exit_on_error parameter from argparse.
v4.19.0 (2022-12-27)
Added
CLInow supports thefail_untypedandparser_classparameters.bytesandbytearrayregistered on first use and decodes from standard Base64.Support getting the import path of variables in modules, e.g.
random.randint.Specific error messages for when an argument link uses as source the target of a previous parse link and vice versa (#208).
New resolver that identifies parameter types from stub files
*.pyi.Support for relative paths within remote fsspec/url config files.
New context manager methods for path types:
openandrelative_path_context.Path types now implement the
os.PathLikeprotocol.New path mode
ccto not require the parent directory to exists but that it can be created.The parent parser class is now used to create internal parsers (#171).
Fixed
List type with empty list default causes failure (PyLaia#48).
Pure dataclass instance default being considered as a subclass type.
Discard
init_argsafterclass_pathchange causes error (#205).fail_untyped=Falsenot propagated to subclass--*.helpactions.Issues reported by CodeQL.
Incorrect value when
Pathis cast tostrandrel_pathwas changed.Argument links with target a subclass mixed with other types not working (#208).
Failures when using a sequence type and the default is a tuple.
Parent parser logger not being forwarded to subcommand and internal parsers.
Changed
Clearer error message for when an argument link targets a subclass and the target key does not have
init_args(lightning#16032).The
signaturesextras now installs thetypeshed-clientpackage.validatorspackage is no longer a dependency.Path types are no longer a subclass of
str.Parsing steps logging now at debug level.
Discarding
init_argswarning changed to log at debug level.Removed replacing list instead of append warning.
v4.18.0 (2022-11-29)
Added
AST resolving for defaults with a class instance or a lambda that returns a class instance.
Fixed
boolvalues should not be accepted byintorfloattypes.parse_stringraisesAttributeErrorwhen given a simple string.Added missing
return_parserdeprecation warning whenCLIhas subcommands.Parsing fails for registered types that can’t be cast to boolean (#196).
List append not working for
default_config_filesset in a subcommand subparser (lightning#15256).Specifying only the class name through command line not working for
Callablewith class return type.init_argsnot discarded for nested subclasses provided through command line (lightning#15796).Unable to set/get values in
Namespacewhen key is the same as a method name.
Changed
CLIno longer adds--configand--print_configif no arguments added to subcommand.CLInow uses the component’s docstring short description for subparser descriptions.Slightly nicer type hint unexpected value error messages, in particular less redundancy for
Uniontypes.
v4.17.0 (2022-11-11)
Added
AST resolver now ignores if/elif/else code when condition is a global constant (#187).
AST resolver support for conditional
**kwargsuse in multiple calls (#187 comment).
Fixed
Changed
Improved help usage and description for
--print_config.Registering
pathlib.Pathtypes so that they are not shown as subclass types.
v4.16.0 (2022-10-28)
Added
Type
Anynow parses and instantiates classes when given dict that follows subclass specification (lightning#15115).Signature methods now accept skipping a number of positionals.
Callable type hint with return type a class can now be given a subclass which produces a callable that returns an instance of the class.
Support for Python 3.11.
Fixed
Changed
Using
set_defaultson a config argument raises error and suggests to usedefault_config_files(lightning#15174).Trying to add a second config argument to a single parser raises an exception (#169).
v4.15.2 (2022-10-20)
Fixed
Regression introduced in 6e7ae6d that produced cryptic error message when an invalid argument given (#172).
default_envnot forwarded to subcommand parsers, causing environment variable names to not be shown in subcommand help (lightning#12790).Cannot override Callable
init_argswithout passing theclass_path(#174).Positional subclass type incorrectly adds subclass help as positional.
Order of types in
Unionnot being considered.strtype fails to parse values of the form^\w+: *.parse_objectdoes not consider given namespace for previousclass_pathvalues.
v4.15.1 (2022-10-07)
Fixed
compute_fnof an argument link applied on parse not given subclass defaultinit_argswhen loading from config.Subclass
--*.helpoption not available when type is aUnionmixed with not subclass types.Override of
dict_kwargsitems from command line not working.Multiple subclass
init_argsgiven through command line not being considered (lightning#15007).Uniontypes required all subtypes to be supported when expected to be at least one subtype supported (#168).
v4.15.0 (2022-09-27)
Added
set_defaultsnow supports subclass by name and normalization of import path.
Fixed
Loop variable capture bug pointed out by lgtm.com.
Issue with discard
init_argswhenclass_pathnot a subclass.No error shown when arguments given to class group that does not accept arguments (#161 comment).
Incorrect replacement of
**kwargswhen*argspresent in parameter resolver.Override of
class_pathnot discardinginit_argswhen loading from config file.Invalid values given to the
compute_fnof a argument link applied on parse without showing an understandable error message.
Changed
Now
UUIDandtimedeltatypes are registered on first use to avoid possibly unused imports.json/yaml dump sort now defaults to false for all python implementations.
add_class_argumentswill not add config load option if no added arguments.
v4.14.1 (2022-09-26)
Fixed
Making
import_docstring_parsea deprecated function only for pytorch-lightning backward compatibility.
v4.14.0 (2022-09-14)
Added
Fixed
v4.13.3 (2022-09-06)
Fixed
v4.13.2 (2022-08-31)
Fixed
Failure to print help when
objectused as type hint.Failure to parse init args when type hint is union of str and class.
Handle change of non-existent file exception type in latest fsspec version.
v4.13.1 (2022-08-05)
Fixed
Regression that caused parse to fail when providing
init_argsfrom command line and the subclass default set as a dict.
v4.13.0 (2022-08-03)
Added
Support setting through command line individual dict items without replacing (#133 comment).
Support
super()with non-immediate method resolution order parameter (#153).
Fixed
v4.12.0 (2022-07-22)
Added
Instantiation links now support multiple sources.
AST resolver now supports
cls()class instantiation inclassmethod(#146).AST resolver now supports
popandgetfrom**kwargs.
Fixed
file:/// scheme not working in windows (#144).
Instantiation links with source an entire subclass incorrectly showed
--*.help.Ensure AST-based parameter resolver handles value-less type annotations without error (#148).
Discarding
init_argsonclass_pathchange not working forUnionwith mixed non-subclass types.In some cases debug logs not shown even though
JSONARGPARSE_DEBUGset.
Changed
Instantiation links with source an entire class no longer requires to have a compute function.
Instantiation links no longer restricted to first nesting level.
AST parameter resolver now only logs debug messages instead of failing (#146).
Documented AST resolver support for
**kwargsuse in property.
v4.11.0 (2022-07-12)
Added
env_prefixproperty now also accepts boolean. If set to False, no prefix is used for environment variable names (#145).link_argumentssupport target being an entire subclass object (lightning#13539).
Fixed
Method resolution order not working correctly in parameter resolvers (#143).
Deprecated
env_prefixproperty will no longer acceptNonein v5.0.0.
v4.10.2 (2022-07-01)
Fixed
AST resolver fails for
self._kwargsassign when a type hint is added.
v4.10.1 (2022-06-29)
Fixed
v4.10.0 (2022-06-21)
Added
Signature parameters resolved by inspecting the source code with ASTs (lightning#11653).
Support init args for unresolved parameters in subclasses (#114).
Allow providing a config with
init_argsbut noclass_path(#113).
Fixed
dumpwithskip_default=Truenot working for subclasses withoutinit_argsand when a default value requires serializing.JSONARGPARSE_DEFAULT_ENVshould have precedence over given value.Giving an invalid class path and then init args would print a misleading error message about the init arg instead of the class.
In some cases
print_configcould output invalid values. Now a lenient check is done while dumping.Resolved some issues related to the logger property and reconplogger.
Single dash
'-'incorrectly parsed as[None].
Changed
dataclassesno longer an optional, now an install require on python 3.6.Parameters of type
POSITIONAL_OR_KEYWORDnow consideredKEYWORD(#98).Some refactoring mostly related but not limited to the new AST support.
JSONARGPARSE_DEBUGnow also sets the reconplogger level toDEBUG.Renamed the test files to follow the more standard
test_*.pypattern.Now
bool(Namespace())evaluates toFalse.When a
class_pathis overridden, now only the config values that the new subclass doesn’t accept are discarded.
Deprecated
loggerproperty will no longer acceptNonein v5.0.0.
v4.9.0 (2022-06-01)
Fixed
ActionsContainer not calling
LoggerProperty.__init__.For type
Union[type, List[type]when previous value isNonethen--arg+=elemshould result in a list with single element.
Changed
Literaloptions now shown in metavar like choices (#106).tuplemetavar now shown as[ITEM,...].Required arguments with
Nonedefault now shown without brackets in usage.Improved description of
--print_configin help.
v4.8.0 (2022-05-26)
Added
Support append to lists both from command line and config file (#85).
New
register_unresolvable_import_pathsfunction to allow getting the import paths of objects that don’t have a proper__module__attribute (lightning#13092).New unit test for merge of config file
init_argswhenclass_pathdoes not change (#89).
Changed
Replaced custom pre-commit script with a .pre-commit-config.yaml file.
All warnings are now caught in unit tests.
Moved
return_parsertests to deprecated tests module.
v4.7.3 (2022-05-10)
Fixed
sub_add_kwargsnot propagated for parameters of final classes.New union syntax not working (#136).
v4.7.2 (2022-04-29)
Fixed
Make
import_docstring_parsebackward compatible to support released versions ofLightningCLI(lightning#12918).
v4.7.1 (2022-04-26)
Fixed
Properly catch exceptions when parsing docstrings (lightning#12883).
v4.7.0 (2022-04-20)
Fixed
Failing to parse strings that look like timestamps (#135).
Correctly consider nested mapping type without args as supported.
New registered types incorrectly considered as class type.
Changed
Final classes now added as group of actions instead of one typehint action.
@finaldecorator now an import from typing_extensions if available.Exporting
ActionsContainerto show respective methods in documentation.Raise ValueError when logger property given dict with unexpected key.
v4.6.0 (2022-04-11)
Added
Dump option to exclude entries whose value is the same as the default (#91).
Support specifying
class_pathonly by name for known subclasses (#84).add_argumentwith subclass type now also adds--*.helpoption.Support shorter subclass command line arguments by not requiring to have
.init_args..Support for
Literalbackport from typing_extensions on python 3.7.Support nested subclass
--*.help CLASSoptions.
Changed
class_path’s on parse are now normalized to shortest form.
v4.5.0 (2022-03-29)
Added
Fixed
Bug in check for
class_path,init_argsdicts.Module mocks in cli_tests.py.
Changed
Moved argcomplete code from core to optionals module.
Callableno longer a simple registered type.Import paths are now serialized as its shortest form.
Callabledefault now shown in help as full import path.Moved typehint code from core to typehint module.
Ignore argument links when source/target subclass does not have parameter (#129).
Swapped order of argument links in help to
source --> target.
Deprecated
CLI’sreturn_parserparameter will be removed in v5.0.0.
v4.4.0 (2022-03-18)
Added
- Environment variables to enable features without code change:
JSONARGPARSE_DEFAULT_ENVto enable environment variable parsing.JSONARGPARSE_DEBUGto print of stack trace on parse failure.
Fixed
No error message for unrecognized arguments (lightning#12303).
Changed
Use yaml.CSafeLoader for yaml loading if available.
v4.3.1 (2022-03-01)
Fixed
v4.3.0 (2022-02-22)
Added
Subcommands now also consider parent parser’s
default_config_files(lightning#11622).Automatically added group config load options are now shown in the help #121.
Fixed
Changed
ArgumentParserobjects are now pickleable (lightning#12011).
v4.2.0 (2022-02-09)
Added
object_path_serializerandimport_objectsupport class methods #99.parser_modeis now a property that when set, propagates to subparsers.add_method_argumentsalso add parameters from same method of parent classes when*argsor**kwargspresent.
Fixed
Optional Enum types incorrectly adding a
--*.helpargument.Specific errors for invalid value for
--*.help class_path.
v4.1.4 (2022-01-26)
Fixed
Subcommand parsers not using the parent’s
parser_mode.Namespace
__setitem__failing when key corresponds to a nested dict.
v4.1.3 (2022-01-24)
Fixed
String within curly braces parsed as dict due to yaml spec implicit values.
v4.1.2 (2022-01-20)
Fixed
v4.1.1 (2022-01-13)
Fixed
Bad config merging in
handle_subcommands(lightning#10859).Unit tests failing with argcomplete>=2.0.0.
v4.1.0 (2021-12-06)
Added
set_loaderfunction to allow replacing default yaml loader or adding a new parser mode.set_dumperfunction to allow changing default dump formats or adding new named dump formats.parser_mode='omegaconf'option to use OmegaConf as a loader, adding variable interpolation support.
Fixed
class_from_functionmissing dereference of string return type (#105).
v4.0.4 (2021-11-29)
Fixed
Linking of attributes applied on instantiation ignoring compute_fn.
Show full class paths in
--*.helpdescription to avoid misinterpretation.--*.helpaction failing when fail_untyped and/or skip is required. (#101).Raise exception if lazy_instance called with invalid lazy_kwargs.
Only add subclass defaults on defaults merging (#103).
Strict type and required only on final config check (#31).
instantiate_classes failing for type hints with
nargs='+'.Useful error message when init_args value invalid.
Specific error message when subclass dict has unexpected keys.
Removed unnecessary recursive calls causing slow parsing.
v4.0.3 (2021-11-23)
Fixed
Command line parsing of init_args failing with subclasses without a default.
get_default failing when destination key does not exist in default config file.
Fixed issue with empty help string caused by a change in argparse python 3.9.
v4.0.2 (2021-11-22)
Fixed
Specifying init_args from the command line resulting in empty namespace when no prior class_path given.
Fixed command line parsing of class_path and init_args options within subcommand.
lazy_instance of final class leading to incorrect default that includes class_path and init_args.
add_subclass_arguments not accepting a default keyword parameter.
Make it possible to disable deprecation warnings.
v4.0.0 (2021-11-16)
Added
New Namespace class that natively supports nesting and avoids flat/dict conversions.
python 3.10 is now supported and included in circleci tests.
Readme changed to use doctest and tests are run in github workflow.
More type hints throughout the code base.
New unit tests to increase coverage.
Include dataclasses extras require for tox testing.
Automatic namespace to dict for link based on target or compute_fn type.
Fixed
Fixed issues related to conflict namespace base.
Fixed the parsing of
Dict[int, str]type (#87).Fixed inner relative config with for commented tests for parse_env and CLI.
init_args from default_config_files not discarded when class_path is overridden.
Problems with class instantiation for parameters of final classes.
dump/save not removing linked target keys.
lazy_instance not working with torch.nn.Module (#96).
Changed
General refactoring and cleanup related to new Namespace class.
Parsed values from ActionJsonSchema/ActionJsonnet are now dict instead of Namespace.
Removed support for python 3.5 and related code cleanup.
contextvars package is now an install require for python 3.6.
Deprecations are now shown as JsonargparseDeprecationWarning.
Deprecated
ArgumentParser’s
parse_as_dictoption will be removed in v5.0.0.ArgumentParser’s
instantiate_subclassesmethod will be removed in v5.0.0.
Removed
python 3.5 is no longer supported.
v3.19.4 (2021-10-04)
Fixed
v3.19.3 (2021-09-16)
Fixed
add_subclass_arguments with required=False failing on instantiation (#83).
v3.19.2 (2021-09-09)
Fixed
add_subclass_arguments with required=False failing when not given (#83).
v3.19.1 (2021-09-03)
Fixed
Repeated instantiation of dataclasses (lightning#9207).
v3.19.0 (2021-08-27)
Added
savenow supports saving to an fsspec path (#86).
Fixed
Changed
Multiple subcommand settings without explicit subcommand is now a warning instead of exception.
v3.18.0 (2021-08-18)
Added
Support for parsing
MappingandMutableMappingtypes.Support for parsing
frozenset,MutableSequenceandMutableSettypes.
Fixed
Don’t discard
init_argswith non-changing--*.class_pathargument.Don’t ignore
KeyErrorin call to instantiate_classes (#81).Optional subcommands fail with a KeyError (#68).
Conflicting namespace for subclass key in subcommand.
instantiate_classesnot working for subcommand keys (#70).Proper file not found message from _ActionConfigLoad (#64).
parse_pathnot parsing inner config files.
Changed
Docstrings no longer supported for python 3.5.
Show warning when
--*.class_pathdiscards previousinit_args.Trigger error when
parse_argscalled with non-string value.ActionParser accepts both title and help, title having preference.
Multiple subcommand settings allowed if explicit subcommand given.
v3.17.0 (2021-07-19)
Added
datetime.timedeltanow supported as a type.New function
class_from_functionto add signature of functions that return an instantiated class.
Fixed
--*.init_args.*causing crash when overriding value from config file.
v3.16.1 (2021-07-13)
Fixed
Signature functions not working for classes implemented with
__new__.instantiate_classesfailing when keys not present in config object.
v3.16.0 (2021-07-05)
Added
lazy_instancefunction for serializable class type defaults.Support for parsing multiple matched default config files (#58).
Fixed
--*.class_pathand--*.init_args.*arguments not being parsed.--helpbroken when default_config_files fail to parse (#60).Pattern in default_config_files not using sort.
v3.15.0 (2021-06-22)
Added
Decorator for final classes and an is_final_class function to test it.
Support for final classes as type hint.
add_subclass_argumentsnow supports multiple classes given as tuple.add_subclass_argumentsnow supports the instantiate parameter.
Fixed
Parsing of relative paths inside inner configs for type hint actions.
v3.14.0 (2021-06-08)
Added
Method
instantiate_classesthat instantiates subclasses and class groups.Support for
link_argumentsthat are applied on instantiation.Method
add_subclass_argumentsnow supports skipping of arguments.Added support for Type in type hints (#59).
Fixed
Custom string template to avoid problems with percent symbols in docstrings.
v3.13.1 (2021-06-03)
Fixed
Type hint Any not correctly serializing Enum and registered type values.
v3.13.0 (2021-06-02)
Added
Inner config file support for subclass type hints in signatures and CLI (#57).
Forward fail_untyped setting to nested subclass type hints.
Fixed
With fail_untyped=True use type from default value instead of Any.
Registered types and typing types incorrectly considered subclass types.
Changed
Better structure of type hint error messages to ease understanding.
v3.12.1 (2021-05-19)
Fixed
--print_configcan now be given before other arguments without value.Fixed conversion of flat namespace to dict when there is a nested empty namespace.
Fixed issue with get_defaults with default config file and parse_as_dict=False.
Fixed bug in save which failed when there was an int key.
Changed
--print_confignow only receives a value with=syntax.add_{class,method,function,dataclass}_argumentsnow return a list of added arguments.
v3.12.0 (2021-05-13)
Added
Path support for fsspec file systems using the ‘s’ mode flag.
set_config_read_mode function that can enable fsspec for config reading.
Option for print_config and dump with help as yaml comments.
Changed
print_config only added to parsers when ActionConfigFile is added.
Deprecated
set_url_support functionality now should be done with set_config_read_mode.
v3.11.2 (2021-05-03)
Fixed
Link argument arrow
<=can be confused as less or equal, changed to<--.
v3.11.1 (2021-04-30)
Fixed
add_dataclass_arguments not making parameters without default as required (#54).
Removed from signature add methods required option included by mistake.
v3.11.0 (2021-04-27)
Added
CLI now has
--configoptions at subcommand and subsubcommand levels.CLI now adds subcommands with help string taken from docstrings.
print_config at subcommand level for global config with implicit subcommands.
New Path_drw predefined type.
Type hint arguments now support
nargs='?'.Signature methods can now skip arguments within init_args of subclasses.
Changed
Removed skip_check from ActionPathList which was never implemented.
Deprecated
ActionPath should no longer be used, instead paths are given as type.
Fixed
Actions not being applied for subsubcommand values.
handle_subcommands not correctly inferring subsubcommand.
v3.10.1 (2021-04-24)
Changed
fail_untyped now adds untyped parameters as type Any and if no default then default set to None.
Fixed
--*.helpoption being added for non-subclass types.Iterable and Sequence types not working for python>=3.7 (#53).
v3.10.0 (2021-04-19)
Added
set_defaults method now works for arguments within subcommands.
CLI set_defaults option to allow overriding of defaults.
CLI return_parser option to ease inclusion in documentation.
save_path_content attribute to save paths content on config save.
New
link_argumentsmethod to derive an argument value from others.print_config now includes subclass init_args if class_path given.
Subclass type hints now also have a
--*.helpoption.
Changed
Signature parameters whose name starts with “_” are skipped.
The repr of Path now has the form
Path_{mode}(.
Fixed
CLI now does instantiate_subclasses before running.
v3.9.0 (2021-04-09)
Added
New method add_dataclass_arguments.
Dataclasses are now supported as a type.
New predefined type Path_dc.
Experimental Callable type support.
Signature methods with nested key can be made required.
Support for Literal types.
New option in signatures methods to not fail for untyped required.
Changed
Generation of yaml now uses internally pyyaml’s safe_dump.
New cleaner implementation for type hints support.
Moved deprecated code to a module specific for this.
Path types repr now has format Path(rel[, cwd=dir]).
instantiate_subclasses now always returns a dict.
Deprecated
ActionEnum should no longer be used, instead enums are given as type.
Fixed
Deserialization of types not being done for nested config files.
v3.8.1 (2021-03-22)
Fixed
v3.8.0 (2021-03-22)
Added
Path class now supports home prefix ‘~’ (#45).
yaml/json dump kwargs can now be changed via attributes dump_yaml_kwargs and dump_json_kwargs.
Changed
Now by default dump/save/print_config preserve the add arguments and argument groups order (only CPython>=3.6) (#46).
ActionParser group title now defaults to None if not given (#47).
Add argument with type Enum or type hint giving an action now raises error (#45).
Parser help now also considers default_config_files and shows which config file was loaded (#47).
get_default method now also considers default_config_files.
get_defaults now raises ParserError if default config file not valid.
Fixed
default_config_files property not removing help group when setting None.
v3.7.0 (2021-03-17)
Changed
ActionParser now moves all actions to the parent parser.
The help of ActionParser arguments is now shown in the main help (#41).
Fixed
v3.6.0 (2021-03-08)
Added
Function to register additional types for use in parsers.
Type hint support for complex and UUID classes.
Changed
PositiveInt and NonNegativeInt now gives error instead of silently truncating when given float.
Types created with restricted_number_type and restricted_string_type now share a common TypeCore base class.
Fixed
ActionOperators not give error if type already registered.
List[Tuple] types not working correctly.
Some nested dicts kept as Namespace by dump.
v3.5.1 (2021-02-26)
Fixed
Parsing of relative paths in default_config_files not working.
Description of tuple type in the readme.
v3.5.0 (2021-02-12)
Added
Tuples with ellipsis are now supported (#40).
Fixed
Using dict as type incorrectly considered as class requiring class_path.
Nested tuples were not working correctly (#40).
v3.4.1 (2021-02-03)
Fixed
CLI crashed for class method when zero args given after subcommand.
Options before subcommand provided in config file gave subcommand not given.
Arguments in groups without help not showing required, type and default.
Required arguments help incorrectly showed null default value.
Various improvements and fixes to the readme.
v3.4.0 (2021-02-01)
Added
Save with multifile=True now creates original jsonnet file for ActionJsonnet.
default_config_files is now a property of parser objects.
Table in readme to ease understanding of extras requires for optional features (#38).
Changed
Save with multifile=True uses file extension to choose json or yaml format.
Fixed
Better exception message when using ActionJsonSchema and jsonschema not installed (#38).
v3.3.2 (2021-01-22)
Fixed
Changed actions so that keyword arguments are visible in API.
Fixed save method short description which was copy paste of dump.
Added missing docstring in instantiate_subclasses method.
Fixed crash when using
--helpand ActionConfigFile not given help string.Standardized capitalization and punctuation of: help, config, version.
v3.3.1 (2021-01-08)
Fixed
instantiate_subclasses work properly when init_args not present.
Addressed a couple of issues pointed out by sonarcloud.
v3.3.0 (2021-01-08)
Added
New add_subclass_arguments method to add as type with a specific help option.
v3.2.1 (2020-12-30)
Added
Automatic Optional for arguments with default None (#30).
CLI now supports running methods from classes.
Signature arguments can now be loaded from independent config files (#32).
add_argument now supports enable_path for type based on jsonschema.
print_config can now be given as value skip_null to exclude null entries.
Changed
Improved description of parser used as standalone and for ActionParser (#34).
Removed
__cwd__and top level__path__that were not needed.
Fixed
ActionYesNo argument in help the type is now bool.
Correctly skip self in add_method_arguments for inherited methods.
Prevent failure of dump in cleanup_actions due to new _ActionConfigLoad.
Prevent failure in save_paths for dict with int keys.
Avoid duplicate config check failure message with subcommands.
v3.1.0 (2020-12-09)
Added
Support for multiple levels of subcommands (#29).
Default description of subcommands explaining use of
--help.
v3.0.1 (2020-12-02)
Fixed
add_class_arguments incorrectly added arguments from
__call__instead of__init__for callable classes.
v3.0.0 (2020-12-01)
Added
Functions to add arguments from classes, methods and functions.
CLI function that allows creating a line command line interface with a single line of code inspired by Fire.
Typing module that includes predefined types and type generator functions for paths and restricted numbers/strings.
Extended support to add_argument type to allow complex type hints.
Parsers now include
--print_configoption to dump defaults.Support argcomplete for tab completion of arguments.
Changed
ArgumentParsers by default now use as error_handler the usage_and_exit_error_handler.
error_handler and formatter_class no longer accept as value a string.
Changed SimpleNamespace to Namespace to avoid unnecessary differences with argparse.
Deprecated
ActionOperators should no longer be used, the new alternative is restricted number types.
v2.X.X
The change log was introduced in v3.0.0. For details of the changes for previous versions take a look at the git log. It more or less reads like a change log.