Skip to content

Commit 2814aa7

Browse files
committed
Fix documention build warnings
1 parent 2b39ee3 commit 2814aa7

17 files changed

Lines changed: 272 additions & 253 deletions

File tree

docs/guide/users/navigating.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ To access an object's members, there are a few options:
4141

4242
```pycon
4343
>>> import griffe
44-
>>> markdown = griffe.load("markdown")
44+
>>> markdown = griffelib.load("markdown")
4545
>>> markdown.members["Markdown"]
4646
Alias('Markdown', 'markdown.core.Markdown')
4747
>>> markdown.members["core"].members["Markdown"]
@@ -54,7 +54,7 @@ To access an object's members, there are a few options:
5454

5555
```pycon
5656
>>> import griffe
57-
>>> markdown = griffe.load("markdown")
57+
>>> markdown = griffelib.load("markdown")
5858
>>> markdown["core"]["Markdown"] # chained access
5959
Class('Markdown', 46, 451)
6060
>>> markdown["core.Markdown"] # merged access
@@ -65,7 +65,7 @@ To access an object's members, there are a few options:
6565

6666
```pycon
6767
>>> import griffe
68-
>>> markdown = griffe.load("markdown")
68+
>>> markdown = griffelib.load("markdown")
6969
>>> markdown[("core", "Markdown")] # tuple access
7070
Class('Markdown', 46, 451)
7171
>>> # Due to the nature of the subscript syntax,
@@ -78,7 +78,7 @@ To access an object's members, there are a few options:
7878

7979
```pycon
8080
>>> import griffe
81-
>>> markdown = griffe.load("markdown")
81+
>>> markdown = griffelib.load("markdown")
8282
>>> markdown.get_member("core.Markdown")
8383
Class('Markdown', 46, 451)
8484
```
@@ -122,7 +122,7 @@ If a base class cannot be resolved during computation of inherited members, Grif
122122

123123
If you want to access all members at once (both declared and inherited), use the [`all_members`][griffe.Object.all_members] attribute. If you want to access only declared members, use the [`members`][griffe.Object] attribute.
124124

125-
Accessing the [`attributes`][griffe.Object.attributes], [`functions`][griffe.Object.functions], [`classes`][griffe.Object.classes], [`type_aliases`][griffe.Object.type_aliases] or [`modules`][griffe.Object.modules] attributes will trigger inheritance computation, so make sure to only access them once everything is loaded by Griffe. Don't try to access inherited members in extensions, while visiting or inspecting modules.
125+
Accessing the [`attributes`][griffe.Object.attributes], [`functions`][griffe.Object.functions], [`classes`][griffe.Object.classes], [`type_aliases`][griffe.Object.type_aliases] or [`modules`][griffe.Object.modules] attributes will trigger inheritance computation, so make sure to only access them once everything is loaded by griffelib. Don't try to access inherited members in extensions, while visiting or inspecting modules.
126126

127127
#### Limitations
128128

@@ -254,7 +254,7 @@ from pkg2 import A as B
254254

255255
```pycon
256256
>>> import griffe
257-
>>> B = griffe.load("pkg1.B")
257+
>>> B = griffelib.load("pkg1.B")
258258
>>> B.path
259259
'pkg1.B'
260260
>>> B.canonical_path
@@ -339,13 +339,13 @@ Each object has an optional [`docstring`][griffe.Object.docstring] attached to i
339339

340340
Docstrings can be parsed against several [docstring-styles](../../reference/docstrings.md), which are micro-formats that allow documenting things such as parameters, returned values, raised exceptions, etc..
341341

342-
When loading a package, it is possible to specify the docstring style to attach to every docstring (see the `docstring_parser` parameter of [`griffe.load`][griffe.load]). Accessing the [`parsed`][griffe.Docstring.parsed] field of a docstring will use this style to parse the docstring and return a list of [docstring sections][advanced-api-sections]. Each section has a `value` whose shape depends on the section kind. For example, parameter sections have a list of parameter representations as value, while a text section only has a string as value.
342+
When loading a package, it is possible to specify the docstring style to attach to every docstring (see the `docstring_parser` parameter of [`griffelib.load`][griffe.load]). Accessing the [`parsed`][griffe.Docstring.parsed] field of a docstring will use this style to parse the docstring and return a list of [docstring sections][advanced-api-sections]. Each section has a `value` whose shape depends on the section kind. For example, parameter sections have a list of parameter representations as value, while a text section only has a string as value.
343343

