@@ -190,12 +190,10 @@ def patched_save(self, cfg: Union[Namespace, Dict[str, Any]], *args, multifile:
190190 ArgumentParser .save = patched_save
191191
192192
193- @deprecated (
194- """
193+ @deprecated ("""
195194 ActionEnum was deprecated in v3.9.0 and will be removed in v5.0.0. Enums now
196195 should be given directly as a type as explained in :ref:`enums`.
197- """
198- )
196+ """ )
199197class ActionEnum :
200198 """An action based on an Enum that maps to-from strings and enum values."""
201199
@@ -215,12 +213,10 @@ def __call__(self, *args, **kwargs):
215213 return ActionTypeHint (typehint = self ._type )(** kwargs )
216214
217215
218- @deprecated (
219- """
216+ @deprecated ("""
220217 ActionOperators was deprecated in v3.0.0 and will be removed in v5.0.0. Now
221218 types should be used as explained in :ref:`restricted-numbers`.
222- """
223- )
219+ """ )
224220class ActionOperators :
225221 """Action to restrict a value with comparison operators."""
226222
@@ -245,12 +241,10 @@ def __call__(self, *args, **kwargs):
245241 return ActionTypeHint (typehint = self ._type )(** kwargs )
246242
247243
248- @deprecated (
249- """
244+ @deprecated ("""
250245 ActionPath was deprecated in v3.11.0 and will be removed in v5.0.0. Paths
251246 now should be given directly as a type as explained in :ref:`parsing-paths`.
252- """
253- )
247+ """ )
254248class ActionPath :
255249 """Action to check and store a path."""
256250
@@ -269,12 +263,10 @@ def __call__(self, *args, **kwargs):
269263 return ActionTypeHint (typehint = self ._type )(** kwargs )
270264
271265
272- @deprecated (
273- """
266+ @deprecated ("""
274267 ActionPathList was deprecated in v4.20.0 and will be removed in v5.0.0. Instead
275268 use as type ``List[<path_type>]`` with ``enable_path=True``.
276- """
277- )
269+ """ )
278270class ActionPathList (Action ):
279271 """Action to check and store a list of file paths read from a plain text file or stream."""
280272
@@ -351,13 +343,11 @@ def _check_type(self, value):
351343 return value
352344
353345
354- @deprecated (
355- """
346+ @deprecated ("""
356347 set_url_support was deprecated in v3.12.0 and will be removed in v5.0.0.
357348 Optional config read modes should now be set using function
358349 set_parsing_settings.
359- """
360- )
350+ """ )
361351def set_url_support (enabled : bool ):
362352 """Enables/disables URL support for config read mode."""
363353 from ._optionals import _get_config_read_mode , _set_config_read_mode
@@ -368,13 +358,11 @@ def set_url_support(enabled: bool):
368358 )
369359
370360
371- @deprecated (
372- """
361+ @deprecated ("""
373362 set_config_read_mode was deprecated in v4.39.0 and will be removed in
374363 v5.0.0. Optional config read modes should now be set using function
375364 set_parsing_settings.
376- """
377- )
365+ """ )
378366def set_config_read_mode (
379367 urls_enabled : bool = False ,
380368 fsspec_enabled : bool = False ,
@@ -388,26 +376,22 @@ def set_config_read_mode(
388376 )
389377
390378
391- @deprecated (
392- """
379+ @deprecated ("""
393380 get_config_read_mode was deprecated in v4.39.0 and will be removed in
394381 v5.0.0. The config read mode is internal and thus shouldn't be used.
395- """
396- )
382+ """ )
397383def get_config_read_mode () -> str :
398384 """Returns the current config reading mode."""
399385 from ._optionals import _get_config_read_mode
400386
401387 return _get_config_read_mode ()
402388
403389
404- @deprecated (
405- """
390+ @deprecated ("""
406391 set_docstring_parse_options was deprecated in v4.39.0 and will be removed in
407392 v5.0.0. Docstring parse options should now be set using function
408393 set_parsing_settings.
409- """
410- )
394+ """ )
411395def set_docstring_parse_options (style = None , attribute_docstrings : Optional [bool ] = None ):
412396 """Sets options for docstring parsing."""
413397 from ._optionals import _set_docstring_parse_options
@@ -526,13 +510,11 @@ class DebugException(Exception):
526510 pass
527511
528512
529- @deprecated (
530- """
513+ @deprecated ("""
531514 usage_and_exit_error_handler was deprecated in v4.20.0 and will be removed
532515 in v5.0.0. With the removal of error_handler, there is no longer a need for
533516 this function.
534- """
535- )
517+ """ )
536518def usage_and_exit_error_handler (parser : ArgumentParser , message : str ) -> None :
537519 """Prints the usage and exits with error code 2 (same behavior as argparse).
538520
@@ -621,32 +603,26 @@ def default_meta(self, default_meta: bool):
621603 else :
622604 raise ValueError ("default_meta expects a boolean." )
623605
624- @deprecated (
625- """
606+ @deprecated ("""
626607 instantiate_subclasses was deprecated in v4.0.0 and will be removed in v5.0.0.
627608 Instead use instantiate_classes.
628- """
629- )
609+ """ )
630610 def instantiate_subclasses (self , cfg : Namespace ) -> Namespace :
631611 return self .instantiate_classes (cfg , instantiate_groups = False ) # type: ignore[attr-defined]
632612
633- @deprecated (
634- """
613+ @deprecated ("""
635614 add_dataclass_arguments was deprecated in v4.35.0 and will be removed in
636615 v5.0.0. Instead use add_class_arguments.
637- """
638- )
616+ """ )
639617 def add_dataclass_arguments (self , * args , ** kwargs ):
640618 if "title" in kwargs :
641619 kwargs ["help" ] = kwargs .pop ("title" )
642620 return self .add_class_arguments (* args , ** kwargs )
643621
644- @deprecated (
645- """
622+ @deprecated ("""
646623 ArgumentParser.check_config was deprecated in v4.35.0 and will be removed in
647624 v5.0.0. Instead use validate.
648- """
649- )
625+ """ )
650626 def check_config (self , * args , ** kwargs ):
651627 return self .validate (* args , ** kwargs )
652628
@@ -691,14 +667,12 @@ def deprecated_module(module_name, mappings=None):
691667 module = ModuleType (module_path , f"deprecated { module_path } " )
692668 sys .modules [module_path ] = module
693669
694- @deprecated (
695- f"""
670+ @deprecated (f"""
696671 Only use the public API as described in
697672 https://jsonargparse.readthedocs.io/en/stable/#api-reference. Importing
698673 from { module_path } is kept only to avoid breaking code that does not
699674 correctly use the public API. It will no longer be available from v5.0.0.
700- """
701- )
675+ """ )
702676 def __getattr__ (name ):
703677 new_module = f"_{ module_name } "
704678 if mappings and name in mappings :
@@ -732,12 +706,10 @@ def __getattr__(name):
732706)
733707
734708
735- @deprecated (
736- """
709+ @deprecated ("""
737710 ActionJsonnetExtVars was deprecated in v4.24.0 and will be removed in
738711 v5.0.0. Instead use ``type=dict``.
739- """
740- )
712+ """ )
741713class ActionJsonnetExtVars :
742714 """Action to add argument to provide ext_vars for jsonnet parsing."""
743715
@@ -749,36 +721,30 @@ def __call__(self, *args, **kwargs):
749721 return action
750722
751723
752- @deprecated (
753- """
724+ @deprecated ("""
754725 LoggerProperty was deprecated in v4.40.0 and will be removed from the public
755726 API in v5.0.0. There is no replacement since jsonargparse is not a logging
756727 library. A similar class can be found in reconplogger package.
757- """
758- )
728+ """ )
759729class LoggerProperty (InternalLoggerProperty ):
760730 """Adds a logger property, intended for internal use."""
761731
762732
763- @deprecated (
764- """
733+ @deprecated ("""
765734 namespace_to_dict was deprecated in v4.40.0 and will be removed in v5.0.0.
766735 Instead you can use ``.clone().as_dict()`` or ``.as_dict()``.
767- """
768- )
736+ """ )
769737def namespace_to_dict (namespace : Namespace ) -> Dict [str , Any ]:
770738 """Returns a copy of a nested namespace converted into a nested dictionary."""
771739 return namespace .clone ().as_dict ()
772740
773741
774- @deprecated (
775- """
742+ @deprecated ("""
776743 dict_to_namespace was deprecated in v4.43.0 and will be removed in v5.0.0.
777744 No replacement is provided because blindly converting a dictionary to a
778745 namespace may not yield the same results as using a parser, which could lead
779746 to confusion.
780- """
781- )
747+ """ )
782748def dict_to_namespace (cfg_dict : dict [str , Any ]) -> Namespace :
783749 """Converts a nested dictionary into a nested namespace."""
784750 from ._namespace import dict_to_namespace as _dict_to_namespace
@@ -794,12 +760,10 @@ def strip_meta(cfg: "Namespace") -> "Namespace": ... # pragma: no cover
794760def strip_meta (cfg : Dict [str , Any ]) -> Dict [str , Any ]: ... # pragma: no cover
795761
796762
797- @deprecated (
798- """
763+ @deprecated ("""
799764 strip_meta was deprecated in v4.43.0 and will be removed in v5.0.0.
800765 Instead use ``.clone(with_meta=False)``.
801- """
802- )
766+ """ )
803767def strip_meta (cfg ):
804768 """Removes all metadata keys from a configuration object."""
805769 from ._namespace import remove_meta
@@ -856,13 +820,11 @@ def set_yaml_argument_comment(self, text: str, cfg: ruamelCommentedMap, key: str
856820 self ._yaml_formatter .set_yaml_argument_comment (text , cfg , key , depth )
857821
858822
859- @deprecated (
860- """
823+ @deprecated ("""
861824 compose_dataclasses is deprecated and will be removed in v5.0.0. There is
862825 no direct replacement, whoever is interested can copy the code from an old
863826 release.
864- """
865- )
827+ """ )
866828def compose_dataclasses (* args ):
867829 """Returns a dataclass inheriting all given dataclasses and properly handling __post_init__."""
868830
0 commit comments