Jsonargparse

Latest version: v4.34.0

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

Scan your dependencies

Page 2 of 18

4.31.0

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

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

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

Changed
^^^^^^^
- Now ``--*.help`` output shows options without ``init_args`` (`533
<https://github.com/omni-us/jsonargparse/pull/533>`__).

4.30.0

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

Added
^^^^^
- Allow adding config argument with ``action="config"`` avoiding need to import
action class (`512
<https://github.com/omni-us/jsonargparse/pull/512>`__).
- Allow providing a function with return type a class in ``class_path``
(`lightning13613
<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 (`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 (`516
<https://github.com/omni-us/jsonargparse/issues/516>`__).
- ``--print_config`` failing in some cases (`517
<https://github.com/omni-us/jsonargparse/issues/517>`__).
- Callable that returns class not using required parameter default from lambda
(`523 <https://github.com/omni-us/jsonargparse/pull/523>`__).
- Failing to parse list of dataclasses with nested optional dataclass (`527
<https://github.com/omni-us/jsonargparse/pull/527>`__).
- List of union of classes not accepted by ``add_subclass_arguments`` in
``python>=3.11`` (`522
<https://github.com/omni-us/jsonargparse/pull/522>`__).
- Optional pydantic model failing to parse with `__pydantic_private__` error
(`521 <https://github.com/omni-us/jsonargparse/issues/521>`__).

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

Page 2 of 18

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.