Jsonargparse

Latest version: v4.29.0

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

Scan your dependencies

Page 1 of 17

4.29.0

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

Added
^^^^^
- Support for ``TypedDict`` (`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 (`505
<https://github.com/omni-us/jsonargparse/pull/505>`__).

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

4.28.0

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

Added
^^^^^
- Support for "-" as value for Path class initialization so that user
can ask to use standard input/output instead of file (`463
<https://github.com/omni-us/jsonargparse/issues/463>`__).
- Option in ``CLI`` to provide subcommands help when components given in a dict
(`litgpt996 comment
<https://github.com/Lightning-AI/litgpt/issues/996#issuecomment-1996201548>`__).
- `TypeAliasType` support added (`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`` (`484
<https://github.com/omni-us/jsonargparse/issues/484>`__).
- ``lazy_instance`` not working for callable classes (`473 comment
<https://github.com/omni-us/jsonargparse/issues/481#issuecomment-2030932435>`__).
- ``Callable`` type with class return and zero arguments not working
(`lightning19574 comment
<https://github.com/lightning-AI/pytorch-lightning/issues/19574#issuecomment-2002932565>`__).
- Attrs and Pydantic 2 dataclasses with non-init fields fail to instantiate
(`480 <https://github.com/omni-us/jsonargparse/issues/480>`__).
- Default values/factories for Pydantic 2 dataclasses with `Field` initializers
are not right (`480 <https://github.com/omni-us/jsonargparse/issues/480>`__).
- `Annotated` fields in dataclass-likes (eg FastAPI types) resolve incorrectly
(`480 <https://github.com/omni-us/jsonargparse/issues/480>`__).

4.27.7

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

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

4.27.6

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

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

4.27.5

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

Fixed
^^^^^
- Importable class instances fail to parse and serialize (`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.

4.27.4

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

Fixed
^^^^^
- ``argcomplete`` not working when type and choices given (`442
<https://github.com/omni-us/jsonargparse/issues/442>`__).
- Confusing error message when ``CLI`` is used with a class that defines a
``subcommand`` method (`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.

Page 1 of 17

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.