list [str ] | None
:material-equal: `["!^_[^_]"]`{ title="default value" }**
+- **:octicons-package-24: Type list [str ] | Literal ["public"] | None
:material-equal: `["!^_[^_]"]`{ title="default value" }**
-A list of filters applied to filter objects based on their name.
+A list of filters, or `"public"`.
+
+**Filtering methods**
+
+[](){#option-filters-public}
+
+[:octicons-heart-fill-24:{ .pulse } Sponsors only](../../insiders/index.md){ .insiders } —
+[:octicons-tag-24: Insiders 1.11.0](../../insiders/changelog.md#1.11.0)
+
+The `public` filtering method will include only public objects: those added to the `__all__` attribute of modules, or not starting with a single underscore. Special methods and attributes ("dunder" methods/attributes, starting and ending with two underscores), like `__init__`, `__call__`, `__mult__`, etc., are always considered public.
+
+**List of filters**
Filters are regular expressions. These regular expressions are evaluated by Python
and so must match the syntax supported by the [`re`][] module.
@@ -379,13 +397,13 @@ plugins:
python:
options:
filters:
- - "!^_"
+ - "!^_[^_]"
```
```md title="or in docs/some_page.md (local configuration)"
::: package.module
options:
- filters: []
+ filters: public
```
```python title="package/module.py"
diff --git a/docs/usage/index.md b/docs/usage/index.md
index 84110936..b2a00955 100644
--- a/docs/usage/index.md
+++ b/docs/usage/index.md
@@ -87,8 +87,8 @@ plugins:
- mkdocstrings:
handlers:
python:
- import:
- - https://docs.python-requests.org/en/master/objects.inv
+ inventories:
+ - https://docs.python.org/3/objects.inv
```
When loading an inventory, you enable automatic cross-references
diff --git a/mkdocs.yml b/mkdocs.yml
index 3e03312a..0199ea9a 100644
--- a/mkdocs.yml
+++ b/mkdocs.yml
@@ -160,7 +160,7 @@ plugins:
ignore_init_summary: true
docstring_section_style: list
extensions: [scripts/griffe_extensions.py]
- filters: ["!^_"]
+ filters: public
heading_level: 1
inherited_members: true
line_length: 88
@@ -182,11 +182,12 @@ plugins:
summary: true
unwrap_annotated: true
- llmstxt:
- files:
- - output: llms-full.txt
- inputs:
+ full_output: llms-full.txt
+ sections:
+ Usage:
- index.md
- - reference/**.md
+ API:
+ - reference/api.md
- git-revision-date-localized:
enabled: !ENV [DEPLOY, false]
enable_creation_date: true
diff --git a/pyproject.toml b/pyproject.toml
index efaf7c5c..d93cb20c 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -33,7 +33,7 @@ classifiers = [
dependencies = [
"mkdocstrings>=0.28.3",
"mkdocs-autorefs>=1.4",
- "griffe>=0.49",
+ "griffe>=1.6.2",
"typing-extensions>=4.0; python_version < '3.11'",
]
@@ -57,7 +57,7 @@ includes = ["src/mkdocstrings_handlers"]
editable-backend = "editables"
# Include as much as possible in the source distribution, to help redistributors.
-excludes = ["**/.pytest_cache"]
+excludes = ["**/.pytest_cache", "**/.mypy_cache"]
source-includes = [
"config",
"docs",
@@ -86,7 +86,7 @@ maintain = [
"yore>=0.3.3",
]
ci = [
- "blacK>=25.1",
+ "black>=25.1",
"duty>=1.6",
"ruff>=0.4",
"pytest>=8.2",
@@ -105,12 +105,13 @@ ci = [
"mkdocs>=1.6",
"mkdocs-coverage>=1.0",
"mkdocs-git-revision-date-localized-plugin>=1.2",
- "mkdocs-llmstxt>=0.1",
+ "mkdocs-llmstxt>=0.2",
"mkdocs-material>=9.5",
- "pydantic>=2.10",
"mkdocs-minify-plugin>=0.8",
"mkdocs-redirects>=1.2",
"mkdocs-section-index>=0.3",
+ "mkdocstrings>=0.29",
+ "pydantic>=2.10",
# YORE: EOL 3.10: Remove line.
"tomli>=2.0; python_version < '3.11'",
]
diff --git a/src/mkdocstrings_handlers/python/_internal/config.py b/src/mkdocstrings_handlers/python/_internal/config.py
index a09f9fbe..210f8fe2 100644
--- a/src/mkdocstrings_handlers/python/_internal/config.py
+++ b/src/mkdocstrings_handlers/python/_internal/config.py
@@ -9,6 +9,8 @@
from mkdocstrings import get_logger
+from mkdocstrings_handlers.python._internal.rendering import Order # noqa: TC001
+
# YORE: EOL 3.10: Replace block with line 2.
if sys.version_info >= (3, 11):
from typing import Self
@@ -432,14 +434,24 @@ class PythonInputOptions:
] = field(default_factory=list)
filters: Annotated[
- list[str],
+ list[str] | Literal["public"],
_Field(
group="members",
- description="""A list of filters applied to filter objects based on their name.
+ description="""A list of filters, or `"public"`.
+
+ **List of filters**
A filter starting with `!` will exclude matching objects instead of including them.
The `members` option takes precedence over `filters` (filters will still be applied recursively
to lower members in the hierarchy).
+
+ **Filtering methods**
+
+ [:octicons-heart-fill-24:{ .pulse } Sponsors only](../insiders/index.md){ .insiders } —
+ [:octicons-tag-24: Insiders 1.11.0](../insiders/changelog.md#1.11.0)
+
+ The `public` method will include only public objects:
+ those added to `__all__` or not starting with an underscore (except for special methods/attributes).
""",
),
] = field(default_factory=lambda: _DEFAULT_FILTERS.copy())
@@ -510,13 +522,18 @@ class PythonInputOptions:
] = None
members_order: Annotated[
- Literal["alphabetical", "source"],
+ Order | list[Order],
_Field(
group="members",
description="""The members ordering to use.
- - `alphabetical`: order by the members names,
+ - `__all__`: order members according to `__all__` module attributes, if declared;
+ - `alphabetical`: order members alphabetically;
- `source`: order members as they appear in the source file.
+
+ Since `__all__` is a module-only attribute, it can't be used to sort class members,
+ therefore the `members_order` option accepts a list of ordering methods,
+ indicating ordering preferences.
""",
),
] = "alphabetical"
@@ -916,12 +933,12 @@ def from_data(cls, **data: Any) -> Self:
class PythonOptions(PythonInputOptions): # type: ignore[override,unused-ignore]
"""Final options passed as template context."""
- filters: list[tuple[re.Pattern, bool]] = field( # type: ignore[assignment]
+ filters: list[tuple[re.Pattern, bool]] | Literal["public"] = field( # type: ignore[assignment]
default_factory=lambda: [
(re.compile(filtr.removeprefix("!")), filtr.startswith("!")) for filtr in _DEFAULT_FILTERS
],
)
- """A list of filters applied to filter objects based on their name."""
+ """A list of filters, or `"public"`."""
summary: SummaryOption = field(default_factory=SummaryOption)
"""Whether to render summaries of modules, classes, functions (methods) and attributes."""
@@ -930,6 +947,11 @@ class PythonOptions(PythonInputOptions): # type: ignore[override,unused-ignore]
def coerce(cls, **data: Any) -> MutableMapping[str, Any]:
"""Create an instance from a dictionary."""
if "filters" in data:
+ # Non-insiders: transform back to default filters.
+ # Next: `if "filters" in data and not isinstance(data["filters"], str):`.
+ if data["filters"] == "public":
+ data["filters"] = _DEFAULT_FILTERS
+ # Filters are `None` or a sequence of strings (tests use tuples).
data["filters"] = [
(re.compile(filtr.removeprefix("!")), filtr.startswith("!")) for filtr in data["filters"] or ()
]
@@ -949,7 +971,7 @@ class Inventory:
),
]
- base: Annotated[
+ base_url: Annotated[
str | None,
_Field(
parent="inventories",
@@ -967,7 +989,7 @@ class Inventory:
@property
def _config(self) -> dict[str, Any]:
- return {"base": self.base, "domains": self.domains}
+ return {"base_url": self.base_url, "domains": self.domains}
# YORE: EOL 3.9: Replace `**_dataclass_options` with `frozen=True, kw_only=True` within line.
diff --git a/src/mkdocstrings_handlers/python/_internal/handler.py b/src/mkdocstrings_handlers/python/_internal/handler.py
index 896a70e3..158d7ddc 100644
--- a/src/mkdocstrings_handlers/python/_internal/handler.py
+++ b/src/mkdocstrings_handlers/python/_internal/handler.py
@@ -360,7 +360,7 @@ def get_aliases(self, identifier: str) -> tuple[str, ...]:
return tuple(f"{alias}({parameter})" for alias in aliases)
return tuple(aliases)
- def normalize_extension_paths(self, extensions: Sequence) -> Sequence:
+ def normalize_extension_paths(self, extensions: Sequence) -> list[str | dict[str, Any]]:
"""Resolve extension paths relative to config file.
Parameters:
@@ -369,7 +369,7 @@ def normalize_extension_paths(self, extensions: Sequence) -> Sequence:
Returns:
The normalized extensions.
"""
- normalized = []
+ normalized: list[str | dict[str, Any]] = []
for ext in extensions:
if isinstance(ext, dict):
diff --git a/src/mkdocstrings_handlers/python/_internal/rendering.py b/src/mkdocstrings_handlers/python/_internal/rendering.py
index 313658bc..897b6572 100644
--- a/src/mkdocstrings_handlers/python/_internal/rendering.py
+++ b/src/mkdocstrings_handlers/python/_internal/rendering.py
@@ -9,6 +9,7 @@
import sys
import warnings
from collections import defaultdict
+from contextlib import suppress
from dataclasses import replace
from functools import lru_cache
from pathlib import Path
@@ -17,6 +18,8 @@
from griffe import (
Alias,
+ AliasResolutionError,
+ CyclicAliasError,
DocstringAttribute,
DocstringClass,
DocstringFunction,
@@ -43,26 +46,35 @@
_logger = get_logger(__name__)
-def _sort_key_alphabetical(item: CollectorItem) -> Any:
- # chr(sys.maxunicode) is a string that contains the final unicode
- # character, so if 'name' isn't found on the object, the item will go to
- # the end of the list.
+def _sort_key_alphabetical(item: CollectorItem) -> str:
+ # `chr(sys.maxunicode)` is a string that contains the final unicode character,
+ # so if `name` isn't found on the object, the item will go to the end of the list.
return item.name or chr(sys.maxunicode)
-def _sort_key_source(item: CollectorItem) -> Any:
- # if 'lineno' is none, the item will go to the start of the list.
+def _sort_key_source(item: CollectorItem) -> float:
+ # If `lineno` is none, the item will go to the end of the list.
if item.is_alias:
- return item.alias_lineno if item.alias_lineno is not None else -1
- return item.lineno if item.lineno is not None else -1
+ return item.alias_lineno if item.alias_lineno is not None else float("inf")
+ return item.lineno if item.lineno is not None else float("inf")
-Order = Literal["alphabetical", "source"]
-"""Ordering methods."""
+def _sort__all__(item: CollectorItem) -> float: # noqa: ARG001
+ raise ValueError("Not implemented in public version of mkdocstrings-python")
-_order_map = {
+
+Order = Literal["__all__", "alphabetical", "source"]
+"""Ordering methods.
+
+- `__all__`: order members according to `__all__` module attributes, if declared;
+- `alphabetical`: order members alphabetically;
+- `source`: order members as they appear in the source file.
+"""
+
+_order_map: dict[str, Callable[[Object | Alias], str | float]] = {
"alphabetical": _sort_key_alphabetical,
"source": _sort_key_source,
+ "__all__": _sort__all__,
}
@@ -148,7 +160,7 @@ def do_format_signature(
The same code, formatted.
"""
env = context.environment
- # YORE: Bump 2: Replace `do_get_template(env, "signature")` with `"signature.html.jinja"`.
+ # YORE: Bump 2: Replace `do_get_template(env, "signature")` with `"signature.html.jinja"` within line.
template = env.get_template(do_get_template(env, "signature"))
if annotations is None:
@@ -173,10 +185,12 @@ def do_format_signature(
# Pygments sees it as a function call and not a function definition.
# The result is that the function name is not parsed as such,
# but instead as a regular name: `n` CSS class instead of `nf`.
- # To fix it, we replace the first occurrence of an `n` CSS class
- # with an `nf` one, unless we found `nf` already.
- if signature.find('class="nf"') == -1:
- signature = signature.replace('class="n"', 'class="nf"', 1)
+ # When the function name is a known special name like `__exit__`,
+ # Pygments will set an `fm` (function -> magic) CSS class.
+ # To fix this, we replace the CSS class in the first span with `nf`,
+ # unless we already found an `nf` span.
+ if not re.search(r'', signature):
+ signature = re.sub(r'', '', signature, count=1)
if stash := env.filters["stash_crossref"].stash:
for key, value in stash.items():
@@ -208,7 +222,7 @@ def do_format_attribute(
The same code, formatted.
"""
env = context.environment
- # YORE: Bump 2: Replace `do_get_template(env, "expression")` with `"expression.html.jinja"`.
+ # YORE: Bump 2: Replace `do_get_template(env, "expression")` with `"expression.html.jinja"` within line.
template = env.get_template(do_get_template(env, "expression"))
annotations = context.parent["config"].show_signature_annotations
@@ -246,7 +260,7 @@ def do_format_attribute(
def do_order_members(
members: Sequence[Object | Alias],
- order: Order,
+ order: Order | list[Order],
members_list: bool | list[str] | None,
) -> Sequence[Object | Alias]:
"""Order members given an ordering method.
@@ -266,7 +280,12 @@ def do_order_members(
if name in members_dict:
sorted_members.append(members_dict[name])
return sorted_members
- return sorted(members, key=_order_map[order])
+ if isinstance(order, str):
+ order = [order]
+ for method in order:
+ with suppress(ValueError):
+ return sorted(members, key=_order_map[method])
+ return members
# YORE: Bump 2: Remove block.
@@ -396,10 +415,33 @@ def _keep_object(name: str, filters: Sequence[tuple[Pattern, bool]]) -> bool:
return keep
+def _parents(obj: Alias) -> set[str]:
+ parent: Object | Alias = obj.parent # type: ignore[assignment]
+ parents = {obj.path, parent.path}
+ if parent.is_alias:
+ parents.add(parent.final_target.path) # type: ignore[union-attr]
+ while parent.parent:
+ parent = parent.parent
+ parents.add(parent.path)
+ if parent.is_alias:
+ parents.add(parent.final_target.path) # type: ignore[union-attr]
+ return parents
+
+
+def _remove_cycles(objects: list[Object | Alias]) -> Iterator[Object | Alias]:
+ suppress_errors = suppress(AliasResolutionError, CyclicAliasError)
+ for obj in objects:
+ if obj.is_alias:
+ with suppress_errors:
+ if obj.final_target.path in _parents(obj): # type: ignore[arg-type,union-attr]
+ continue
+ yield obj
+
+
def do_filter_objects(
objects_dictionary: dict[str, Object | Alias],
*,
- filters: Sequence[tuple[Pattern, bool]] | None = None,
+ filters: Sequence[tuple[Pattern, bool]] | Literal["public"] | None = None,
members_list: bool | list[str] | None = None,
inherited_members: bool | list[str] = False,
keep_no_docstrings: bool = True,
@@ -408,7 +450,7 @@ def do_filter_objects(
Parameters:
objects_dictionary: The dictionary of objects.
- filters: Filters to apply, based on members' names.
+ filters: Filters to apply, based on members' names, or `"public"`.
Each element is a tuple: a pattern, and a boolean indicating whether
to reject the object if the pattern matches.
members_list: An optional, explicit list of members to keep.
@@ -449,14 +491,20 @@ def do_filter_objects(
]
# Use filters and docstrings.
- if filters:
+ if filters == "public":
+ objects = [obj for obj in objects if obj.is_public]
+ elif filters:
objects = [
obj for obj in objects if _keep_object(obj.name, filters) or (inherited_members_specified and obj.inherited)
]
- if keep_no_docstrings:
- return objects
+ if not keep_no_docstrings:
+ objects = [obj for obj in objects if obj.has_docstrings or (inherited_members_specified and obj.inherited)]
+
+ # Prevent infinite recursion.
+ if objects:
+ objects = list(_remove_cycles(objects))
- return [obj for obj in objects if obj.has_docstrings or (inherited_members_specified and obj.inherited)]
+ return objects
@lru_cache(maxsize=1)
diff --git a/src/mkdocstrings_handlers/python/templates/material/_base/attribute.html.jinja b/src/mkdocstrings_handlers/python/templates/material/_base/attribute.html.jinja
index e69b9b83..519590e5 100644
--- a/src/mkdocstrings_handlers/python/templates/material/_base/attribute.html.jinja
+++ b/src/mkdocstrings_handlers/python/templates/material/_base/attribute.html.jinja
@@ -39,7 +39,7 @@ Context:
role="data" if attribute.parent.kind.value == "module" else "attr",
id=html_id,
class="doc doc-heading",
- toc_label=('
'|safe if config.show_symbol_type_toc else '') + attribute.name,
+ toc_label=('
'|safe if config.show_symbol_type_toc else '') + (config.toc_label if config.toc_label and root else attribute.name),
) %}
{% block heading scoped %}
@@ -48,8 +48,10 @@ Context:
This block renders the heading for the attribute.
-#}
{% if config.show_symbol_type_heading %}
{% endif %}
- {% if config.separate_signature %}
- {{ config.heading if config.heading and root else attribute_name }}
+ {% if config.heading and root %}
+ {{ config.heading }}
+ {% elif config.separate_signature %}
+ {{ attribute_name }}
{% else %}
{%+ filter highlight(language="python", inline=True) %}
{{ attribute_name }}{% if attribute.annotation and config.show_signature_annotations %}: {{ attribute.annotation }}{% endif %}
diff --git a/src/mkdocstrings_handlers/python/templates/material/_base/children.html.jinja b/src/mkdocstrings_handlers/python/templates/material/_base/children.html.jinja
index 40c011ed..0b9fcd64 100644
--- a/src/mkdocstrings_handlers/python/templates/material/_base/children.html.jinja
+++ b/src/mkdocstrings_handlers/python/templates/material/_base/children.html.jinja
@@ -49,7 +49,7 @@ Context:
{% endif %}
{% with heading_level = heading_level + extra_level %}
{% for attribute in attributes|order_members(config.members_order, members_list) %}
- {% if members_list is not none or (not attribute.is_imported or attribute.is_public) %}
+ {% if config.filters == "public" or members_list is not none or (not attribute.is_imported or attribute.is_public) %}
{% include attribute|get_template with context %}
{% endif %}
{% endfor %}
@@ -69,7 +69,7 @@ Context:
{% endif %}
{% with heading_level = heading_level + extra_level %}
{% for class in classes|order_members(config.members_order, members_list) %}
- {% if members_list is not none or (not class.is_imported or class.is_public) %}
+ {% if config.filters == "public" or members_list is not none or (not class.is_imported or class.is_public) %}
{% include class|get_template with context %}
{% endif %}
{% endfor %}
@@ -90,7 +90,7 @@ Context:
{% with heading_level = heading_level + extra_level %}
{% for function in functions|order_members(config.members_order, members_list) %}
{% if not (obj.kind.value == "class" and function.name == "__init__" and config.merge_init_into_class) %}
- {% if members_list is not none or (not function.is_imported or function.is_public) %}
+ {% if config.filters == "public" or members_list is not none or (not function.is_imported or function.is_public) %}
{% include function|get_template with context %}
{% endif %}
{% endif %}
@@ -112,7 +112,7 @@ Context:
{% endif %}
{% with heading_level = heading_level + extra_level %}
{% for module in modules|order_members("alphabetical", members_list) %}
- {% if members_list is not none or (not module.is_alias or module.is_public) %}
+ {% if config.filters == "public" or members_list is not none or (not module.is_alias or module.is_public) %}
{% include module|get_template with context %}
{% endif %}
{% endfor %}
@@ -137,7 +137,7 @@ Context:
{% if not (obj.is_class and child.name == "__init__" and config.merge_init_into_class) %}
- {% if members_list is not none or child.is_public %}
+ {% if config.filters == "public" or members_list is not none or child.is_public %}
{% if child.is_attribute %}
{% with attribute = child %}
{% include attribute|get_template with context %}
diff --git a/src/mkdocstrings_handlers/python/templates/material/_base/class.html.jinja b/src/mkdocstrings_handlers/python/templates/material/_base/class.html.jinja
index e0aab3ac..8a54dd1b 100644
--- a/src/mkdocstrings_handlers/python/templates/material/_base/class.html.jinja
+++ b/src/mkdocstrings_handlers/python/templates/material/_base/class.html.jinja
@@ -38,7 +38,7 @@ Context:
role="class",
id=html_id,
class="doc doc-heading",
- toc_label=('
'|safe if config.show_symbol_type_toc else '') + class.name,
+ toc_label=('
'|safe if config.show_symbol_type_toc else '') + (config.toc_label if config.toc_label and root else class.name),
) %}
{% block heading scoped %}
@@ -47,8 +47,10 @@ Context:
This block renders the heading for the class.
-#}
{% if config.show_symbol_type_heading %}
{% endif %}
- {% if config.separate_signature %}
- {{ config.heading if config.heading and root else class_name }}
+ {% if config.heading and root %}
+ {{ config.heading }}
+ {% elif config.separate_signature %}
+ {{ class_name }}
{% elif config.merge_init_into_class and "__init__" in all_members %}
{% with function = all_members["__init__"] %}
{%+ filter highlight(language="python", inline=True) -%}
diff --git a/src/mkdocstrings_handlers/python/templates/material/_base/function.html.jinja b/src/mkdocstrings_handlers/python/templates/material/_base/function.html.jinja
index 50ed5840..21888939 100644
--- a/src/mkdocstrings_handlers/python/templates/material/_base/function.html.jinja
+++ b/src/mkdocstrings_handlers/python/templates/material/_base/function.html.jinja
@@ -45,7 +45,7 @@ Context:
role="function",
id=html_id,
class="doc doc-heading",
- toc_label=(('
')|safe if config.show_symbol_type_toc else '') + function.name,
+ toc_label=(('
')|safe if config.show_symbol_type_toc else '') + (config.toc_label if config.toc_label and root else function.name),
) %}
{% block heading scoped %}
@@ -54,8 +54,10 @@ Context:
This block renders the heading for the function.
-#}
{% if config.show_symbol_type_heading %}
{% endif %}
- {% if config.separate_signature %}
- {{ config.heading if config.heading and root else function_name }}
+ {% if config.heading and root %}
+ {{ config.heading }}
+ {% elif config.separate_signature %}
+ {{ function_name }}
{% else %}
{%+ filter highlight(language="python", inline=True) -%}
{#- YORE: Bump 2: Replace `"|get_template` with `.html.jinja"` within line. -#}
diff --git a/src/mkdocstrings_handlers/python/templates/material/_base/module.html.jinja b/src/mkdocstrings_handlers/python/templates/material/_base/module.html.jinja
index d2b5516d..283f2654 100644
--- a/src/mkdocstrings_handlers/python/templates/material/_base/module.html.jinja
+++ b/src/mkdocstrings_handlers/python/templates/material/_base/module.html.jinja
@@ -47,8 +47,10 @@ Context:
This block renders the heading for the module.
-#}
{% if config.show_symbol_type_heading %}
{% endif %}
- {% if config.separate_signature %}
- {{ config.heading if config.heading and root else module_name }}
+ {% if config.heading and root %}
+ {{ config.heading }}
+ {% elif config.separate_signature %}
+ {{ module_name }}
{% else %}
{{ module_name }}
{% endif %}
diff --git a/src/mkdocstrings_handlers/python/templates/material/style.css b/src/mkdocstrings_handlers/python/templates/material/style.css
index e5e150ec..b8c3e639 100644
--- a/src/mkdocstrings_handlers/python/templates/material/style.css
+++ b/src/mkdocstrings_handlers/python/templates/material/style.css
@@ -9,6 +9,11 @@
display: inline;
}
+/* No text transformation from Material for MkDocs for H5 headings. */
+.md-typeset h5 .doc-object-name {
+ text-transform: none;
+}
+
/* Max width for docstring sections tables. */
.doc .md-typeset__table,
.doc .md-typeset__table table {
@@ -30,6 +35,11 @@
display: inline;
}
+/* Default font size for parameter headings. */
+.md-typeset .doc-heading-parameter {
+ font-size: inherit;
+}
+
/* Prefer space on the right, not the left of parameter permalinks. */
.doc-heading-parameter .headerlink {
margin-left: 0 !important;
diff --git a/tests/snapshots/__init__.py b/tests/snapshots/__init__.py
index 712cdafe..36eb97b7 100644
--- a/tests/snapshots/__init__.py
+++ b/tests/snapshots/__init__.py
@@ -8,12 +8,12 @@
("separate_signature", True),
("show_signature_annotations", False),
("signature_crossrefs", False),
- ): external("4370d843cc76*.html"),
+ ): external("d03d16d1919a*.html"),
(
("separate_signature", True),
("show_signature_annotations", True),
("signature_crossrefs", True),
- ): external("261a38d7a86b*.html"),
+ ): external("e412376be64f*.html"),
(
("separate_signature", False),
("show_signature_annotations", True),
@@ -33,12 +33,12 @@
("separate_signature", True),
("show_signature_annotations", True),
("signature_crossrefs", False),
- ): external("f5ce06acbb7a*.html"),
+ ): external("74ee37cd1e94*.html"),
(
("separate_signature", True),
("show_signature_annotations", False),
("signature_crossrefs", True),
- ): external("9c0bfc0ee407*.html"),
+ ): external("4041a38e355f*.html"),
(
("separate_signature", False),
("show_signature_annotations", True),
@@ -353,5 +353,53 @@
("inherited_members", ()),
("members", ()),
): external("a185e216dc7b*.html"),
+ (("filters", "public"), ("inherited_members", ("method1",)), ("members", None)): external("6af55596d9c4*.html"),
+ (("filters", "public"), ("inherited_members", ("method1",)), ("members", False)): external(
+ "6abf5ddd819b*.html",
+ ),
+ (("filters", "public"), ("inherited_members", ()), ("members", None)): external("6d72c524b827*.html"),
+ (("filters", "public"), ("inherited_members", False), ("members", False)): external("9dab67183389*.html"),
+ (("filters", "public"), ("inherited_members", ("method1",)), ("members", True)): external("6c0b7207df03*.html"),
+ (("filters", "public"), ("inherited_members", True), ("members", ())): external("f48d651b3f1a*.html"),
+ (("filters", "public"), ("inherited_members", ("method1",)), ("members", ("module_attribute",))): external(
+ "408244423577*.html",
+ ),
+ (("filters", "public"), ("inherited_members", True), ("members", None)): external("16295fa51a2c*.html"),
+ (("filters", "public"), ("inherited_members", True), ("members", True)): external("37232379c426*.html"),
+ (("filters", "public"), ("inherited_members", ()), ("members", ())): external("2e866eca9a45*.html"),
+ (("filters", "public"), ("inherited_members", True), ("members", False)): external("ed5d07bcdbaa*.html"),
+ (("filters", "public"), ("inherited_members", False), ("members", ())): external("135f57223e00*.html"),
+ (("filters", "public"), ("inherited_members", False), ("members", None)): external("b4e20d5cd52e*.html"),
+ (("filters", "public"), ("inherited_members", ()), ("members", False)): external("46daa7e60b98*.html"),
+ (("filters", "public"), ("inherited_members", False), ("members", True)): external("a255ee80bf7a*.html"),
+ (("filters", "public"), ("inherited_members", ()), ("members", True)): external("74e2496015e1*.html"),
+ (("filters", "public"), ("inherited_members", True), ("members", ("module_attribute",))): external(
+ "e254ae60f9af*.html",
+ ),
+ (("filters", "public"), ("inherited_members", ("method1",)), ("members", ())): external("51d73351dc55*.html"),
+ (("filters", "public"), ("inherited_members", ()), ("members", ("module_attribute",))): external(
+ "d56d3aeae22b*.html",
+ ),
+ (("filters", "public"), ("inherited_members", False), ("members", ("module_attribute",))): external(
+ "80399c502938*.html",
+ ),
+ (("heading", ""), ("members", False), ("separate_signature", False), ("show_if_no_docstring", True)): external(
+ "d1dd339f9260*.html",
+ ),
+ (
+ ("heading", "Some heading"),
+ ("members", False),
+ ("separate_signature", True),
+ ("show_if_no_docstring", True),
+ ): external("480324b25439*.html"),
+ (("heading", ""), ("members", False), ("separate_signature", True), ("show_if_no_docstring", True)): external(
+ "2eef87791b97*.html",
+ ),
+ (
+ ("heading", "Some heading"),
+ ("members", False),
+ ("separate_signature", False),
+ ("show_if_no_docstring", True),
+ ): external("51deee0f00f3*.html"),
},
)
diff --git a/tests/snapshots/external/135f57223e006849dcdd1463367127e4c5ee4aba5f12bde17ab3e494dbeed490.html b/tests/snapshots/external/135f57223e006849dcdd1463367127e4c5ee4aba5f12bde17ab3e494dbeed490.html
new file mode 100644
index 00000000..e8d65a7e
--- /dev/null
+++ b/tests/snapshots/external/135f57223e006849dcdd1463367127e4c5ee4aba5f12bde17ab3e494dbeed490.html
@@ -0,0 +1,22 @@
+
+
+
+ members_package
+
+ + Docstring for the package. +
+
+ members_package
+
+ + Docstring for the package. +
+
+
+ module_attribute
+
+
+ =
+
+
+ 42
+
+
+
+
+
+ module-attribute
+
+
+
+
+ Docstring for
+
+ module_attribute
+
+ .
+
+ Class
+
+
+ Docstring for
+
+ Class
+
+ .
+
+
+ class_attribute
+
+
+ =
+
+
+ 42
+
+
+
+
+
+ class-attribute
+
+
+
+
+ instance-attribute
+
+
+
+
+ Docstring for
+
+ Class.class_attribute
+
+ .
+
+
+ instance_attribute
+
+
+ =
+
+
+ a
+
+
+ +
+
+
+ b
+
+
+
+
+
+ instance-attribute
+
+
+
+
+ Docstring for
+
+ Class.instance_attribute
+
+ .
+
+ NestedClass
+
+
+ Docstring for
+
+ NestedClass
+
+ .
+
+
+ __init__
+
+
+ (
+
+
+ a
+
+
+ ,
+
+
+ b
+
+
+ )
+
+
+
+ Docstring for
+
+ Class.__init__
+
+ .
+
+
+ method1
+
+
+ (
+
+
+ a
+
+
+ ,
+
+
+ b
+
+
+ )
+
+
+
+ Docstring for
+
+ Class.method1
+
+ .
+
+
+ method2
+
+
+ (
+
+
+ a
+
+
+ ,
+
+
+ b
+
+
+ )
+
+
+
+ Docstring for
+
+ Class.method2
+
+ .
+
+ Subclass
+
+
+ Bases:
+
+
+
+ Docstring for
+
+ Subclass
+
+ .
+
+
+ class_attribute
+
+
+ =
+
+
+ 42
+
+
+
+
+
+ class-attribute
+
+
+
+
+ instance-attribute
+
+
+
+
+ Docstring for
+
+ Class.class_attribute
+
+ .
+
+
+ instance_attribute
+
+
+ =
+
+
+ a
+
+
+ +
+
+
+ b
+
+
+
+
+
+ instance-attribute
+
+
+
+
+ Docstring for
+
+ Class.instance_attribute
+
+ .
+
+ NestedClass
+
+
+ Docstring for
+
+ NestedClass
+
+ .
+
+
+ __init__
+
+
+ (
+
+
+ a
+
+
+ ,
+
+
+ b
+
+
+ )
+
+
+
+ Docstring for
+
+ Class.__init__
+
+ .
+
+
+ method1
+
+
+ (
+
+
+ a
+
+
+ ,
+
+
+ b
+
+
+ )
+
+
+
+ Docstring for
+
+ Class.method1
+
+ .
+
+
+ method2
+
+
+ (
+
+
+ a
+
+
+ ,
+
+
+ b
+
+
+ )
+
+
+
+ Docstring for
+
+ Class.method2
+
+ .
+
+
+ module_function
+
+
+ (
+
+
+ a
+
+
+ ,
+
+
+ b
+
+
+ )
+
+
+
+ Docstring for
+
+ module_function
+
+ .
+
+ members_package
+
+ + Docstring for the package. +
+
+ members_package
+
+ + Docstring for the package. +
+
+
+ module_attribute
+
+
+ =
+
+
+ 42
+
+
+
+
+
+ module-attribute
+
+
+
+
+ Docstring for
+
+ module_attribute
+
+ .
+
+ Class
+
+
+ Docstring for
+
+ Class
+
+ .
+
+
+ class_attribute
+
+
+ =
+
+
+ 42
+
+
+
+
+
+ class-attribute
+
+
+
+
+ instance-attribute
+
+
+
+
+ Docstring for
+
+ Class.class_attribute
+
+ .
+
+
+ instance_attribute
+
+
+ =
+
+
+ a
+
+
+ +
+
+
+ b
+
+
+
+
+
+ instance-attribute
+
+
+
+
+ Docstring for
+
+ Class.instance_attribute
+
+ .
+
+ NestedClass
+
+
+ Docstring for
+
+ NestedClass
+
+ .
+
+
+ __init__
+
+
+ (
+
+
+ a
+
+
+ ,
+
+
+ b
+
+
+ )
+
+
+
+ Docstring for
+
+ Class.__init__
+
+ .
+
+
+ method1
+
+
+ (
+
+
+ a
+
+
+ ,
+
+
+ b
+
+
+ )
+
+
+
+ Docstring for
+
+ Class.method1
+
+ .
+
+
+ method2
+
+
+ (
+
+
+ a
+
+
+ ,
+
+
+ b
+
+
+ )
+
+
+
+ Docstring for
+
+ Class.method2
+
+ .
+
+ Subclass
+
+
+ Bases:
+
+
+
+ Docstring for
+
+ Subclass
+
+ .
+
+
+ class_attribute
+
+
+ =
+
+
+ 42
+
+
+
+
+
+ class-attribute
+
+
+
+
+ instance-attribute
+
+
+
+
+ Docstring for
+
+ Class.class_attribute
+
+ .
+
+
+ instance_attribute
+
+
+ =
+
+
+ a
+
+
+ +
+
+
+ b
+
+
+
+
+
+ instance-attribute
+
+
+
+
+ Docstring for
+
+ Class.instance_attribute
+
+ .
+
+ NestedClass
+
+
+ Docstring for
+
+ NestedClass
+
+ .
+
+
+ __init__
+
+
+ (
+
+
+ a
+
+
+ ,
+
+
+ b
+
+
+ )
+
+
+
+ Docstring for
+
+ Class.__init__
+
+ .
+
+
+ method1
+
+
+ (
+
+
+ a
+
+
+ ,
+
+
+ b
+
+
+ )
+
+
+
+ Docstring for
+
+ Class.method1
+
+ .
+
+
+ method2
+
+
+ (
+
+
+ a
+
+
+ ,
+
+
+ b
+
+
+ )
+
+
+
+ Docstring for
+
+ Class.method2
+
+ .
+
+
+ module_function
+
+
+ (
+
+
+ a
+
+
+ ,
+
+
+ b
+
+
+ )
+
+
+
+ Docstring for
+
+ module_function
+
+ .
+
__init__(a, b)
+ __init__(a, b)
+ members_package
+
+ + Docstring for the package. +
+
+
+ module_attribute
+
+
+ =
+
+
+ 42
+
+
+
+
+
+ module-attribute
+
+
+
+
+ Docstring for
+
+ module_attribute
+
+ .
+
+ members_package
+
+ + Docstring for the package. +
+
+ members_package
+
+ + Docstring for the package. +
+
+ members_package
+
+ + Docstring for the package. +
+
+ members_package
+
+ + Docstring for the package. +
+
+
+ module_attribute
+
+
+ =
+
+
+ 42
+
+
+
+
+
+ module-attribute
+
+
+
+
+ Docstring for
+
+ module_attribute
+
+ .
+
+ Class
+
+
+ Docstring for
+
+ Class
+
+ .
+
+
+ class_attribute
+
+
+ =
+
+
+ 42
+
+
+
+
+
+ class-attribute
+
+
+
+
+ instance-attribute
+
+
+
+
+ Docstring for
+
+ Class.class_attribute
+
+ .
+
+
+ instance_attribute
+
+
+ =
+
+
+ a
+
+
+ +
+
+
+ b
+
+
+
+
+
+ instance-attribute
+
+
+
+
+ Docstring for
+
+ Class.instance_attribute
+
+ .
+
+ NestedClass
+
+
+ Docstring for
+
+ NestedClass
+
+ .
+
+
+ __init__
+
+
+ (
+
+
+ a
+
+
+ ,
+
+
+ b
+
+
+ )
+
+
+
+ Docstring for
+
+ Class.__init__
+
+ .
+
+
+ method1
+
+
+ (
+
+
+ a
+
+
+ ,
+
+
+ b
+
+
+ )
+
+
+
+ Docstring for
+
+ Class.method1
+
+ .
+
+
+ method2
+
+
+ (
+
+
+ a
+
+
+ ,
+
+
+ b
+
+
+ )
+
+
+
+ Docstring for
+
+ Class.method2
+
+ .
+
+ Subclass
+
+
+ Bases:
+
+
+
+ Docstring for
+
+ Subclass
+
+ .
+
+
+ method1
+
+
+ (
+
+
+ a
+
+
+ ,
+
+
+ b
+
+
+ )
+
+
+
+ Docstring for
+
+ Class.method1
+
+ .
+
+
+ module_function
+
+
+ (
+
+
+ a
+
+
+ ,
+
+
+ b
+
+
+ )
+
+
+
+ Docstring for
+
+ module_function
+
+ .
+
+ members_package
+
+ + Docstring for the package. +
+
+
+ module_attribute
+
+
+ =
+
+
+ 42
+
+
+
+
+
+ module-attribute
+
+
+
+
+ Docstring for
+
+ module_attribute
+
+ .
+
+ Class
+
+
+ Docstring for
+
+ Class
+
+ .
+
+
+ class_attribute
+
+
+ =
+
+
+ 42
+
+
+
+
+
+ class-attribute
+
+
+
+
+ instance-attribute
+
+
+
+
+ Docstring for
+
+ Class.class_attribute
+
+ .
+
+
+ instance_attribute
+
+
+ =
+
+
+ a
+
+
+ +
+
+
+ b
+
+
+
+
+
+ instance-attribute
+
+
+
+
+ Docstring for
+
+ Class.instance_attribute
+
+ .
+
+ NestedClass
+
+
+ Docstring for
+
+ NestedClass
+
+ .
+
+
+ __init__
+
+
+ (
+
+
+ a
+
+
+ ,
+
+
+ b
+
+
+ )
+
+
+
+ Docstring for
+
+ Class.__init__
+
+ .
+
+
+ method1
+
+
+ (
+
+
+ a
+
+
+ ,
+
+
+ b
+
+
+ )
+
+
+
+ Docstring for
+
+ Class.method1
+
+ .
+
+
+ method2
+
+
+ (
+
+
+ a
+
+
+ ,
+
+
+ b
+
+
+ )
+
+
+
+ Docstring for
+
+ Class.method2
+
+ .
+
+ Subclass
+
+
+ Bases:
+
+
+
+ Docstring for
+
+ Subclass
+
+ .
+
+
+ method1
+
+
+ (
+
+
+ a
+
+
+ ,
+
+
+ b
+
+
+ )
+
+
+
+ Docstring for
+
+ Class.method1
+
+ .
+
+
+ module_function
+
+
+ (
+
+
+ a
+
+
+ ,
+
+
+ b
+
+
+ )
+
+
+
+ Docstring for
+
+ module_function
+
+ .
+
+ members_package
+
+ + Docstring for the package. +
+
+
+ module_attribute
+
+
+ =
+
+
+ 42
+
+
+
+
+
+ module-attribute
+
+
+
+
+ Docstring for
+
+ module_attribute
+
+ .
+
+ Class
+
+
+ Docstring for
+
+ Class
+
+ .
+
+
+ class_attribute
+
+
+ =
+
+
+ 42
+
+
+
+
+
+ class-attribute
+
+
+
+
+ instance-attribute
+
+
+
+
+ Docstring for
+
+ Class.class_attribute
+
+ .
+
+
+ instance_attribute
+
+
+ =
+
+
+ a
+
+
+ +
+
+
+ b
+
+
+
+
+
+ instance-attribute
+
+
+
+
+ Docstring for
+
+ Class.instance_attribute
+
+ .
+
+ NestedClass
+
+
+ Docstring for
+
+ NestedClass
+
+ .
+
+
+ __init__
+
+
+ (
+
+
+ a
+
+
+ ,
+
+
+ b
+
+
+ )
+
+
+
+ Docstring for
+
+ Class.__init__
+
+ .
+
+
+ method1
+
+
+ (
+
+
+ a
+
+
+ ,
+
+
+ b
+
+
+ )
+
+
+
+ Docstring for
+
+ Class.method1
+
+ .
+
+
+ method2
+
+
+ (
+
+
+ a
+
+
+ ,
+
+
+ b
+
+
+ )
+
+
+
+ Docstring for
+
+ Class.method2
+
+ .
+
+ Subclass
+
+
+ Bases:
+
+
+
+ Docstring for
+
+ Subclass
+
+ .
+
+
+ module_function
+
+
+ (
+
+
+ a
+
+
+ ,
+
+
+ b
+
+
+ )
+
+
+
+ Docstring for
+
+ module_function
+
+ .
+
+ members_package
+
+ + Docstring for the package. +
+
+
+ module_attribute
+
+
+ =
+
+
+ 42
+
+
+
+
+
+ module-attribute
+
+
+
+
+ Docstring for
+
+ module_attribute
+
+ .
+
+ Class
+
+
+ Docstring for
+
+ Class
+
+ .
+
+
+ class_attribute
+
+
+ =
+
+
+ 42
+
+
+
+
+
+ class-attribute
+
+
+
+
+ instance-attribute
+
+
+
+
+ Docstring for
+
+ Class.class_attribute
+
+ .
+
+
+ instance_attribute
+
+
+ =
+
+
+ a
+
+
+ +
+
+
+ b
+
+
+
+
+
+ instance-attribute
+
+
+
+
+ Docstring for
+
+ Class.instance_attribute
+
+ .
+
+ NestedClass
+
+
+ Docstring for
+
+ NestedClass
+
+ .
+
+
+ __init__
+
+
+ (
+
+
+ a
+
+
+ ,
+
+
+ b
+
+
+ )
+
+
+
+ Docstring for
+
+ Class.__init__
+
+ .
+
+
+ method1
+
+
+ (
+
+
+ a
+
+
+ ,
+
+
+ b
+
+
+ )
+
+
+
+ Docstring for
+
+ Class.method1
+
+ .
+
+
+ method2
+
+
+ (
+
+
+ a
+
+
+ ,
+
+
+ b
+
+
+ )
+
+
+
+ Docstring for
+
+ Class.method2
+
+ .
+
+ Subclass
+
+
+ Bases:
+
+
+
+ Docstring for
+
+ Subclass
+
+ .
+
+
+ module_function
+
+
+ (
+
+
+ a
+
+
+ ,
+
+
+ b
+
+
+ )
+
+
+
+ Docstring for
+
+ module_function
+
+ .
+
__init__(a: int, b: str) -> None
+ __init__(a: int, b: str) -> None
+ members_package
+
+ + Docstring for the package. +
+
+
+ module_attribute
+
+
+ =
+
+
+ 42
+
+
+
+
+
+ module-attribute
+
+
+
+
+ Docstring for
+
+ module_attribute
+
+ .
+
+ members_package
+
+ + Docstring for the package. +
+
+ members_package
+
+ + Docstring for the package. +
+
+
+ module_attribute
+
+
+ =
+
+
+ 42
+
+
+
+
+
+ module-attribute
+
+
+
+
+ Docstring for
+
+ module_attribute
+
+ .
+
+ Class
+
+
+ Docstring for
+
+ Class
+
+ .
+
+
+ class_attribute
+
+
+ =
+
+
+ 42
+
+
+
+
+
+ class-attribute
+
+
+
+
+ instance-attribute
+
+
+
+
+ Docstring for
+
+ Class.class_attribute
+
+ .
+
+
+ instance_attribute
+
+
+ =
+
+
+ a
+
+
+ +
+
+
+ b
+
+
+
+
+
+ instance-attribute
+
+
+
+
+ Docstring for
+
+ Class.instance_attribute
+
+ .
+
+ NestedClass
+
+
+ Docstring for
+
+ NestedClass
+
+ .
+
+
+ __init__
+
+
+ (
+
+
+ a
+
+
+ ,
+
+
+ b
+
+
+ )
+
+
+
+ Docstring for
+
+ Class.__init__
+
+ .
+
+
+ method1
+
+
+ (
+
+
+ a
+
+
+ ,
+
+
+ b
+
+
+ )
+
+
+
+ Docstring for
+
+ Class.method1
+
+ .
+
+
+ method2
+
+
+ (
+
+
+ a
+
+
+ ,
+
+
+ b
+
+
+ )
+
+
+
+ Docstring for
+
+ Class.method2
+
+ .
+
+ Subclass
+
+
+ Bases:
+
+
+
+ Docstring for
+
+ Subclass
+
+ .
+
+
+ module_function
+
+
+ (
+
+
+ a
+
+
+ ,
+
+
+ b
+
+
+ )
+
+
+
+ Docstring for
+
+ module_function
+
+ .
+
+ members_package
+
+ + Docstring for the package. +
+
+
+ module_attribute
+
+
+ =
+
+
+ 42
+
+
+
+
+
+ module-attribute
+
+
+
+
+ Docstring for
+
+ module_attribute
+
+ .
+
+ Class
+
+
+ Docstring for
+
+ Class
+
+ .
+
+
+ class_attribute
+
+
+ =
+
+
+ 42
+
+
+
+
+
+ class-attribute
+
+
+
+
+ instance-attribute
+
+
+
+
+ Docstring for
+
+ Class.class_attribute
+
+ .
+
+
+ instance_attribute
+
+
+ =
+
+
+ a
+
+
+ +
+
+
+ b
+
+
+
+
+
+ instance-attribute
+
+
+
+
+ Docstring for
+
+ Class.instance_attribute
+
+ .
+
+ NestedClass
+
+
+ Docstring for
+
+ NestedClass
+
+ .
+
+
+ __init__
+
+
+ (
+
+
+ a
+
+
+ ,
+
+
+ b
+
+
+ )
+
+
+
+ Docstring for
+
+ Class.__init__
+
+ .
+
+
+ method1
+
+
+ (
+
+
+ a
+
+
+ ,
+
+
+ b
+
+
+ )
+
+
+
+ Docstring for
+
+ Class.method1
+
+ .
+
+
+ method2
+
+
+ (
+
+
+ a
+
+
+ ,
+
+
+ b
+
+
+ )
+
+
+
+ Docstring for
+
+ Class.method2
+
+ .
+
+ Subclass
+
+
+ Bases:
+
+
+
+ Docstring for
+
+ Subclass
+
+ .
+
+
+ module_function
+
+
+ (
+
+
+ a
+
+
+ ,
+
+
+ b
+
+
+ )
+
+
+
+ Docstring for
+
+ module_function
+
+ .
+
__init__(a, b)
+ __init__(a, b)
+ headings_package
+
+
+ members_package
+
+ + Docstring for the package. +
+
+
+ module_attribute
+
+
+ =
+
+
+ 42
+
+
+
+
+
+ module-attribute
+
+
+
+
+ Docstring for
+
+ module_attribute
+
+ .
+
+ members_package
+
+ + Docstring for the package. +
+
+
+ module_attribute
+
+
+ =
+
+
+ 42
+
+
+
+
+
+ module-attribute
+
+
+
+
+ Docstring for
+
+ module_attribute
+
+ .
+
__init__(a: int , b: str ) -> None
+ __init__(a: int , b: str ) -> None
+ members_package
+
+ + Docstring for the package. +
+
+ members_package
+
+ + Docstring for the package. +
+