mkdocstrings-python 1.5.0__py3-none-any.whl → 1.5.2__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -357,11 +357,17 @@ class PythonHandler(BaseHandler):
357
357
  self.env.filters["get_template"] = rendering.do_get_template
358
358
  self.env.tests["existing_template"] = lambda template_name: template_name in self.env.list_templates()
359
359
 
360
- def get_anchors(self, data: CollectorItem) -> set[str]: # noqa: D102 (ignore missing docstring)
360
+ def get_anchors(self, data: CollectorItem) -> tuple[str, ...]: # noqa: D102 (ignore missing docstring)
361
+ anchors = [data.path]
361
362
  try:
362
- return {data.path, data.canonical_path, *data.aliases}
363
+ if data.canonical_path != data.path:
364
+ anchors.append(data.canonical_path)
365
+ for anchor in data.aliases:
366
+ if anchor not in anchors:
367
+ anchors.append(anchor)
363
368
  except AliasResolutionError:
364
- return {data.path}
369
+ return tuple(anchors)
370
+ return tuple(anchors)
365
371
 
366
372
 
367
373
  def get_handler(
@@ -13,6 +13,8 @@
13
13
  {% set show_full_path = config.show_object_full_path %}
14
14
  {% endif %}
15
15
 
16
+ {% set attribute_name = attribute.path if show_full_path else attribute.name %}
17
+
16
18
  {% if not root or config.show_root_heading %}
17
19
 
18
20
  {% filter heading(heading_level,
@@ -23,11 +25,10 @@
23
25
 
24
26
  {% block heading scoped %}
25
27
  {% if config.separate_signature %}
26
- <span class="doc doc-object-name doc-attribute-name">{% if show_full_path %}{{ attribute.path }}{% else %}{{ attribute.name }}{% endif %}</span>
28
+ <span class="doc doc-object-name doc-attribute-name">{{ attribute_name }}</span>
27
29
  {% else %}
28
- {% filter highlight(language="python", inline=True) %}
29
- {% if show_full_path %}{{ attribute.path }}{% else %}{{ attribute.name }}{% endif %}
30
- {% if attribute.annotation %}: {{ attribute.annotation }}{% endif %}
30
+ {%+ filter highlight(language="python", inline=True) %}
31
+ {{ attribute_name }}{% if attribute.annotation %}: {{ attribute.annotation }}{% endif %}
31
32
  {% if attribute.value %} = {{ attribute.value }}{% endif %}
32
33
  {% endfilter %}
33
34
  {% endif %}
@@ -45,8 +46,7 @@
45
46
  {% if config.separate_signature %}
46
47
  {% filter highlight(language="python", inline=False) %}
47
48
  {% filter format_code(config.line_length) %}
48
- {% if show_full_path %}{{ attribute.path }}{% else %}{{ attribute.name }}{% endif %}
49
- {% if attribute.annotation %}: {{ attribute.annotation|safe }}{% endif %}
49
+ {{ attribute.name }}{% if attribute.annotation %}: {{ attribute.annotation|safe }}{% endif %}
50
50
  {% if attribute.value %} = {{ attribute.value|safe }}{% endif %}
51
51
  {% endfilter %}
52
52
  {% endfilter %}
@@ -58,7 +58,7 @@
58
58
  {% filter heading(heading_level,
59
59
  role="data" if attribute.parent.kind.value == "module" else "attr",
60
60
  id=html_id,
61
- toc_label=attribute.path if config.show_root_full_path else attribute.name,
61
+ toc_label=attribute.name,
62
62
  hidden=True) %}
63
63
  {% endfilter %}
64
64
  {% endif %}
@@ -31,7 +31,7 @@
31
31
  {% endif %}
32
32
  {% with heading_level = heading_level + extra_level %}
33
33
  {% for attribute in attributes|order_members(config.members_order, members_list) %}
34
- {% if not attribute.is_alias or attribute.is_explicitely_exported or attribute.inherited %}
34
+ {% if members_list is not none or attribute.is_public(check_name=False) %}
35
35
  {% include attribute|get_template with context %}
36
36
  {% endif %}
37
37
  {% endfor %}
@@ -51,7 +51,7 @@
51
51
  {% endif %}
52
52
  {% with heading_level = heading_level + extra_level %}
53
53
  {% for class in classes|order_members(config.members_order, members_list) %}
54
- {% if not class.is_alias or class.is_explicitely_exported or class.inherited %}
54
+ {% if members_list is not none or class.is_public(check_name=False) %}
55
55
  {% include class|get_template with context %}
56
56
  {% endif %}
57
57
  {% endfor %}
@@ -72,7 +72,7 @@
72
72
  {% with heading_level = heading_level + extra_level %}
73
73
  {% for function in functions|order_members(config.members_order, members_list) %}
74
74
  {% if not (obj.kind.value == "class" and function.name == "__init__" and config.merge_init_into_class) %}
75
- {% if not function.is_alias or function.is_explicitely_exported or function.inherited %}
75
+ {% if members_list is not none or function.is_public(check_name=False) %}
76
76
  {% include function|get_template with context %}
77
77
  {% endif %}
78
78
  {% endif %}
@@ -93,8 +93,8 @@
93
93
  {% filter heading(heading_level, id=html_id ~ "-modules") %}Modules{% endfilter %}
94
94
  {% endif %}
95
95
  {% with heading_level = heading_level + extra_level %}
96
- {% for module in modules|order_members(config.members_order, members_list) %}
97
- {% if not module.is_alias or module.is_explicitely_exported or module.inherited %}
96
+ {% for module in modules|order_members(config.members_order.alphabetical, members_list) %}
97
+ {% if members_list is not none or module.is_public(check_name=False) %}
98
98
  {% include module|get_template with context %}
99
99
  {% endif %}
100
100
  {% endfor %}
@@ -119,7 +119,7 @@
119
119
 
120
120
  {% if not (obj.is_class and child.name == "__init__" and config.merge_init_into_class) %}
121
121
 
122
- {% if not child.is_alias or child.is_explicitely_exported or child.inherited %}
122
+ {% if members_list is not none or child.is_public(check_name=False) %}
123
123
  {% if child.is_attribute %}
124
124
  {% with attribute = child %}
125
125
  {% include attribute|get_template with context %}
@@ -13,6 +13,8 @@
13
13
  {% set show_full_path = config.show_object_full_path %}
14
14
  {% endif %}
15
15
 
16
+ {% set class_name = class.path if show_full_path else class.name %}
17
+
16
18
  {% if not root or config.show_root_heading %}
17
19
 
18
20
  {% filter heading(heading_level,
@@ -23,16 +25,15 @@
23
25
 
24
26
  {% block heading scoped %}
25
27
  {% if config.separate_signature %}
26
- <span class="doc doc-object-name doc-class-name">{% if show_full_path %}{{ class.path }}{% else %}{{ class.name }}{% endif %}</span>
27
- {% elif config.merge_init_into_class and "__init__" in class.members -%}
28
- {%- with function = class.members["__init__"] -%}
29
- {%- filter highlight(language="python", inline=True) -%}
30
- {% if show_full_path %}{{ class.path }}{% else %}{{ class.name }}{% endif %}
31
- {%- include "signature.html" with context -%}
32
- {%- endfilter -%}
33
- {%- endwith -%}
28
+ <span class="doc doc-object-name doc-class-name">{{ class_name }}</span>
29
+ {% elif config.merge_init_into_class and "__init__" in class.members %}
30
+ {% with function = class.members["__init__"] %}
31
+ {%+ filter highlight(language="python", inline=True) %}
32
+ {{ class_name }}{% include "signature.html" with context %}
33
+ {% endfilter %}
34
+ {% endwith %}
34
35
  {% else %}
35
- <code>{% if show_full_path %}{{ class.path }}{% else %}{{ class.name }}{% endif %}</code>
36
+ <code>{{ class_name }}</code>
36
37
  {% endif %}
37
38
  {% endblock heading %}
38
39
 
@@ -49,7 +50,7 @@
49
50
  {% if "__init__" in class.members %}
50
51
  {% with function = class.members["__init__"] %}
51
52
  {% filter format_signature(function, config.line_length, crossrefs=config.signature_crossrefs) %}
52
- {% if show_full_path %}{{ class.path }}{% else %}{{ class.name }}{% endif %}
53
+ {{ class.name }}
53
54
  {% endfilter %}
54
55
  {% endwith %}
55
56
  {% endif %}
@@ -61,7 +62,7 @@
61
62
  {% filter heading(heading_level,
62
63
  role="class",
63
64
  id=html_id,
64
- toc_label=class.path if config.show_root_full_path else class.name,
65
+ toc_label=class.name,
65
66
  hidden=True) %}
66
67
  {% endfilter %}
67
68
  {% endif %}
@@ -112,11 +113,9 @@
112
113
  {% endblock source %}
113
114
 
114
115
  {% block children scoped %}
115
- {% with obj = class %}
116
- {% set root = False %}
117
- {% set heading_level = heading_level + 1 %}
118
- {% include "children.html" with context %}
119
- {% endwith %}
116
+ {% set root = False %}
117
+ {% set heading_level = heading_level + 1 %}
118
+ {% include "children.html" with context %}
120
119
  {% endblock children %}
121
120
  {% endblock contents %}
122
121
  </div>
@@ -15,6 +15,8 @@
15
15
  {% set show_full_path = config.show_object_full_path %}
16
16
  {% endif %}
17
17
 
18
+ {% set function_name = function.path if show_full_path else function.name %}
19
+
18
20
  {% if not root or config.show_root_heading %}
19
21
 
20
22
  {% filter heading(heading_level,
@@ -25,11 +27,10 @@
25
27
 
26
28
  {% block heading scoped %}
27
29
  {% if config.separate_signature %}
28
- <span class="doc doc-object-name doc-function-name">{% if show_full_path %}{{ function.path }}{% else %}{{ function.name }}{% endif %}</span>
30
+ <span class="doc doc-object-name doc-function-name">{{ function_name }}</span>
29
31
  {% else %}
30
- {% filter highlight(language="python", inline=True) %}
31
- {% if show_full_path %}{{ function.path }}{% else %}{{ function.name }}{% endif %}
32
- {% include "signature.html" with context %}
32
+ {%+ filter highlight(language="python", inline=True) %}
33
+ {{ function_name }}{% include "signature.html" with context %}
33
34
  {% endfilter %}
34
35
  {% endif %}
35
36
  {% endblock heading %}
@@ -45,7 +46,7 @@
45
46
  {% block signature scoped %}
46
47
  {% if config.separate_signature %}
47
48
  {% filter format_signature(function, config.line_length, crossrefs=config.signature_crossrefs) %}
48
- {% if show_full_path %}{{ function.path }}{% else %}{{ function.name }}{% endif %}
49
+ {{ function.name }}
49
50
  {% endfilter %}
50
51
  {% endif %}
51
52
  {% endblock signature %}
@@ -55,7 +56,7 @@
55
56
  {% filter heading(heading_level,
56
57
  role="function",
57
58
  id=html_id,
58
- toc_label=function.path if config.show_root_full_path else function.name,
59
+ toc_label=function.name,
59
60
  hidden=True) %}
60
61
  {% endfilter %}
61
62
  {% endif %}
@@ -13,6 +13,8 @@
13
13
  {% set show_full_path = config.show_object_full_path %}
14
14
  {% endif %}
15
15
 
16
+ {% set module_name = module.path if show_full_path else module.name %}
17
+
16
18
  {% if not root or config.show_root_heading %}
17
19
 
18
20
  {% filter heading(heading_level,
@@ -22,13 +24,11 @@
22
24
  toc_label=module.name) %}
23
25
 
24
26
  {% block heading scoped %}
25
- {% with module_name = module.path if show_full_path else module.name %}
26
- {% if config.separate_signature %}
27
- <span class="doc doc-object-name doc-module-name">{{ module_name }}</span>
28
- {% else %}
29
- <code>{{ module_name }}</code>
30
- {% endif %}
31
- {% endwith %}
27
+ {% if config.separate_signature %}
28
+ <span class="doc doc-object-name doc-module-name">{{ module_name }}</span>
29
+ {% else %}
30
+ <code>{{ module_name }}</code>
31
+ {% endif %}
32
32
  {% endblock heading %}
33
33
 
34
34
  {% block labels scoped %}
@@ -44,7 +44,7 @@
44
44
  {% filter heading(heading_level,
45
45
  role="module",
46
46
  id=html_id,
47
- toc_label=module.path if config.show_root_full_path else module.name,
47
+ toc_label=module.name,
48
48
  hidden=True) %}
49
49
  {% endfilter %}
50
50
  {% endif %}
@@ -60,11 +60,9 @@
60
60
  {% endblock docstring %}
61
61
 
62
62
  {% block children scoped %}
63
- {% with obj = module %}
64
- {% set root = False %}
65
- {% set heading_level = heading_level + 1 %}
66
- {% include "children.html" with context %}
67
- {% endwith %}
63
+ {% set root = False %}
64
+ {% set heading_level = heading_level + 1 %}
65
+ {% include "children.html" with context %}
68
66
  {% endblock children %}
69
67
  {% endblock contents %}
70
68
  </div>
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: mkdocstrings-python
3
- Version: 1.5.0
3
+ Version: 1.5.2
4
4
  Summary: A Python handler for mkdocstrings.
5
5
  Author-Email: Timothée Mazzucotelli <pawamoy@pm.me>
6
6
  License: ISC
@@ -29,7 +29,7 @@ Project-URL: Gitter, https://gitter.im/mkdocstrings/python
29
29
  Project-URL: Funding, https://github.com/sponsors/pawamoy
30
30
  Requires-Python: >=3.8
31
31
  Requires-Dist: mkdocstrings>=0.20
32
- Requires-Dist: griffe>=0.33
32
+ Requires-Dist: griffe>=0.35
33
33
  Description-Content-Type: text/markdown
34
34
 
35
35
  <h1 align="center">mkdocstrings-python</h1>
@@ -1,10 +1,10 @@
1
1
  mkdocstrings_handlers/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
2
  mkdocstrings_handlers/python/__init__.py,sha256=CJT3hmg9HpEMy5dbq2jL3Y8unO6UOHND7yCLojwQrS8,326
3
- mkdocstrings_handlers/python/handler.py,sha256=gMuyfeOWrevqoD2Cgs8PGp0LadapbSoUBds7NTScDKc,19582
3
+ mkdocstrings_handlers/python/handler.py,sha256=wUZhlInw77toU91Bh5uIahRFJjTyz98wGQyom2ER7I0,19811
4
4
  mkdocstrings_handlers/python/rendering.py,sha256=0yeasP9WoIcxVLOxPB7h1KXg7-BX4YQywsZIKNsaz0o,9935
5
- mkdocstrings_handlers/python/templates/material/_base/attribute.html,sha256=qjhl1jOqoDWqzM7lG6NupsNYKrfIWCwJpedFAtMhsss,2913
6
- mkdocstrings_handlers/python/templates/material/_base/children.html,sha256=PFMxAdBydTlODlmG1tKv153YdJfO3YrofI5gFl8rvHI,5757
7
- mkdocstrings_handlers/python/templates/material/_base/class.html,sha256=Tk4htRqL04ptK3TJt13Jm-zj7CnFxk6D4TXFpmnTkek,4778
5
+ mkdocstrings_handlers/python/templates/material/_base/attribute.html,sha256=NRJHrn8uNXFPiCTBIkKOCfCZD2gwOioDLuhaDvopEsI,2729
6
+ mkdocstrings_handlers/python/templates/material/_base/children.html,sha256=8z5dQ2HOywV7CQ3KYYgdBX8N-CGbnYZ8Sm7ugN89IIo,5709
7
+ mkdocstrings_handlers/python/templates/material/_base/class.html,sha256=OQATi6Zz0Vg34ONWwh6mimGdeHd2s0VqxulyrLMMzq8,4479
8
8
  mkdocstrings_handlers/python/templates/material/_base/docstring.html,sha256=Sw8TwJy4aTZA2phqqg61QVAZDfLYJAzgE_lQmDcdUsU,2163
9
9
  mkdocstrings_handlers/python/templates/material/_base/docstring/admonition.html,sha256=wiD2FtMnGrFMZJDilURnNqzIu8bOR0zcMErUVUqbDPo,274
10
10
  mkdocstrings_handlers/python/templates/material/_base/docstring/attributes.html,sha256=bP30_K01q1Gv01MQtNZj64xDsWtbx5pe0rbgrU3v0EY,2827
@@ -20,12 +20,12 @@ mkdocstrings_handlers/python/templates/material/_base/docstring/returns.html,sha
20
20
  mkdocstrings_handlers/python/templates/material/_base/docstring/warns.html,sha256=FROLXo9Xd97TlpokL0YZC1kZ08QRL5bIm8_QnFtrBNQ,2453
21
21
  mkdocstrings_handlers/python/templates/material/_base/docstring/yields.html,sha256=88889AhtqFnTiSezyNpArL5rq5HxDY3GjdMJL3JpBdU,3430
22
22
  mkdocstrings_handlers/python/templates/material/_base/expression.html,sha256=CvZ_bhNT2RbEDWfW9KmcA_WIJHMC_Kh_4rzqHpGthbU,1719
23
- mkdocstrings_handlers/python/templates/material/_base/function.html,sha256=sGZ9qirStTv_bE6I2bP-33oz5stnBOa3LpRc5Ppi3QQ,2957
23
+ mkdocstrings_handlers/python/templates/material/_base/function.html,sha256=7f_RhIvsWa9KNDrg5Dgj8XX0_ltAv629EybAX-yQ2p0,2787
24
24
  mkdocstrings_handlers/python/templates/material/_base/labels.html,sha256=QMO1lrs1smktTGvkDZabvJZFQpMp_nSoM8JBt-tAcu8,250
25
25
  mkdocstrings_handlers/python/templates/material/_base/languages/en.html,sha256=u0j9TIPh18qHEI4bzlGlwu4IX95EPIi0Q3AaDi6D58I,966
26
26
  mkdocstrings_handlers/python/templates/material/_base/languages/ja.html,sha256=Az63fFTq4MIr65DjufCh8GYujB0-CiAJFDVVW9mCGtQ,984
27
27
  mkdocstrings_handlers/python/templates/material/_base/languages/zh.html,sha256=oPB3-fnOdmdGdrnRZUgXw6zuQGlF-aq5Bbkm1zF4xgA,902
28
- mkdocstrings_handlers/python/templates/material/_base/module.html,sha256=dkGP8Ha8ivdNSL2B-eTAteGrXWS1GDQRjW95qQlQVpw,2230
28
+ mkdocstrings_handlers/python/templates/material/_base/module.html,sha256=OrQb5_CfpQno9TJeVkHdz0Dp_DrXXKFW7sVRflsw-mI,2085
29
29
  mkdocstrings_handlers/python/templates/material/_base/signature.html,sha256=tW7V8nc1Ojan0BrehKDeN4irmRivR0Kfv0C8fPzyhuw,2790
30
30
  mkdocstrings_handlers/python/templates/material/attribute.html,sha256=Zbo0SMrqjdlUhXunXpy_VENWITviBDLt8UBdF5EnVb0,37
31
31
  mkdocstrings_handlers/python/templates/material/children.html,sha256=xLnVaXevA0HRffVdOK0INULbekvbOYV9vKQ_zXBLyK0,36
@@ -67,7 +67,7 @@ mkdocstrings_handlers/python/templates/readthedocs/languages/en.html,sha256=bhfj
67
67
  mkdocstrings_handlers/python/templates/readthedocs/languages/ja.html,sha256=ULdcRwrN9rF8shxFVwEZ1jqSICebVKMi8cYHpNZypd8,372
68
68
  mkdocstrings_handlers/python/templates/readthedocs/languages/zh.html,sha256=ZYm9N33cRC4Z66-ZqmteWDfRNfo8hKe25Bz4ijVk22A,359
69
69
  mkdocstrings_handlers/python/templates/readthedocs/style.css,sha256=Ds8vF1rSxc2B0c4P10osx4cqXHWMntcSCxmRfX-nfzw,971
70
- mkdocstrings_python-1.5.0.dist-info/METADATA,sha256=6Dco86Y-fiWO05OmOtm3j_y_Mhksb9SM3iiWVPLdWlo,5748
71
- mkdocstrings_python-1.5.0.dist-info/WHEEL,sha256=bbAwydobi_oZ_0rI4gBBovxINCqHVHcC26TV6S2A2Io,90
72
- mkdocstrings_python-1.5.0.dist-info/licenses/LICENSE,sha256=JGb4pdPEM8TTjjhr-uNCO7oXkiVrwG5Pz0JamcjNF_s,754
73
- mkdocstrings_python-1.5.0.dist-info/RECORD,,
70
+ mkdocstrings_python-1.5.2.dist-info/METADATA,sha256=ut3Q6j_NAFbkxubc9oRv1lw2F7zLSgVgaRswxvz_uw4,5748
71
+ mkdocstrings_python-1.5.2.dist-info/WHEEL,sha256=bbAwydobi_oZ_0rI4gBBovxINCqHVHcC26TV6S2A2Io,90
72
+ mkdocstrings_python-1.5.2.dist-info/licenses/LICENSE,sha256=JGb4pdPEM8TTjjhr-uNCO7oXkiVrwG5Pz0JamcjNF_s,754
73
+ mkdocstrings_python-1.5.2.dist-info/RECORD,,