Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ Deprecated
- ``dict_to_namespace`` is deprecated and will be removed in v5.0.0. No
replacement is provided because blindly converting a dictionary to a namespace
may not yield the same results as using a parser, which could lead to
confusion. (`#797 <https://github.com/omni-us/jsonargparse/pull/797>`__).
confusion (`#797 <https://github.com/omni-us/jsonargparse/pull/797>`__).


v4.42.0 (2025-10-14)
Expand Down Expand Up @@ -477,11 +477,11 @@ Fixed
- Callable type with subclass return not showing the ``--*.help`` option (`#567
<https://github.com/omni-us/jsonargparse/pull/567>`__).
- Forward referenced types not compatible with ``Type`` typehint (`#576
<https://github.com/omni-us/jsonargparse/pull/576/>`__).
<https://github.com/omni-us/jsonargparse/pull/576>`__).
- Subclass nested in ``Iterable`` makes help fail (`#578
<https://github.com/omni-us/jsonargparse/pull/578>`__).
- ``Literal`` mixing enum values and strings failing to parse (`#580
<https://github.com/omni-us/jsonargparse/pull/580/>`__).
<https://github.com/omni-us/jsonargparse/pull/580>`__).

Changed
^^^^^^^
Expand Down Expand Up @@ -825,39 +825,39 @@ Added
<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>`__).
<https://github.com/omni-us/jsonargparse/issues/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>`__).
<https://github.com/omni-us/jsonargparse/issues/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>`__).
has subcommands (`#311 <https://github.com/omni-us/jsonargparse/issues/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``
(`lightning#18616
<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>`__).
<https://github.com/omni-us/jsonargparse/issues/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>`__).
this (`#311 <https://github.com/omni-us/jsonargparse/issues/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 (`#195
<https://github.com/omni-us/jsonargparse/issue/195>`__).
<https://github.com/omni-us/jsonargparse/issues/195>`__).
- Parameters with default and without type, now get as type
``Union[type(default), Any]``.
- Removed support for python 3.6.
Expand Down Expand Up @@ -2009,7 +2009,7 @@ v3.16.0 (2021-07-05)
--------------------

Added
-----
^^^^^
- ``lazy_instance`` function for serializable class type defaults.
- Support for parsing multiple matched default config files (`#58
<https://github.com/omni-us/jsonargparse/issues/58>`__).
Expand Down
16 changes: 8 additions & 8 deletions CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ Contributing
Contributions to jsonargparse are very welcome. There are multiple ways for
people to help and contribute, among them:

- Star ⭐ the github project `<https://github.com/omni-us/jsonargparse/>`__.
- Star ⭐ the GitHub project `<https://github.com/omni-us/jsonargparse/>`__.
- `Sponsor 🩷 <https://github.com/sponsors/mauvilsa>`__ its maintenance and
development.
- Spread the word in your community about the features you like from
jsonargparse.
- Help others to learn how to use jsonargparse by creating tutorials, such as
blog posts and videos.
- Become active in existing github issues and pull requests.
- Become active in existing GitHub issues and pull requests.
- Create `issues <https://github.com/omni-us/jsonargparse/issues>`__ for
reporting bugs and proposing improvements.
- Create `pull requests <https://github.com/omni-us/jsonargparse/pulls>`__ with
Expand Down Expand Up @@ -80,8 +80,8 @@ some time to complete. If you wish to push without running these hooks, use the
command ``git push --no-verify``.

Formatting of the code is done automatically by pre-commit. If some pre-commit
hooks fail and you decide to skip them, the formatting will be automatically
applied by a github action in pull requests.
hooks fail and you decide to skip them, formatting will be automatically applied
by a GitHub action in pull requests.

Documentation
-------------
Expand All @@ -101,8 +101,8 @@ Tests
Running the unit tests can be done either using `pytest
<https://docs.pytest.org/>`__ or `tox
<https://tox.readthedocs.io/en/stable/>`__. The tests are also installed with
the package, thus can be run in a production system. Also pre-commit runs some
additional tests.
the package and can be run in a non-development environment. Also pre-commit
runs some additional tests.

.. code-block:: bash

Expand Down Expand Up @@ -138,8 +138,8 @@ Then open the file ``jsonargparse_tests/htmlcov/index.html`` in a browser.
Pull requests
-------------

When creating a pull request, it is recommended that in your fork, create a
specific branch for the changes you want to contribute, instead of using the
When creating a pull request, it is recommended that you create a specific
branch in your fork for the changes you want to contribute, instead of using the
``main`` branch.

The required tasks to do for a pull request, are listed in
Expand Down
6 changes: 3 additions & 3 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ CLI with minimal boilerplate:

from jsonargparse import auto_cli

def main_function(...): # your main parameters and logic here
...
def main_function(...): # your main parameters with type hints here
... # your main code here

if __name__ == "__main__":
auto_cli(main_function) # parses arguments and runs main_function
Expand Down Expand Up @@ -197,4 +197,4 @@ To install the latest development version, use the following command:

.. code-block:: bash

pip install "jsonargparse[signatures] @ git+https://github.com/omni-us/jsonargparse.git@main"
pip install "jsonargparse[signatures] @ https://github.com/omni-us/jsonargparse/zipball/main"
4 changes: 2 additions & 2 deletions jsonargparse/_from_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def from_config(cls: Type[T], config: Union[str, PathLike, dict]) -> T:


def _parse_class_kwargs_from_config(cls: Type[T], config: Union[str, PathLike, dict], **kwargs) -> dict:
"""Parse the init kwargs for `cls` from a config file or dict."""
"""Parse the init kwargs for ``cls`` from a config file or dict."""
parser = ArgumentParser(exit_on_error=False, **kwargs)
parser.add_class_arguments(cls)
if isinstance(config, dict):
Expand Down Expand Up @@ -121,7 +121,7 @@ def _override_init_defaults_parent_classes(cls: Type[T], defaults: dict) -> None
kwargs_param = parameters.pop()

# Add new parameters
for param in reversed(override_parent_params):
for param in override_parent_params:
parameters.append(param)

# Add **kwargs back at the end
Expand Down