344344
After a package is loaded, it is still possible to change the style used for specific docstrings by either overriding their [`parser`][griffe.Docstring.parser] and [`parser_options`][griffe.Docstring.parser_options] attributes, or by calling their [`parse()`][griffe.Docstring.parse] method with a different style:
345345

346346
```pycon
347347
>>> import griffe
348-
>>> markdown = griffe.load("markdown", docstring_parser="google")
348+
>>> markdown = griffelib.load("markdown", docstring_parser="google")
349349
>>> markdown["Markdown"].docstring.parse("numpy")
350350
[...]
351351
```

docs/reference/api/loaders.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,22 @@
22

33
## **Main API**
44

5-
::: griffe.load
5+
::: griffelib.load
66

7-
::: griffe.load_git
7+
::: griffelib.load_git
88

9-
::: griffe.load_pypi
9+
::: griffelib.load_pypi
1010

1111
## **Advanced API**
1212

13-
::: griffe.GriffeLoader
13+
::: griffelib.GriffeLoader
1414

15-
::: griffe.ModulesCollection
15+
::: griffelib.ModulesCollection
1616

17-
::: griffe.LinesCollection
17+
::: griffelib.LinesCollection
1818

1919
## **Additional API**
2020

21-
::: griffe.Stats
21+
::: griffelib.Stats
2222

23-
::: griffe.merge_stubs
23+
::: griffelib.merge_stubs

