Jsonargparse

Latest version: v4.29.0

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

Scan your dependencies

Page 3 of 17

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``.

4.23.1

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

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

4.23.0

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

Added
^^^^^
- Classes created with ``class_from_function`` now have a valid import path
(`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 (`lightning18125 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.

Page 3 of 17

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.