33from __future__ import annotations
44
55import re
6- from typing import TYPE_CHECKING , Any , Literal , TypedDict
7- from warnings import warn
6+ from typing import TYPE_CHECKING , Literal , TypedDict
87
98from griffe ._internal .enumerations import Parser
109
@@ -121,8 +120,6 @@ def infer_docstring_style(
121120 style_order : list [Parser ] | list [DocstringStyle ] | None = None ,
122121 default : Parser | DocstringStyle | None = None ,
123122 per_style_options : PerStyleOptions | None = None ,
124- # YORE: Bump 2: Remove line.
125- ** options : Any ,
126123) -> tuple [Parser | None , list [DocstringSection ] | None ]:
127124 """Infer the parser to use for the docstring.
128125
@@ -142,21 +139,13 @@ def infer_docstring_style(
142139 style_order: The order of the styles to try when inferring the parser.
143140 default: The default parser to use if the inference fails.
144141 per_style_options: Additional parsing options per style.
145- **options: Deprecated. Use `per_style_options` instead.
146142
147143 Returns:
148144 The inferred parser, and optionally parsed sections (when method is 'max_sections').
149145 """
150146 from griffe ._internal .docstrings .parsers import parsers # noqa: PLC0415
151147
152- # YORE: Bump 2: Replace block with `per_style_options = per_style_options or {}`.
153- if options :
154- if per_style_options :
155- raise ValueError ("Cannot use both `options` and `per_style_options`." )
156- warn ("`**options` is deprecated. Use `per_style_options` instead." , DeprecationWarning , stacklevel = 2 )
157- per_style_options = {"google" : options , "numpy" : options , "sphinx" : options } # type: ignore[assignment]
158- elif not per_style_options :
159- per_style_options = {}
148+ per_style_options = per_style_options or {}
160149
161150 style_order = [Parser (style ) if isinstance (style , str ) else style for style in style_order or _default_style_order ]
162151
@@ -203,8 +192,6 @@ def parse_auto(
203192 style_order : list [Parser ] | list [DocstringStyle ] | None = None ,
204193 default : Parser | DocstringStyle | None = None ,
205194 per_style_options : PerStyleOptions | None = None ,
206- # YORE: Bump 2: Remove line.
207- ** options : Any ,
208195) -> list [DocstringSection ]:
209196 """Parse a docstring by automatically detecting the style it uses.
210197
@@ -217,21 +204,13 @@ def parse_auto(
217204 style_order: The order of the styles to try when inferring the parser.
218205 default: The default parser to use if the inference fails.
219206 per_style_options: Additional parsing options per style.
220- **options: Deprecated. Use `per_style_options` instead.
221207
222208 Returns:
223209 A list of docstring sections.
224210 """
225211 from griffe ._internal .docstrings .parsers import parse # noqa: PLC0415
226212
227- # YORE: Bump 2: Replace block with `per_style_options = per_style_options or {}`.
228- if options :
229- if per_style_options :
230- raise ValueError ("Cannot use both `options` and `per_style_options`." )
231- warn ("`**options` are deprecated. Use `per_style_options` instead." , DeprecationWarning , stacklevel = 2 )
232- per_style_options = {"google" : options , "numpy" : options , "sphinx" : options } # type: ignore[assignment]
233- elif not per_style_options :
234- per_style_options = {}
213+ per_style_options = per_style_options or {}
235214
236215 style , sections = infer_docstring_style (
237216 docstring ,
0 commit comments