packages/griffelib/src/griffelib/_internal/agents/inspector.py

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,13 @@
1515
from griffelib._internal.agents.nodes.runtime import ObjectNode
1616
from griffelib._internal.collections import LinesCollection, ModulesCollection
1717
from griffelib._internal.enumerations import Kind, ParameterKind, TypeParameterKind
18-
from griffelib._internal.expressions import Expr, ExprBinOp, ExprSubscript, ExprTuple, safe_get_annotation
18+
from griffelib._internal.expressions import (
19+
Expr,
20+
ExprBinOp,
21+
ExprSubscript,
22+
ExprTuple,
23+
safe_get_annotation,
24+
)
1925
from griffelib._internal.extensions.base import Extensions, load_extensions
2026
from griffelib._internal.importer import dynamic_import
2127
from griffelib._internal.logger import logger
@@ -75,16 +81,16 @@ def inspect(
7581
In this case, we load the module using introspection.
7682
7783
Griffe therefore provides this function for dynamic analysis.
78-
It uses a [`NodeVisitor`][ast.NodeVisitor]-like class, the [`Inspector`][griffelib.Inspector],
84+
It uses a [`NodeVisitor`][ast.NodeVisitor]-like class, the [`Inspector`][griffe.Inspector],
7985
to inspect the module with [`inspect.getmembers()`][inspect.getmembers].
8086
81-
The inspection agent works similarly to the regular [`Visitor`][griffelib.Visitor] agent,
87+
The inspection agent works similarly to the regular [`Visitor`][griffe.Visitor] agent,
8288
in that it maintains a state with the current object being handled, and recursively handle its members.
8389
8490
Important:
8591
This function is generally not used directly.
86-
In most cases, users can rely on the [`GriffeLoader`][griffelib.GriffeLoader]
87-
and its accompanying [`load`][griffelib.load] shortcut and their respective options
92+
In most cases, users can rely on the [`GriffeLoader`][griffe.GriffeLoader]
93+
and its accompanying [`load`][griffe.load] shortcut and their respective options
8894
to load modules using dynamic analysis.
8995
9096
Parameters:

packages/griffelib/src/griffelib/_internal/agents/visitor.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,11 @@
2020
from griffelib._internal.agents.nodes.parameters import get_parameters
2121
from griffelib._internal.collections import LinesCollection, ModulesCollection
2222
from griffelib._internal.enumerations import Kind, TypeParameterKind
23-
from griffelib._internal.exceptions import AliasResolutionError, CyclicAliasError, LastNodeError
23+
from griffelib._internal.exceptions import (
24+
AliasResolutionError,
25+
CyclicAliasError,
26+
LastNodeError,
27+
)
2428
from griffelib._internal.expressions import (
2529
Expr,
2630
ExprName,
@@ -92,13 +96,13 @@ def visit(
9296
"""Parse and visit a module file.
9397
9498
We provide this function for static analysis. It uses a [`NodeVisitor`][ast.NodeVisitor]-like class,
95-
the [`Visitor`][griffelib.Visitor], to compile and parse code (using [`compile`][])
99+
the [`Visitor`][griffe.Visitor], to compile and parse code (using [`compile`][])
96100
then visit the resulting AST (Abstract Syntax Tree).
97101
98102
Important:
99103
This function is generally not used directly.
100-
In most cases, users can rely on the [`GriffeLoader`][griffelib.GriffeLoader]
101-
and its accompanying [`load`][griffelib.load] shortcut and their respective options
104+
In most cases, users can rely on the [`GriffeLoader`][griffe.GriffeLoader]
105+
and its accompanying [`load`][griffe.load] shortcut and their respective options
102106
to load modules using static analysis.
103107
104108
Parameters:

packages/griffelib/src/griffelib/_internal/diff.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ def _relative_package_filepath(self) -> Path:
150150
def _location(self) -> Path:
151151
# Absolute file path probably means temporary worktree.
152152
# We use our worktree prefix to remove some components
153-
# of the path on the left (`/tmp/griffelib-worktree-*/griffe_*/repo`).
153+
# of the path on the left (`/tmp/griffe-worktree-*/griffe_*/repo`).
154154
if self._relative_filepath.is_absolute():
155155
parts = self._relative_filepath.parts
156156
for index, part in enumerate(parts):

packages/griffelib/src/griffelib/_internal/docstrings/auto.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ def parse_auto(
195195
) -> list[DocstringSection]:
196196
"""Parse a docstring by automatically detecting the style it uses.
197197
198-
See [`infer_docstring_style`][griffelib.infer_docstring_style] for more information
198+
See [`infer_docstring_style`][griffe.infer_docstring_style] for more information
199199
on the available parameters.
200200
201201
Parameters:

packages/griffelib/src/griffelib/_internal/encoders.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ def __init__(
6161
*args: See [`json.JSONEncoder`][].
6262
full: Whether to dump full data or base data.
6363
If you plan to reload the data in Python memory
64-
using the [`json_decoder`][griffelib.json_decoder],
64+
using the [`json_decoder`][griffe.json_decoder],
6565
you don't need the full data as it can be inferred again
6666
using the base data. If you want to feed a non-Python
6767
tool instead, dump the full data.

packages/griffelib/src/griffelib/_internal/expressions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ def iterate(self, *, flat: bool = True) -> Iterator[str | Expr]: # noqa: ARG002
180180
without them getting rendered as strings.
181181
182182
On the contrary, when flat is true, the whole tree is flattened as a sequence
183-
of strings and instances of [Names][griffelib.ExprName].
183+
of strings and instances of [Names][griffe.ExprName].
184184
185185
Yields:
186186
Strings and names when flat, strings and expressions otherwise.

packages/griffelib/src/griffelib/_internal/finder.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,9 @@ class ModuleFinder:
8989
"""The Griffe finder, allowing to find modules on the file system.
9090
9191
The module finder is generally not used directly.
92-
Each [`GriffeLoader`][griffelib.GriffeLoader] instance creates its own module finder instance.
92+
Each [`GriffeLoader`][griffe.GriffeLoader] instance creates its own module finder instance.
9393
The finder can be configured when instantiating the loader
94-
thanks to the [loader][griffelib.GriffeLoader]'s `search_paths` parameter.
94+
thanks to the [loader][griffe.GriffeLoader]'s `search_paths` parameter.
9595
"""
9696

9797
accepted_py_module_extensions: ClassVar[list[str]] = [".py", ".pyc", ".pyo", ".pyd", ".pyi", ".so"]

packages/griffelib/src/griffelib/_internal/git.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# This module contains Git utilities, used by our [`load_git`][griffelib.load_git] function,
1+
# This module contains Git utilities, used by our [`load_git`][griffe.load_git] function,
22
# which in turn is used to load the API for different snapshots of a Git repository
33
# and find breaking changes between them.
44

0 commit comments

Comments
 (0)