Jsonargparse

Latest version: v4.34.0

Safety actively analyzes 683322 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 4 of 18

4.26.2

--------------------

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 (`297
<https://github.com/omni-us/jsonargparse/issues/297>`__).

4.26.1

--------------------

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

4.26.0

--------------------

Added
^^^^^
- Support for on parse argument links with target subclasses in a list (`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
(`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 (`404
<https://github.com/omni-us/jsonargparse/issues/404>`__).

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

4.25.0

--------------------

Added
^^^^^
- Support for user-defined generic types (`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 (`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/>`__ (`#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 (`311 <https://github.com/omni-us/jsonargparse/issue/311>`__).
- Parsing fails when data type is a ``Callable`` with multiple input arguments
(`372 <https://github.com/omni-us/jsonargparse/issues/372>`__).
- Postponed annotations not working for dataclasses.
- Unsupported pop/get default incorrectly sets default as ``None``
(`lightning18616
<https://github.com/Lightning-AI/lightning/issues/18616>`__).
- Pydantic models and dataclasses not working for ``pydantic>=2.0.0`` (`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 (`371 <https://github.com/omni-us/jsonargparse/pull/371>`__).
- Now when an argument link ``compute_fn`` fails, the error message will say
this (`311 <https://github.com/omni-us/jsonargparse/issue/311>`__).
- ``add_subclass_arguments`` now shows a better error message when an empty
tuple is given (`lightning18546
<https://github.com/Lightning-AI/lightning/issues/18546>`__).
- Document the requirements for creating and using custom types (`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.

4.24.1

--------------------

Fixed
^^^^^
- Remove private ``linked_targets`` parameter from API Reference (`317
<https://github.com/omni-us/jsonargparse/issues/317>`__).
- Dataclass nested in list not setting defaults (`357
<https://github.com/omni-us/jsonargparse/issues/357>`__).
- AST resolver ``kwargs.pop()`` with conflicting defaults not setting the
conditional default (`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 (`367
<https://github.com/omni-us/jsonargparse/issues/367>`__).

4.24.0

--------------------

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 (`334
<https://github.com/omni-us/jsonargparse/issues/334>`__).
- Resolve types that use ``TYPE_CHECKING`` blocks (`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 (`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``.

Page 4 of 18

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.