Skip to content

Commit 02cf71f

Browse files
committed
Remove old deprecations
Breaking change
1 parent 30db8d7 commit 02cf71f

17 files changed

Lines changed: 6 additions & 246 deletions

File tree

docs/guide/contributors/workflow.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,6 @@ Deprecated code should also be marked as legacy code. We use [Yore](https://pawa
5757
Examples:
5858

5959
```python title="Remove function when we bump to 2.0"
60-
# YORE: Bump 2: Remove block.
61-
def deprecated_function():
62-
...
63-
```
6460

6561
```python title="Simplify imports when Python 3.15 is EOL"
6662
# YORE: EOL 3.15: Replace block with line 4.

docs/reference/api/agents.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,4 @@ Griffe is able to analyze code both statically and dynamically.
7070

7171
::: griffe.safe_get_value
7272

73-
<!-- YORE: Bump 2: Remove line. -->
74-
## **Deprecated API**
7573

76-
<!-- YORE: Bump 2: Remove line. -->
77-
::: griffe.ExportedName

docs/reference/api/git.md

Lines changed: 0 additions & 13 deletions
This file was deleted.

duties.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -291,8 +291,6 @@ def check_api(ctx: Context, *cli_args: str) -> None:
291291
color=True,
292292
extensions=[
293293
"griffe_inherited_docstrings",
294-
# YORE: Bump 2: Remove line.
295-
"scripts/griffe_exts.py",
296294
"unpack_typeddict",
297295
],
298296
).add_args(*cli_args),

mkdocs.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,6 @@ nav:
110110
- Parsers: reference/api/docstrings/parsers.md
111111
- Exceptions: reference/api/exceptions.md
112112
- Expressions: reference/api/expressions.md
113-
# YORE: Bump 2: Remove line.
114-
- Git utilities: reference/api/git.md
115113
- Loggers: reference/api/loggers.md
116114
- Helpers: reference/api/helpers.md
117115
- Changelog: changelog.md
@@ -231,8 +229,6 @@ plugins:
231229
docstring_section_style: list
232230
extensions:
233231
- griffe_inherited_docstrings
234-
# YORE: Bump 2: Remove line.
235-
- scripts/griffe_exts.py
236232
- unpack_typeddict
237233
heading_level: 2
238234
inherited_members: true

scripts/griffe_exts.py

Lines changed: 0 additions & 24 deletions
This file was deleted.

src/griffe/__init__.py

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -182,8 +182,7 @@
182182
)
183183
from griffe._internal.agents.nodes.docstrings import get_docstring
184184

185-
# YORE: Bump 2: Replace `ExportedName, ` with `` within line.
186-
from griffe._internal.agents.nodes.exports import ExportedName, get__all__, safe_get__all__
185+
from griffe._internal.agents.nodes.exports import get__all__, safe_get__all__
187186
from griffe._internal.agents.nodes.imports import relative_to_absolute
188187
from griffe._internal.agents.nodes.parameters import ParametersType, get_parameters
189188
from griffe._internal.agents.nodes.runtime import ObjectNode
@@ -383,28 +382,8 @@
383382
vtree,
384383
)
385384

386-
# YORE: Bump 2: Remove block.
387-
_deprecated_names = (
388-
"assert_git_repo",
389-
"get_latest_tag",
390-
"get_repo_root",
391-
"tmp_worktree",
392-
)
393-
394-
395-
# YORE: Bump 2: Remove block.
396-
def __getattr__(name: str) -> Any:
397-
if name in _deprecated_names:
398-
from griffe._internal import git # noqa: PLC0415
399385

400-
warnings.warn(
401-
f"The `{name}` function is deprecated and will become unavailable in the next major version.",
402-
DeprecationWarning,
403-
stacklevel=2,
404-
)
405-
return getattr(git, f"_{name}")
406386

407-
raise AttributeError(f"module '{__name__}' has no attribute '{name}'")
408387

409388

410389
# Regenerate this list with the following Python snippet:
@@ -468,8 +447,6 @@ def __getattr__(name: str) -> Any:
468447
"DocstringWarn",
469448
"DocstringYield",
470449
"ExplanationStyle",
471-
# YORE: Bump 2: Remove line.
472-
"ExportedName",
473450
"Expr",
474451
"ExprAttribute",
475452
"ExprBinOp",

src/griffe/_internal/agents/nodes/exports.py

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,6 @@
1616
from griffe._internal.models import Module
1717

1818

19-
# YORE: Bump 2: Remove block.
20-
@dataclass
21-
class ExportedName:
22-
"""Deprecated. An intermediate class to store names.
23-
24-
The [`get__all__`][griffe.get__all__] function now returns instances of [`ExprName`][griffe.ExprName] instead.
25-
"""
26-
27-
name: str
28-
"""The exported name."""
29-
parent: Module
30-
"""The parent module."""
3119

3220

3321
def _extract_attribute(node: ast.Attribute, parent: Module) -> list[str | ExprName]:

src/griffe/_internal/docstrings/auto.py

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,6 @@ def infer_docstring_style(
121121
style_order: list[Parser] | list[DocstringStyle] | None = None,
122122
default: Parser | DocstringStyle | None = None,
123123
per_style_options: PerStyleOptions | None = None,
124-
# YORE: Bump 2: Remove line.
125-
**options: Any,
126124
) -> tuple[Parser | None, list[DocstringSection] | None]:
127125
"""Infer the parser to use for the docstring.
128126
@@ -149,14 +147,7 @@ def infer_docstring_style(
149147
"""
150148
from griffe._internal.docstrings.parsers import parsers # noqa: PLC0415
151149

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 = {}
150+
per_style_options = per_style_options or {}
160151

161152
style_order = [Parser(style) if isinstance(style, str) else style for style in style_order or _default_style_order]
162153

@@ -203,8 +194,6 @@ def parse_auto(
203194
style_order: list[Parser] | list[DocstringStyle] | None = None,
204195
default: Parser | DocstringStyle | None = None,
205196
per_style_options: PerStyleOptions | None = None,
206-
# YORE: Bump 2: Remove line.
207-
**options: Any,
208197
) -> list[DocstringSection]:
209198
"""Parse a docstring by automatically detecting the style it uses.
210199
@@ -224,14 +213,7 @@ def parse_auto(
224213
"""
225214
from griffe._internal.docstrings.parsers import parse # noqa: PLC0415
226215

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 = {}
216+
per_style_options = per_style_options or {}
235217

236218
style, sections = infer_docstring_style(
237219
docstring,

src/griffe/_internal/docstrings/google.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -892,8 +892,6 @@ def parse_google(
892892
warn_unknown_params: bool = True,
893893
warn_missing_types: bool = True,
894894
warnings: bool = True,
895-
# YORE: Bump 2: Remove line.
896-
**options: Any,
897895
) -> list[DocstringSection]:
898896
"""Parse a Google-style docstring.
899897
@@ -932,9 +930,6 @@ def parse_google(
932930
in_code_block = False
933931
lines = docstring.lines
934932

935-
# YORE: Bump 2: Remove block.
936-
if options:
937-
warn("Passing additional options is deprecated, these options are ignored.", DeprecationWarning, stacklevel=2)
938933

939934
options = {
940935
"ignore_init_summary": ignore_init_summary,

0 commit comments

Comments
 (0)