Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update dependency jsonargparse to v4 #9

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

dm-renovate[bot]
Copy link

@dm-renovate dm-renovate bot commented Sep 27, 2024

This PR contains the following updates:

Package Update Change
jsonargparse (changelog) major ==2.32.2 -> ==4.33.2
jsonargparse (changelog) major ==3.11.2 -> ==4.33.2

Release Notes

omni-us/jsonargparse (jsonargparse)

v4.33.2

Compare Source

Fixed
^^^^^

  • Fix parse_argv_item to address the behavior change in argparse since
    Python 3.12.7 (#&#8203;591 <https://github.com/omni-us/jsonargparse/pull/591>__).

v4.33.1

Compare Source

Fixed
^^^^^

  • Use jsonnet-sdist for python 3.13 to be allowed to push package to pypi
    (#&#8203;584 <https://github.com/omni-us/jsonargparse/pull/584>__).

v4.32.1

Compare Source

Fixed
^^^^^

  • dict types not correctly forwarding previous nested values when parsing
    (#&#8203;559 <https://github.com/omni-us/jsonargparse/pull/559>__).
  • List type incorrectly using defaults from previous item (#&#8203;560 <https://github.com/omni-us/jsonargparse/pull/560>__).
  • --print_shtab not adding file completer for _ActionConfigLoad (#&#8203;562 <https://github.com/omni-us/jsonargparse/pull/562>__).
  • parser_mode not inherited by nested parsers (#&#8203;564 <https://github.com/omni-us/jsonargparse/pull/564>__).

v4.32.0

Compare Source

Added
^^^^^

  • Support for MappingProxyType as a type and as default for mapping types
    (#&#8203;540 <https://github.com/omni-us/jsonargparse/pull/540>__).
  • Support for OrderedDict as a type (#&#8203;545 <https://github.com/omni-us/jsonargparse/pull/545>__).
  • New function get_loader to get the current loader for a given parser mode
    (#&#8203;479 comment <https://github.com/omni-us/jsonargparse/issues/479#issuecomment-2022596544>,
    #&#8203;536 comment <https://github.com/omni-us/jsonargparse/issues/536#issuecomment-2186961644>
    ).

Fixed
^^^^^

  • dump failing when a link target requires serialization and
    skip_link_targets=False (#&#8203;542 <https://github.com/omni-us/jsonargparse/pull/542>__).

  • default_config_files making parse fail for subcommands and nested subclass
    types (lightning-forums#5963 <https://lightning.ai/forums/t/problem-lightningcli-with-default-config-files/5963>__).

  • Fixes related to transformers PreTrainedModel.from_pretrained
    (lightning#19863 comment <https://github.com/Lightning-AI/pytorch-lightning/discussions/19863#discussioncomment-9821765>__):

    • Import path of inherited classmethod not resolving correctly (#&#8203;548 <https://github.com/omni-us/jsonargparse/pull/548>__).
    • Resolved parameters leading to multiple values for keyword argument (#&#8203;551 <https://github.com/omni-us/jsonargparse/pull/551>__).
    • Function with return type a class in class_path in some cases fails
      with unexpected instantiate parameter error (#&#8203;551 <https://github.com/omni-us/jsonargparse/pull/551>__).
    • Ignore incorrectly resolved config_file_name parameter for
      transformers model from_pretrained(#&#8203;551 <https://github.com/omni-us/jsonargparse/pull/551>__).

v4.31.0

Compare Source

Added
^^^^^

  • Support async functions and methods in CLI (#&#8203;531 <https://github.com/omni-us/jsonargparse/pull/531>__).
  • Support for Protocol types only accepting exact matching signature of
    public methods (#&#8203;526 <https://github.com/omni-us/jsonargparse/pull/526>__).

Fixed
^^^^^

  • Resolving of import paths for some torch functions not working (#&#8203;535 <https://github.com/omni-us/jsonargparse/pull/535>__).
  • --print_shtab crashing on failure to get signature parameters from one
    class (lightning#10858 comment <https://github.com/Lightning-AI/pytorch-lightning/discussions/10858#discussioncomment-9846252>__).

Changed
^^^^^^^

  • Now --*.help output shows options without init_args (#&#8203;533 <https://github.com/omni-us/jsonargparse/pull/533>__).

v4.30.0

Compare Source

Added
^^^^^

  • Allow adding config argument with action="config" avoiding need to import
    action class (#&#8203;512 <https://github.com/omni-us/jsonargparse/pull/512>__).
  • Allow providing a function with return type a class in class_path
    (lightning#13613 <https://github.com/Lightning-AI/pytorch-lightning/discussions/13613>__).
  • Automatic --print_shtab option when shtab is installed, providing
    completions for many type hints without the need to modify code (#&#8203;528 <https://github.com/omni-us/jsonargparse/pull/528>__).

Fixed
^^^^^

  • Parsing incorrectly provides file content when type is a union with a
    subclass, PathLike and string (#&#8203;516 <https://github.com/omni-us/jsonargparse/issues/516>__).
  • --print_config failing in some cases (#&#8203;517 <https://github.com/omni-us/jsonargparse/issues/517>__).
  • Callable that returns class not using required parameter default from lambda
    (#&#8203;523 <https://github.com/omni-us/jsonargparse/pull/523>__).
  • Failing to parse list of dataclasses with nested optional dataclass (#&#8203;527 <https://github.com/omni-us/jsonargparse/pull/527>__).
  • List of union of classes not accepted by add_subclass_arguments in
    python>=3.11 (#&#8203;522 <https://github.com/omni-us/jsonargparse/pull/522>__).
  • Optional pydantic model failing to parse with __pydantic_private__ error
    (#&#8203;521 <https://github.com/omni-us/jsonargparse/issues/521>__).

v4.29.0

Compare Source

Added
^^^^^

  • Support for TypedDict (#&#8203;457 <https://github.com/omni-us/jsonargparse/issues/457>__).
  • Directly providing a dict with parameters or a single parameter to a subclass
    or callable with class return now implicitly tries using the base class as
    class_path if not abstract (#&#8203;505 <https://github.com/omni-us/jsonargparse/pull/505>__).

Fixed
^^^^^

  • Parameter resolving falling back to assumptions resolver for optional
    Union types (#&#8203;498 <https://github.com/omni-us/jsonargparse/pull/498>__).
  • Nested parameters failing to parse from command line when value includes
    space (#&#8203;499 <https://github.com/omni-us/jsonargparse/pull/499>__).
  • format_usage() not working (#&#8203;501 <https://github.com/omni-us/jsonargparse/issues/501>__).
  • Not able to modify init args for callable with class return and default class
    (#&#8203;504 <https://github.com/omni-us/jsonargparse/pull/504>__).
  • Nested values not validated when type not subclass and nested keys for
    subclass (#&#8203;503 comment <https://github.com/omni-us/jsonargparse/issues/503#issuecomment-2119724341>__).
  • Dataclass with nested optional dataclass and default field factory failing to
    parse (#&#8203;507 <https://github.com/omni-us/jsonargparse/issues/507>__).

Changed
^^^^^^^

  • When parsing fails due to unexpected key, now there are specific error
    messages for the cases of groups and subcommands (#&#8203;506 <https://github.com/omni-us/jsonargparse/pull/506>__).

v4.28.0

Compare Source

Added
^^^^^

  • Support for "-" as value for Path class initialization so that user
    can ask to use standard input/output instead of file (#&#8203;463 <https://github.com/omni-us/jsonargparse/issues/463>__).
  • Option in CLI to provide subcommands help when components given in a dict
    (litgpt#996 comment <https://github.com/Lightning-AI/litgpt/issues/996#issuecomment-1996201548>__).
  • TypeAliasType support added (#&#8203;480 <https://github.com/omni-us/jsonargparse/issues/480>__).

Fixed
^^^^^

  • Account for breaking change in argparse.ArgumentParser._parse_optional
    affecting python >=3.11.9 and >=3.12.3 (#&#8203;484 <https://github.com/omni-us/jsonargparse/issues/484>__).
  • lazy_instance not working for callable classes (#&#8203;473 comment <https://github.com/omni-us/jsonargparse/issues/481#issuecomment-2030932435>__).
  • Callable type with class return and zero arguments not working
    (lightning#19574 comment <https://github.com/lightning-AI/pytorch-lightning/issues/19574#issuecomment-2002932565>__).
  • Attrs and Pydantic 2 dataclasses with non-init fields fail to instantiate
    (#&#8203;480 <https://github.com/omni-us/jsonargparse/issues/480>__).
  • Default values/factories for Pydantic 2 dataclasses with Field initializers
    are not right (#&#8203;480 <https://github.com/omni-us/jsonargparse/issues/480>__).
  • Annotated fields in dataclass-likes (eg FastAPI types) resolve incorrectly
    (#&#8203;480 <https://github.com/omni-us/jsonargparse/issues/480>__).

v4.27.7

Compare Source

Fixed
^^^^^

  • Regression from 14456c2 <https://github.com/omni-us/jsonargparse/commit/14456c21ff7a11ba420f010d2b21bcfdb14977a2>__
    that prevented **kwargs parameter resolving when an Optional[Callable]
    type is used (#&#8203;473 <https://github.com/omni-us/jsonargparse/issues/473>__).

v4.27.6

Compare Source

Fixed
^^^^^

  • Failure when getting parameters from a class created with
    class_from_function from a classmethod without parameter types (#&#8203;454 <https://github.com/omni-us/jsonargparse/issues/454>__).
  • Subsubcommand parse failing when default_env=True (#&#8203;465 <https://github.com/omni-us/jsonargparse/issues/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 (#&#8203;464 <https://github.com/omni-us/jsonargparse/issues/464>__).
  • Add function signature failing when conditionally calling different functions
    (#&#8203;467 <https://github.com/omni-us/jsonargparse/issues/467>__).

v4.27.5

Compare Source

Fixed
^^^^^

  • Importable class instances fail to parse and serialize (#&#8203;446 <https://github.com/omni-us/jsonargparse/issues/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

Compare Source

Fixed
^^^^^

  • argcomplete not working when type and choices given (#&#8203;442 <https://github.com/omni-us/jsonargparse/issues/442>__).
  • Confusing error message when CLI is used with a class that defines a
    subcommand method (#&#8203;430 comment <https://github.com/omni-us/jsonargparse/issues/430#issuecomment-1903974112>__).
  • CLI crashes when a method has a config parameter. Due to redundancy,
    --config argument should not be added.

v4.27.3

Compare Source

Fixed
^^^^^

  • Argument links not working for target init_args in an optional list (#&#8203;433 <https://github.com/omni-us/jsonargparse/issues/433>__).
  • Signature parameter default that doesn't match its type failing on
    instantiation and serialization (lightning#19289 comment <https://github.com/Lightning-AI/pytorch-lightning/pull/19289#issuecomment-1902618722>__).

v4.27.2

Compare Source

Fixed
^^^^^

  • reconplogger's logger level being unexpectedly overwritten.
  • Signature parameter default value that doesn't match its type considered
    invalid (lightning#19289 comment <https://github.com/Lightning-AI/pytorch-lightning/pull/19289#issuecomment-1894063743>__).

v4.27.1

Compare Source

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=True not working for callable types that return a class (#&#8203;419 <https://github.com/omni-us/jsonargparse/issues/419>__).

v4.27.0

Compare Source

Added
^^^^^

  • Support for pydantic's SecretStr type.
  • New SecretStr type in jsonargparse.typing to provide secret support
    without additional dependency.

Fixed
^^^^^

  • Links applied on parse failing when source is a class with a nested callable.

v4.26.2

Compare Source

Fixed
^^^^^

  • Failure to parse subclass added via add_argument and required arg as link
    target.
  • choices working incorrectly when nargs is +, * or number.
  • Unable link two deep level arguments sharing the same root class (#&#8203;297 <https://github.com/omni-us/jsonargparse/issues/297>__).

v4.26.1

Compare Source

Fixed
^^^^^

  • Failures when choices is a dict_keys object and value non-hashable.
  • AST resolver not using the correct component globals in some cases.

v4.26.0

Compare Source

Added
^^^^^

  • Support for on parse argument links with target subclasses in a list (#&#8203;394 <https://github.com/omni-us/jsonargparse/issues/394>, lightning#18161 <https://github.com/Lightning-AI/lightning/issues/18161>).
  • AST resolver now supports some local import cases.

Fixed
^^^^^

  • Failures with subcommands and default_config_files when keys are repeated
    (#&#8203;160 <https://github.com/omni-us/jsonargparse/issues/160>__).
  • Key related errors printing messages within single quotes.
  • Choices not validated when value comes from config file (#&#8203;404 <https://github.com/omni-us/jsonargparse/issues/404>__).

Changed
^^^^^^^

  • Subclass types no longer allow class instance to be set as default
    (lightning#18731 <https://github.com/Lightning-AI/lightning/issues/18731>__).
  • JSONARGPARSE_DEBUG must now have a non-empty value to enable debug mode.

v4.25.0

Compare Source

Added
^^^^^

  • Support for user-defined generic types (#&#8203;366 <https://github.com/omni-us/jsonargparse/issues/366>__).
  • New function extend_base_type for easy creation and registering of custom
    types that extend a base type (#&#8203;195 <https://github.com/omni-us/jsonargparse/issue/195>__).
  • Support for Annotated types either ignoring the metadata or using it for
    validation in case of pydantic types <https://docs.pydantic.dev/latest/api/types/>__ (#&#8203;384 <https://github.com/omni-us/jsonargparse/issue/384>__).
  • Support for Python 3.12.

Fixed
^^^^^

  • --print_config fails when parser has shallow links.
  • Argument links unnecessarily applied when --print_config used and parser
    has subcommands (#&#8203;311 <https://github.com/omni-us/jsonargparse/issue/311>__).
  • Parsing fails when data type is a Callable with multiple input arguments
    (#&#8203;372 <https://github.com/omni-us/jsonargparse/issues/372>__).
  • Postponed annotations not working for dataclasses.
  • Unsupported pop/get default incorrectly sets default as None
    (lightning#18616 <https://github.com/Lightning-AI/lightning/issues/18616>__).
  • Pydantic models and dataclasses not working for pydantic>=2.0.0 (#&#8203;361 <https://github.com/omni-us/jsonargparse/issue/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 (#&#8203;371 <https://github.com/omni-us/jsonargparse/pull/371>__).
  • Now when an argument link compute_fn fails, the error message will say
    this (#&#8203;311 <https://github.com/omni-us/jsonargparse/issue/311>__).
  • add_subclass_arguments now shows a better error message when an empty
    tuple is given (lightning#18546 <https://github.com/Lightning-AI/lightning/issues/18546>__).
  • Document the requirements for creating and using custom types (#&#8203;195 <https://github.com/omni-us/jsonargparse/issue/195>__).
  • Parameters with default and without type, now get as type
    Union[type(default), Any].
  • Removed support for python 3.6.

v4.24.1

Compare Source

Fixed
^^^^^

  • Remove private linked_targets parameter from API Reference (#&#8203;317 <https://github.com/omni-us/jsonargparse/issues/317>__).
  • Dataclass nested in list not setting defaults (#&#8203;357 <https://github.com/omni-us/jsonargparse/issues/357>__).
  • AST resolver kwargs.pop() with conflicting defaults not setting the
    conditional default (#&#8203;362 <https://github.com/omni-us/jsonargparse/issues/362>__).
  • ActionJsonSchema not setting correctly defaults when schema uses
    oneOf.
  • Recommended print_config steps not working when default_config_files
    used due to the config file initially being empty (#&#8203;367 <https://github.com/omni-us/jsonargparse/issues/367>__).

v4.24.0

Compare Source

Added
^^^^^

  • New option in dump for including link targets.
  • Support decimal.Decimal as a type.
  • CLI now accepts components as a dict, such that the keys define names of
    the subcommands (#&#8203;334 <https://github.com/omni-us/jsonargparse/issues/334>__).
  • Resolve types that use TYPE_CHECKING blocks (#&#8203;337 comment <https://github.com/omni-us/jsonargparse/issues/337#issuecomment-1665055459>__).
  • Improved resolving of nested forward references in types.
  • The ext_vars for an ActionJsonnet argument can now have a default.
  • New method ArgumentParser.add_instantiator that enables developers to
    implement custom instantiation (#&#8203;170 <https://github.com/omni-us/jsonargparse/issues/170>__).

Deprecated
^^^^^^^^^^

  • ActionJsonnetExtVars is deprecated and will be removed in v5.0.0. Instead
    use type=dict.

v4.23.1

Compare Source

Fixed
^^^^^

  • save fails when a link target is a required parameter nested in a subclass
    (#&#8203;332 <https://github.com/omni-us/jsonargparse/issues/332>__).
  • typing.Literal types skipped when typing_extensions is installed
    (lightning#18184 <https://github.com/Lightning-AI/lightning/pull/18184>__).
  • class_from_function failing when called on the same function multiple
    times (lightning#18180 <https://github.com/Lightning-AI/lightning/issues/18180>__).
  • Prevent showing errors when running ps on windows.

v4.23.0

Compare Source

Added
^^^^^

  • Classes created with class_from_function now have a valid import path
    (#&#8203;309 <https://github.com/omni-us/jsonargparse/issues/309>__).

Fixed
^^^^^

  • Invalid environment variable names when env_prefix is derived from
    a prog containing dashes.
  • Pylance unable to resolve types from jsonargparse.typing.
  • Inconsistent ARG: and missing ENV: in help when default_env=True.
  • typing.Literal types skipped on python 3.9 when typing_extensions is
    installed (lightning#18125 comment <https://github.com/Lightning-AI/lightning/pull/18125#issuecomment-1644797707>__).

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=True include subcommand environment variable name.

v4.22.1

Compare Source

Fixed
^^^^^

  • Parameter without default and type optional incorrectly added as a required
    argument (#&#8203;312 <https://github.com/omni-us/jsonargparse/issues/312>__).
  • class_from_function not failing when return annotation is missing.
  • add_subclass_arguments with 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

Compare Source

Added
^^^^^

  • Parameters that receive a path now also accept os.PathLike type.
  • class_from_function now supports func_return parameter to specify the
    return type of the function (lightning-flash#1564 comment <https://github.com/Lightning-Universe/lightning-flash/pull/1564#discussion_r1218147330>__).
  • Support for postponed evaluation of annotations PEP 563 <https://peps.python.org/pep-0563/>__ from __future__ import annotations
    (#&#8203;120 <https://github.com/omni-us/jsonargparse/issues/120>__).
  • Backport types in python<=3.9 to support PEP 585 <https://peps.python.org/pep-0585/>__ and 604 <https://peps.python.org/pep-0604/>__ for postponed evaluation of annotations
    (#&#8203;120 <https://github.com/omni-us/jsonargparse/issues/120>__).
  • Support for range as a type.

Fixed
^^^^^

  • Regular expressions vulnerable to polynomial runtime due to backtracking.
  • attrs fields with factory default causes parse to fail (#&#8203;299 <https://github.com/omni-us/jsonargparse/issues/299>__).
  • Stop subclass dive if you hit bad import (#&#8203;304 <https://github.com/omni-us/jsonargparse/issues/304>__).

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 a DeprecationWarning. From v5.0.0 these imports will fail.

v4.21.2

Compare Source

Fixed
^^^^^

  • Failure for nested argument in optional dataclass type (#&#8203;289 <https://github.com/omni-us/jsonargparse/issues/289>__).
  • Argument links applied on parse silently ignored when the source validation
    fails.

v4.21.1

Compare Source

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 (#&#8203;275 <https://github.com/omni-us/jsonargparse/issues/275>__).

v4.21.0

Compare Source

Added
^^^^^

  • Support for dataclasses nested in a type (#&#8203;243 <https://github.com/omni-us/jsonargparse/issues/243>__).
  • Support for pydantic models <https://docs.pydantic.dev/usage/models/>__ and
    attrs define <https://www.attrs.org/en/stable/examples.html>__ similar to
    dataclasses.
  • Support for pydantic types <https://docs.pydantic.dev/usage/types/#pydantic-types>__.
  • Backport type stubs in python<=3.9 to support PEP 585 <https://peps.python.org/pep-0585/>__ and 604 <https://peps.python.org/pep-0604/>__ syntax.

Fixed
^^^^^

  • str parameter in subclass incorrectly parsed as dict with implicit null
    value (#&#8203;262 <https://github.com/omni-us/jsonargparse/issues/262>__).
  • Wrong error indentation for subclass in union (lightning#17254 <https://github.com/Lightning-AI/lightning/issues/17254>__).
  • dataclass from pydantic not working (#&#8203;100 comment <https://github.com/omni-us/jsonargparse/issues/100#issuecomment-1408413796>__).
  • add_dataclass_arguments not forwarding sub_configs parameter.
  • Failure to instantiate nested class group without arguments (lightning#17263 <https://github.com/Lightning-AI/lightning/issues/17263>__).

Changed
^^^^^^^

  • Switched from setup.cfg to pyproject.toml for configuration.
  • Removed build_sphinx from setup.py and documented how to build.
  • Include enum members in error when invalid value is given
    (lightning#17247 <https://github.com/Lightning-AI/lightning/issues/17247>__).
  • The signatures extras now installs the typing-extensions package on
    python<=3.9.
  • CLI now 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

Compare Source

Fixed
^^^^^

  • Dump not working for partial callable with return instance
    (lightning#15340 comment <https://github.com/Lightning-AI/lightning/issues/15340#issuecomment-1439203008>__).
  • Allow discard_init_args_on_class_path_change to handle more nested
    contexts (#&#8203;247 <https://github.com/omni-us/jsonargparse/issues/247>__).
  • Failure with dataclasses that have field with init=False (#&#8203;252 <https://github.com/omni-us/jsonargparse/issues/252>__).
  • Failure when setting individual dict key values for subclasses and
    .init_args. is included in argument (#&#8203;251 <https://github.com/omni-us/jsonargparse/issues/251>__).

v4.20.0

Compare Source

Added
^^^^^

  • CLI support for callable class instances (#&#8203;238 <https://github.com/omni-us/jsonargparse/issues/238>__).
  • add_dataclass_arguments now supports the fail_untyped parameter (#&#8203;241 <https://github.com/omni-us/jsonargparse/issues/241>__).

Fixed
^^^^^

  • add_subcommands fails when parser has required argument and default config
    available (#&#8203;232 <https://github.com/omni-us/jsonargparse/issues/232>__).

Changed
^^^^^^^

  • When parsing fails, now argparse.ArgumentError is raised instead of
    ParserError.
  • Improved error messages when fail_untyped=True (#&#8203;137 <https://github.com/omni-us/jsonargparse/issues/137>__).
  • CLI no longer uses the module's docstring as main parser description (#&#8203;245 <https://github.com/omni-us/jsonargparse/issues/245>__).

Deprecated
^^^^^^^^^^

  • Path skip_check parameter is deprecated and will be removed in v5.0.0.
    Instead use as type str or os.PathLike.
  • Modifying Path attributes is deprecated. In v5.0.0 they will be properties
    without a setter and two renamed: rel_path -> relative and abs_path -> absolute.
  • ActionPathList is deprecated and will be removed in v5.0.0. Instead use as
    type List[<path_type>] with enable_path=True.
  • ArgumentParser.error_handler is deprecated and will be removed in v5.0.0.
    Instead use the new exit_on_error parameter from argparse.

v4.19.0

Compare Source

Added
^^^^^

  • CLI now supports the fail_untyped and parser_class parameters.
  • bytes and bytearray registered 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 (#&#8203;208 <https://github.com/omni-us/jsonargparse/issues/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: open and
    relative_path_context.
  • Path types now implement the os.PathLike protocol.
  • New path mode cc to not require the parent directory to exists but that it
    can be created.
  • The parent parser class is now used to create internal parsers (#&#8203;171 <https://github.com/omni-us/jsonargparse/issues/171>__).

Fixed
^^^^^

  • List type with empty list default causes failure (PyLaia#48 <https://github.com/jpuigcerver/PyLaia/issues/48>__).
  • Pure dataclass instance default being considered as a subclass type.
  • Discard init_args after class_path change causes error (#&#8203;205 <https://github.com/omni-us/jsonargparse/issues/205>__).
  • fail_untyped=False not propagated to subclass --*.help actions.
  • Issues reported by CodeQL.
  • Incorrect value when Path is cast to str and rel_path was changed.
  • Argument links with target a subclass mixed with other types not working (#&#8203;208 <https://github.com/omni-us/jsonargparse/issues/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 <https://github.com/Lightning-AI/lightning/issues/16032>__).
  • The signatures extras now installs the typeshed-client package.
  • validators package is no longer a dependency.
  • Path types are no longer a subclass of str.
  • Parsing steps logging now at debug level.
  • Discarding init_args warning changed to log at debug level.
  • Removed replacing list instead of append warning.

v4.18.0

Compare Source

Added
^^^^^

  • AST resolving for defaults with a class instance or a lambda that returns a
    class instance.

Fixed
^^^^^

  • bool values should not be accepted by int or float types.
  • parse_string raises AttributeError when given a simple string.
  • Added missing return_parser deprecation warning when CLI has
    subcommands.
  • Parsing fails for registered types that can't be cast to boolean (#&#8203;196 <https://github.com/omni-us/jsonargparse/issues/196>__).
  • List append not working for default_config_files set in a subcommand
    subparser (lightning#15256 <https://github.com/Lightning-AI/lightning/issues/15256>__).
  • Specifying only the class name through command line not working for
    Callable with class return type.
  • init_args not discarded for nested subclasses provided through command
    line (lightning#15796 <https://github.com/Lightning-AI/lightning/issues/15796>__).
  • Unable to set/get values in Namespace when key is the same as a method
    name.

Changed
^^^^^^^

  • CLI no longer adds --config and --print_config if no arguments
    added to subcommand.
  • CLI now uses the component's docstring short description for subparser
    descriptions.
  • Slightly nicer type hint unexpected value error messages, in particular less
    redundancy for Union types.

v4.17.0

Compare Source

Added
^^^^^

  • AST resolver now ignores if/elif/else code when condition is a global constant
    (#&#8203;187 <https://github.com/omni-us/jsonargparse/issues/187>__).
  • AST resolver support for conditional **kwargs use in multiple calls (#&#8203;187 comment <https://github.com/omni-us/jsonargparse/issues/187#issuecomment-1295141338>__).

Fixed
^^^^^

  • str type fails to parse value when pyyaml raises ConstructorError
    (#&#8203;189 <https://github.com/omni-us/jsonargparse/issues/189>__).
  • Namespace clone should not deepcopy leaf values (#&#8203;187 <https://github.com/omni-us/jsonargparse/issues/187>__).
  • _ActionHelpClassPath actions fail to instantiate when base class uses new
    union type syntax.

Changed
^^^^^^^

  • Improved help usage and description for --print_config.
  • Registering pathlib.Path types so that they are not shown as subclass
    types.

v4.16.0

Compare Source

Added
^^^^^

  • Type Any now parses and instantiates classes when given dict that follows
    subclass specification (lightning#15115 <https://github.com/Lightning-AI/lightning/issues/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
^^^^^

  • Fail to import on Python 3.7 when typing_extensions not installed (#&#8203;178 <https://github.com/omni-us/jsonargparse/issues/178>__).
  • Crashing when using set typehint with specified dtype (#&#8203;183 <https://github.com/omni-us/jsonargparse/issues/183>__).

Changed
^^^^^^^

  • Using set_defaults on a config argument raises error and suggests to use
    default_config_files (lightning#15174 <https://github.com/Lightning-AI/lightning/issues/15174>__).
  • Trying to add a second config argument to a single parser raises an exception
    (#&#8203;169 <https://github.com/omni-us/jsonargparse/issues/169>__).

v4.15.2

Compare Source

Fixed
^^^^^

  • Regression introduced in 6e7ae6d <https://github.com/omni-us/jsonargparse/commit/6e7ae6dca41d2bdf081731c042bba9d08b6f228f>__
    that produced cryptic error message when an invalid argument given (#&#8203;172 <https://github.com/omni-us/jsonargparse/issues/172>__).
  • default_env not forwarded to subcommand parsers, causing environment
    variable names to not be shown in subcommand help (lightning#12790 <https://github.com/Lightning-AI/lightning/issues/12790>__).
  • Cannot override Callable init_args without passing the class_path
    (#&#8203;174 <https://github.com/omni-us/jsonargparse/issues/174>__).
  • Positional subclass type incorrectly adds subclass help as positional.
  • Order of types in Union not being considered.
  • str type fails to parse values of the form ^\w+: *.
  • parse_object does not consider given namespace for previous class_path
    values.

v4.15.1

Compare Source

Fixed
^^^^^

  • compute_fn of an argument link applied on parse not given subclass default
    init_args when loading from config.
  • Subclass --*.help option not available when type is a Union mixed with
    not subclass types.
  • Override of dict_kwargs items from command line not working.
  • Multiple subclass init_args given through command line not being
    considered (lightning#15007 <https://github.com/Lightning-AI/lightning/pull/15007>__).
  • Union types required all subtypes to be supported when expected to be at
    least one subtype supported (#&#8203;168 <https://github.com/omni-us/jsonargparse/issues/168>__).

v4.15.0

Compare Source

Added
^^^^^

  • set_defaults now supports subclass by name and normalization of import path.

Fixed
^^^^^

  • Loop variable capture bug pointed out by lgtm.com.
  • Issue with discard init_args when class_path not a subclass.
  • No error shown when arguments given to class group that does not accept
    arguments (#&#8203;161 comment <https://github.com/omni-us/jsonargparse/issues/161#issuecomment-1256973565>__).
  • Incorrect replacement of **kwargs when *args present in parameter resolver.
  • Override of class_path not discarding init_args when loading from
    config file.
  • Invalid values given to the compute_fn of a argument link applied on parse
    without showing an understandable error message.

Changed
^^^^^^^

  • Now UUID and timedelta types are registered on first use to avoid
    possibly unused imports.
  • json/yaml dump sort now defaults to false for all python implementations.
  • add_class_arguments will not add config load option if no added arguments.

v4.14.1

Compare Source

Fixed
^^^^^

  • Making import_docstring_parse a deprecated function only for
    pytorch-lightning backward compatibility.

v4.14.0

Compare Source

Added
^^^^^

  • Support for os.PathLike as typehint (#&#8203;159 <https://github.com/omni-us/jsonargparse/issues/159>__).
  • Also show known subclasses in help for Type[<type>].
  • Support for attribute docstrings (#&#8203;150 <https://github.com/omni-us/jsonargparse/issues/150>__).
  • Way to configure parsing docstrings with a single style.

Fixed
^^^^^

  • Subclass nested argument incorrectly loaded as subclass config (#&#8203;159 <https://github.com/omni-us/jsonargparse/issues/159>__).
  • Append to list not working for default_config_files in subcommands (#&#8203;157 <https://github.com/omni-us/jsonargparse/issues/157>__).

v4.13.3

Compare Source

Fixed
^^^^^

  • Failure to parse when subcommand has no options (#&#8203;158 <https://github.com/omni-us/jsonargparse/issues/158>__).
  • Optional packages being imported even though not used.
  • Append to list not working for default_config_files (#&#8203;157 <https://github.com/omni-us/jsonargparse/issues/157>__).

v4.13.2

Compare Source

Fixed
^^^^^

  • Failure to print help when object used 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

Compare Source

Fixed
^^^^^

  • Regression that caused parse to fail when providing init_args from command
    line and the subclass default set as a dict.

v4.13.0

Compare Source

Added
^^^^^

  • Support setting through command line individual dict items without replacing
    (#&#8203;133 comment <https://github.com/omni-us/jsonargparse/issues/133#issuecomment-1194305222>__).
  • Support super() with non-immediate method resolution order parameter (#&#8203;153 <https://github.com/omni-us/jsonargparse/issues/153>__).

Fixed
^^^^^

  • Mypy fails to find jsonargparse type hints (#&#8203;151 <https://github.com/omni-us/jsonargparse/issues/151>__).
  • For multiple dict_kwargs command line arguments only the last one was
    kept.
  • Positional list with subtype causing crash (#&#8203;154 <https://github.com/omni-us/jsonargparse/issues/154>__).

v4.12.0

Compare Source

Added
^^^^^

  • Instantiation links now support multiple sources.
  • AST resolver now supports cls() class instantiation in classmethod
    (#&#8203;146 <https://github.com/omni-us/jsonargparse/issues/146>__).
  • AST resolver now supports pop and get from **kwargs.

Fixed
^^^^^

  • file:/// scheme not working in windows (#&#8203;144 <https://github.com/omni-us/jsonargparse/issues/144>__).
  • Instantiation links with source an entire subclass incorrectly showed
    --*.help.
  • Ensure AST-based parameter resolver handles value-less type annotations without error
    (#&#8203;148 <https://github.com/omni-us/jsonargparse/issues/148>__).
  • Discarding init_args on class_path change not working for Union
    with mixed non-subclass types.
  • In some cases debug logs not shown even though JSONARGPARSE_DEBUG set.

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 (#&#8203;146 <https://github.com/omni-us/jsonargparse/issues/146>__).
  • Documented AST resolver support for **kwargs use in property.

v4.11.0

Compare Source

Added
^^^^^

  • env_prefix property now also accepts boolean. If set to False, no prefix
    is used for environment variable names (#&#8203;145 <https://github.com/omni-us/jsonargparse/pull/145>__).
  • link_arguments support target being an entire subclass object
    (lightning#13539 <https://github.com/Lightning-AI/lightning/discussions/13539>__).

Fixed
^^^^^

  • Method resolution order not working correctly in parameter resolvers (#&#8203;143 <https://github.com/omni-us/jsonargparse/issues/143>__).

Deprecated
^^^^^^^^^^

  • env_prefix property will no longer accept None in v5.0.0.

v4.10.2

Compare Source

Fixed
^^^^^

  • AST resolver fails for self._kwargs assign when a type hint is added.

v4.10.1

Compare Source

Fixed
^^^^^

  • "Component not supported" crash instead of no parameters (#&#8203;141 <https://github.com/omni-us/jsonargparse/issues/141>__).
  • Default from default_config_files not shown in help when argument has no
    default.
  • Only init_args in later config overwrites instead of updates (#&#8203;142 <https://github.com/omni-us/jsonargparse/issues/142>__).

v4.10.0

Compare Source

Added
^^^^^

  • Signature parameters resolved by inspecting the source code with ASTs
    (lightning#11653 <https://github.com/Lightning-AI/lightning/issues/11653>__).
  • Support init args for unresolved parameters in subclasses (#&#8203;114 <https://github.com/omni-us/jsonargparse/issues/114>__).
  • Allow providing a config with init_args but no class_path (#&#8203;113 <https://github.com/omni-us/jsonargparse/issues/113>__).

Fixed
^^^^^

  • dump with skip_default=True not working for subclasses without
    init_args and when a default value requires serializing.
  • JSONARGPARSE_DEFAULT_ENV should 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_config could 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
^^^^^^^

  • dataclasses no longer an optional, now an install require on python 3.6.
  • Parameters of type POSITIONAL_OR_KEYWORD now considered KEYWORD (#&#8203;98 <https://github.com/omni-us/jsonargparse/issues/98>__).
  • Some refactoring mostly related but not limited to the new AST support.
  • JSONARGPARSE_DEBUG now also sets the reconplogger level to DEBUG.
  • Renamed the test files to follow the more standard test_*.py pattern.
  • Now bool(Namespace()) evaluates to False.
  • When a class_path is overridden, now only the config values that the new
    subclass doesn't accept are discarded.

Deprecated
^^^^^^^^^^

  • logger property will no longer accept None in v5.0.0.

v4.9.0

Compare Source

Fixed
^^^^^

  • ActionsContainer not calling LoggerProperty.__init__.
  • For type Union[type, List[type] when previous value is None then
    --arg+=elem should result in a list with single element.

Changed
^^^^^^^

  • Literal options now shown in metavar like choices (#&#8203;106 <https://github.com/omni-us/jsonargparse/issues/106>__).
  • tuple metavar now shown as [ITEM,...].
  • Required arguments with None default now shown without brackets in usage.
  • Improved description of --print_config in help.

v4.8.0

Compare Source

Added
^^^^^

  • Support append to lists both from command line and config file (#&#8203;85 <https://github.com/omni-us/jsonargparse/issues/85>__).
  • New register_unresolvable_import_paths function to allow getting the
    import paths of objects that don't have a proper __module__ attribute
    (lightning#13092 <https://github.com/Lightning-AI/lightning/issues/13092>__).
  • New unit test for merge of config file init_args when class_path does
    not change (#&#8203;89 <https://github.com/omni-us/jsonargparse/issues/89>__).

Changed
^^^^^^^

  • Replaced custom pre-commit script with a .pre-commit-config.yaml file.
  • All warnings are now caught in unit tests.
  • Moved return_parser tests to deprecated tests module.

v4.7.3

Compare Source

Fixed
^^^^^

  • sub_add_kwargs not propagated for parameters of final classes.
  • New union syntax not working (#&#8203;136 <https://github.com/omni-us/jsonargparse/issues/136>__).

v4.7.2

Compare Source

Fixed
^^^^^

  • Make import_docstring_parse backward compatible to support released
    versions of LightningCLI (lightning#12918 <https://github.com/Lightning-AI/lightning/pull/12918>__).

v4.7.1

Compare Source

Fixed
^^^^^

  • Properly catch exceptions when parsing docstrings (lightning#12883 <https://github.com/Lightning-AI/lightning/issues/12883>__).

v4.7.0

Compare Source

Fixed
^^^^^

  • Failing to parse strings that look like timestamps (#&#8203;135 <https://github.com/omni-us/jsonargparse/issues/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.
  • @final decorator now an import from typing_extensions if available.
  • Exporting ActionsContainer to show respective methods in documentation.
  • Raise ValueError when logger property given dict with unexpected key.

v4.6.0

Compare Source

Added
^^^^^

  • Dump option to exclude entries whose value is the same as the default (#&#8203;91 <https://github.com/omni-us/jsonargparse/issues/91>__).
  • Support specifying class_path only by name for known subclasses (#&#8203;84 <https://github.com/omni-us/jsonargparse/issues/84>__).
  • add_argument with subclass type now also adds --*.help option.
  • Support shorter subclass command line arguments by not requiring to have
    .init_args..
  • Support for Literal backport from typing_extensions on python 3.7.
  • Support nested subclass --*.help CLASS options.

Changed
^^^^^^^

  • class_path's on parse are now normalized to shortest form.

v4.5.0

Compare Source

Added
^^^^^

  • capture_parser function to get the parser object from a cli function.
  • dump_header property to set header for yaml/jsonnet dumpers (#&#8203;79 <https://github.com/omni-us/jsonargparse/issues/79>__).
  • Callable type now supports callable classes (#&#8203;110 <https://github.com/omni-us/jsonargparse/issues/110>__).

Fixed
^^^^^

  • Bug in check for class_path, init_args dicts.
  • Module mocks in cli_tests.py.

Changed
^^^^^^^

  • Moved argcomplete code from core to optionals module.
  • Callable no longer a simple registered type.
  • Import paths are now serialized as its shortest form.
  • Callable default 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
    (#&#8203;129 <https://github.com/omni-us/jsonargparse/issues/129>__).
  • Swapped order of argument links in help to source --> target.

Deprecated
^^^^^^^^^^

  • CLI's return_parser parameter will be removed in v5.0.0.

v4.4.0

Compare Source

Added
^^^^^

  • Environment variables to enable features without code change:
    • JSONARGPARSE_DEFAULT_ENV to enable environment variable parsing.
    • JSONARGPARSE_DEBUG to print of stack trace on parse failure.

Fixed
^^^^^

  • No error message for unrecognized arguments (lightning#12303 <https://github.com/Lightning-AI/lightning/issues/12303>__).

Changed
^^^^^^^

  • Use yaml.CSafeLoader for yaml loading if available.

v4.3.1

Compare Source

Fixed
^^^^^

  • Incorrect use of yaml_load with jsonnet parser mode (#&#8203;125 <https://github.com/omni-us/jsonargparse/issues/125>__).
  • Load of subconfigs not correctly changing working directory (#&#8203;125 <https://github.com/omni-us/jsonargparse/issues/125>__).
  • Regression introduced in commit 97e4567 fixed and updated unit test to prevent
    it (#&#8203;128 <https://github.com/omni-us/jsonargparse/issues/128>__).
  • --print_config fails for subcommands when default_env=True (#&#8203;126 <https://github.com/omni-us/jsonargparse/issues/126>__).

v4.3.0

Compare Source

Added
^^^^^

  • Subcommands now also consider parent parser's default_config_files
    (lightning#11622 <https://github.com/Lightning-AI/lightning/pull/11622>__).
  • Automatically added group config load options are now shown in the help #​121.

Fixed
^^^^^

  • Dumper for jsonnet should be json instead of yaml (#&#8203;123 <https://github.com/omni-us/jsonargparse/issues/123>__).
  • jsonnet import path not working correctly (#&#8203;122 <https://github.com/omni-us/jsonargparse/issues/122>__).

Changed
^^^^^^^

  • ArgumentParser objects are now pickleable (lightning#12011 <https://github.com/Lightning-AI/lightning/pull/12011>__).

v4.2.0

Compare Source

Added
^^^^^

  • object_path_serializer and import_object support class methods #​99.
  • parser_mode is now a property that when set, propagates to subparsers.
  • add_method_arguments also add parameters from same method of parent
    classes when *args or **kwargs present.

Fixed
^^^^^

  • Optional Enum types incorrectly adding a --*.help argument.
  • Specific errors for invalid value for --*.help class_path.

v4.1.4

Compare Source

Fixed
^^^^^

  • Subcommand parsers not using the parent's parser_mode.
  • Namespace __setitem__ failing when key corresponds to a nested dict.

v4.1.3

Compare Source

Fixed
^^^^^

  • String within curly braces parsed as dict due to yaml spec implicit values.

v4.1.2

Compare Source

Fixed
^^^^^

  • Namespace TypeError with non-str inputs (#&#8203;116 <https://github.com/omni-us/jsonargparse/issues/116>__).
  • print_config failing on subclass with required arguments (#&#8203;115 <https://github.com/omni-us/jsonargparse/issues/115>__).

v4.1.1

Compare Source

Fixed
^^^^^

  • Bad config merging in handle_subcommands (lightning#10859 <https://github.com/Lightning-AI/lightning/issues/10859>__).
  • Unit tests failing with argcomplete>=2.0.0.

v4.1.0

Compare Source

Added
^^^^^

  • set_loader fu

Configuration

📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about these updates again.


  • If you want to rebase/retry this PR, check this box

This PR has been generated by Renovate Bot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

0 participants