griffe 2.2.0__tar.gz → 2.3.0__tar.gz

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.
Files changed (117) hide show
  1. {griffe-2.2.0 → griffe-2.3.0}/CHANGELOG.md +34 -0
  2. {griffe-2.2.0 → griffe-2.3.0}/PKG-INFO +4 -4
  3. {griffe-2.2.0 → griffe-2.3.0}/docs/guide/users/loading.md +28 -0
  4. {griffe-2.2.0 → griffe-2.3.0}/.gitignore +0 -0
  5. {griffe-2.2.0 → griffe-2.3.0}/CODE_OF_CONDUCT.md +0 -0
  6. {griffe-2.2.0 → griffe-2.3.0}/CONTRIBUTING.md +0 -0
  7. {griffe-2.2.0 → griffe-2.3.0}/LICENSE +0 -0
  8. {griffe-2.2.0 → griffe-2.3.0}/README.md +0 -0
  9. {griffe-2.2.0 → griffe-2.3.0}/config/coverage.ini +0 -0
  10. {griffe-2.2.0 → griffe-2.3.0}/config/git-changelog.toml +0 -0
  11. {griffe-2.2.0 → griffe-2.3.0}/config/pytest.ini +0 -0
  12. {griffe-2.2.0 → griffe-2.3.0}/config/ruff.toml +0 -0
  13. {griffe-2.2.0 → griffe-2.3.0}/config/ty.toml +0 -0
  14. {griffe-2.2.0 → griffe-2.3.0}/config/vscode/launch.json +0 -0
  15. {griffe-2.2.0 → griffe-2.3.0}/config/vscode/settings.json +0 -0
  16. {griffe-2.2.0 → griffe-2.3.0}/config/vscode/tasks.json +0 -0
  17. {griffe-2.2.0 → griffe-2.3.0}/docs/.overrides/main.html +0 -0
  18. {griffe-2.2.0 → griffe-2.3.0}/docs/.overrides/partials/comments.html +0 -0
  19. {griffe-2.2.0 → griffe-2.3.0}/docs/.overrides/partials/path-item.html +0 -0
  20. {griffe-2.2.0 → griffe-2.3.0}/docs/alternatives.md +0 -0
  21. {griffe-2.2.0 → griffe-2.3.0}/docs/changelog.md +0 -0
  22. {griffe-2.2.0 → griffe-2.3.0}/docs/code-of-conduct.md +0 -0
  23. {griffe-2.2.0 → griffe-2.3.0}/docs/community.md +0 -0
  24. {griffe-2.2.0 → griffe-2.3.0}/docs/contributing.md +0 -0
  25. {griffe-2.2.0 → griffe-2.3.0}/docs/credits.md +0 -0
  26. {griffe-2.2.0 → griffe-2.3.0}/docs/css/custom.css +0 -0
  27. {griffe-2.2.0 → griffe-2.3.0}/docs/css/material.css +0 -0
  28. {griffe-2.2.0 → griffe-2.3.0}/docs/css/mkdocstrings.css +0 -0
  29. {griffe-2.2.0 → griffe-2.3.0}/docs/downstream-projects.md +0 -0
  30. {griffe-2.2.0 → griffe-2.3.0}/docs/extensions/built-in/dataclasses.md +0 -0
  31. {griffe-2.2.0 → griffe-2.3.0}/docs/extensions/built-in/unpack-typeddict.md +0 -0
  32. {griffe-2.2.0 → griffe-2.3.0}/docs/extensions/built-in.md +0 -0
  33. {griffe-2.2.0 → griffe-2.3.0}/docs/extensions/official/autodocstringstyle.md +0 -0
  34. {griffe-2.2.0 → griffe-2.3.0}/docs/extensions/official/inherited-docstrings.md +0 -0
  35. {griffe-2.2.0 → griffe-2.3.0}/docs/extensions/official/public-redundant-aliases.md +0 -0
  36. {griffe-2.2.0 → griffe-2.3.0}/docs/extensions/official/public-wildcard-imports.md +0 -0
  37. {griffe-2.2.0 → griffe-2.3.0}/docs/extensions/official/pydantic.md +0 -0
  38. {griffe-2.2.0 → griffe-2.3.0}/docs/extensions/official/runtime-objects.md +0 -0
  39. {griffe-2.2.0 → griffe-2.3.0}/docs/extensions/official/sphinx.md +0 -0
  40. {griffe-2.2.0 → griffe-2.3.0}/docs/extensions/official/typingdoc.md +0 -0
  41. {griffe-2.2.0 → griffe-2.3.0}/docs/extensions/official/warnings-deprecated.md +0 -0
  42. {griffe-2.2.0 → griffe-2.3.0}/docs/extensions/official.md +0 -0
  43. {griffe-2.2.0 → griffe-2.3.0}/docs/extensions/third-party/docstring-inheritance.md +0 -0
  44. {griffe-2.2.0 → griffe-2.3.0}/docs/extensions/third-party/fastapi.md +0 -0
  45. {griffe-2.2.0 → griffe-2.3.0}/docs/extensions/third-party/fieldz.md +0 -0
  46. {griffe-2.2.0 → griffe-2.3.0}/docs/extensions/third-party/generics.md +0 -0
  47. {griffe-2.2.0 → griffe-2.3.0}/docs/extensions/third-party/inherited-method-crossrefs.md +0 -0
  48. {griffe-2.2.0 → griffe-2.3.0}/docs/extensions/third-party/modernized-annotations.md +0 -0
  49. {griffe-2.2.0 → griffe-2.3.0}/docs/extensions/third-party.md +0 -0
  50. {griffe-2.2.0 → griffe-2.3.0}/docs/extensions.md +0 -0
  51. {griffe-2.2.0 → griffe-2.3.0}/docs/getting-help.md +0 -0
  52. {griffe-2.2.0 → griffe-2.3.0}/docs/getting-started.md +0 -0
  53. {griffe-2.2.0 → griffe-2.3.0}/docs/guide/contributors/architecture.md +0 -0
  54. {griffe-2.2.0 → griffe-2.3.0}/docs/guide/contributors/commands.md +0 -0
  55. {griffe-2.2.0 → griffe-2.3.0}/docs/guide/contributors/setup.md +0 -0
  56. {griffe-2.2.0 → griffe-2.3.0}/docs/guide/contributors/workflow.md +0 -0
  57. {griffe-2.2.0 → griffe-2.3.0}/docs/guide/contributors.md +0 -0
  58. {griffe-2.2.0 → griffe-2.3.0}/docs/guide/users/checking.md +0 -0
  59. {griffe-2.2.0 → griffe-2.3.0}/docs/guide/users/extending.md +0 -0
  60. {griffe-2.2.0 → griffe-2.3.0}/docs/guide/users/how-to/parse-docstrings.md +0 -0
  61. {griffe-2.2.0 → griffe-2.3.0}/docs/guide/users/how-to/selectively-inspect.md +0 -0
  62. {griffe-2.2.0 → griffe-2.3.0}/docs/guide/users/how-to/set-docstring-styles.md +0 -0
  63. {griffe-2.2.0 → griffe-2.3.0}/docs/guide/users/how-to/set-git-info.md +0 -0
  64. {griffe-2.2.0 → griffe-2.3.0}/docs/guide/users/how-to/support-decorators.md +0 -0
  65. {griffe-2.2.0 → griffe-2.3.0}/docs/guide/users/navigating.md +0 -0
  66. {griffe-2.2.0 → griffe-2.3.0}/docs/guide/users/recommendations/docstrings.md +0 -0
  67. {griffe-2.2.0 → griffe-2.3.0}/docs/guide/users/recommendations/public-apis.md +0 -0
  68. {griffe-2.2.0 → griffe-2.3.0}/docs/guide/users/recommendations/python-code.md +0 -0
  69. {griffe-2.2.0 → griffe-2.3.0}/docs/guide/users/serializing.md +0 -0
  70. {griffe-2.2.0 → griffe-2.3.0}/docs/guide/users.md +0 -0
  71. {griffe-2.2.0 → griffe-2.3.0}/docs/guide.md +0 -0
  72. {griffe-2.2.0 → griffe-2.3.0}/docs/img/favicon.ico +0 -0
  73. {griffe-2.2.0 → griffe-2.3.0}/docs/img/gha_annotations_1.png +0 -0
  74. {griffe-2.2.0 → griffe-2.3.0}/docs/img/gha_annotations_2.png +0 -0
  75. {griffe-2.2.0 → griffe-2.3.0}/docs/index.md +0 -0
  76. {griffe-2.2.0 → griffe-2.3.0}/docs/installation.md +0 -0
  77. {griffe-2.2.0 → griffe-2.3.0}/docs/introduction.md +0 -0
  78. {griffe-2.2.0 → griffe-2.3.0}/docs/js/feedback.js +0 -0
  79. {griffe-2.2.0 → griffe-2.3.0}/docs/license.md +0 -0
  80. {griffe-2.2.0 → griffe-2.3.0}/docs/logo.svg +0 -0
  81. {griffe-2.2.0 → griffe-2.3.0}/docs/playground.md +0 -0
  82. {griffe-2.2.0 → griffe-2.3.0}/docs/reference/api/agents.md +0 -0
  83. {griffe-2.2.0 → griffe-2.3.0}/docs/reference/api/checks.md +0 -0
  84. {griffe-2.2.0 → griffe-2.3.0}/docs/reference/api/cli.md +0 -0
  85. {griffe-2.2.0 → griffe-2.3.0}/docs/reference/api/docstrings/models.md +0 -0
  86. {griffe-2.2.0 → griffe-2.3.0}/docs/reference/api/docstrings/parsers.md +0 -0
  87. {griffe-2.2.0 → griffe-2.3.0}/docs/reference/api/docstrings.md +0 -0
  88. {griffe-2.2.0 → griffe-2.3.0}/docs/reference/api/exceptions.md +0 -0
  89. {griffe-2.2.0 → griffe-2.3.0}/docs/reference/api/expressions.md +0 -0
  90. {griffe-2.2.0 → griffe-2.3.0}/docs/reference/api/extensions.md +0 -0
  91. {griffe-2.2.0 → griffe-2.3.0}/docs/reference/api/finder.md +0 -0
  92. {griffe-2.2.0 → griffe-2.3.0}/docs/reference/api/helpers.md +0 -0
  93. {griffe-2.2.0 → griffe-2.3.0}/docs/reference/api/loaders.md +0 -0
  94. {griffe-2.2.0 → griffe-2.3.0}/docs/reference/api/loggers.md +0 -0
  95. {griffe-2.2.0 → griffe-2.3.0}/docs/reference/api/models/alias.md +0 -0
  96. {griffe-2.2.0 → griffe-2.3.0}/docs/reference/api/models/attribute.md +0 -0
  97. {griffe-2.2.0 → griffe-2.3.0}/docs/reference/api/models/class.md +0 -0
  98. {griffe-2.2.0 → griffe-2.3.0}/docs/reference/api/models/function.md +0 -0
  99. {griffe-2.2.0 → griffe-2.3.0}/docs/reference/api/models/module.md +0 -0
  100. {griffe-2.2.0 → griffe-2.3.0}/docs/reference/api/models/type_alias.md +0 -0
  101. {griffe-2.2.0 → griffe-2.3.0}/docs/reference/api/models.md +0 -0
  102. {griffe-2.2.0 → griffe-2.3.0}/docs/reference/api/serializers.md +0 -0
  103. {griffe-2.2.0 → griffe-2.3.0}/docs/reference/api.md +0 -0
  104. {griffe-2.2.0 → griffe-2.3.0}/docs/reference/cli.md +0 -0
  105. {griffe-2.2.0 → griffe-2.3.0}/docs/reference/docstrings.md +0 -0
  106. {griffe-2.2.0 → griffe-2.3.0}/docs/reference.md +0 -0
  107. {griffe-2.2.0 → griffe-2.3.0}/docs/schema-docstrings-options.json +0 -0
  108. {griffe-2.2.0 → griffe-2.3.0}/docs/schema.json +0 -0
  109. {griffe-2.2.0 → griffe-2.3.0}/duties.py +0 -0
  110. {griffe-2.2.0 → griffe-2.3.0}/mkdocs.yml +0 -0
  111. {griffe-2.2.0 → griffe-2.3.0}/pyproject.toml +0 -0
  112. {griffe-2.2.0 → griffe-2.3.0}/scripts/gen_credits.py +0 -0
  113. {griffe-2.2.0 → griffe-2.3.0}/scripts/gen_griffe_json.py +0 -0
  114. {griffe-2.2.0 → griffe-2.3.0}/scripts/gen_structure_docs.py +0 -0
  115. {griffe-2.2.0 → griffe-2.3.0}/scripts/get_version.py +0 -0
  116. {griffe-2.2.0 → griffe-2.3.0}/scripts/make +0 -0
  117. {griffe-2.2.0 → griffe-2.3.0}/scripts/make.py +0 -0
@@ -5,6 +5,40 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
5
5
  and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
6
6
 
7
7
  <!-- insertion marker -->
8
+ ## [2.3.0](https://github.com/mkdocstrings/griffe/releases/tag/2.3.0) - 2026-09-04
9
+
10
+ <small>[Compare with 2.2.0](https://github.com/mkdocstrings/griffe/compare/2.2.0...2.3.0)</small>
11
+
12
+ ### Features
13
+
14
+ - Add option to give precedence to docstrings in stubs vs. source ([09a2a13](https://github.com/mkdocstrings/griffe/commit/09a2a1323d1b4d022a4ce76a9f2839287b9c100e) by Timothée Mazzucotelli). [Issue-447](https://github.com/mkdocstrings/griffe/issues/447), [PR-481](https://github.com/mkdocstrings/griffe/pull/481)
15
+
16
+ ### Bug Fixes
17
+
18
+ - Preserve nested tuple parentheses ([e095a7c](https://github.com/mkdocstrings/griffe/commit/e095a7cd4c239abd961f7899d7ddb17ea27caead) by Alperen). [PR-487](https://github.com/mkdocstrings/griffe/pull/487), Co-authored-by: Timothée Mazzucotelli <dev@pawamoy.fr>
19
+ - Preserve nested f-string format specs ([38921b7](https://github.com/mkdocstrings/griffe/commit/38921b70e3dbba9a493aa5117f11a3a7883634cf) by Alperen). [PR-486](https://github.com/mkdocstrings/griffe/pull/486)
20
+ - Disable all docstring warnings when passing `warnings=False` ([5cb0ae2](https://github.com/mkdocstrings/griffe/commit/5cb0ae2f00748288c4009c1d4b6ee19f6aca6b76) by Timothée Mazzucotelli).
21
+
22
+ ### Performance Improvements
23
+
24
+ - Reuse computed parent in `is_imported` ([092ac31](https://github.com/mkdocstrings/griffe/commit/092ac3162e1477a4b62eb875365996998adbd77d) by Timothée Mazzucotelli).
25
+ - Only build debug messages at debug level ([8f05a4a](https://github.com/mkdocstrings/griffe/commit/8f05a4ae5587d685bea1b0c98294a047b56c8df0) by Timothée Mazzucotelli).
26
+ - Avoid creating new sets when handling labels ([06cd02e](https://github.com/mkdocstrings/griffe/commit/06cd02e63c240286d11450887cc01b0ef76d8908) by Timothée Mazzucotelli).
27
+ - Maintain map of AST node type to visitor function ([e21851e](https://github.com/mkdocstrings/griffe/commit/e21851e732782823006223a7f5f8111b4200a257) by Timothée Mazzucotelli).
28
+ - Avoid cyclic refs in ASTs to allow garbage-collecting them ([b968de0](https://github.com/mkdocstrings/griffe/commit/b968de091afc1a4fd241f457538433ce3ada7520) by Timothée Mazzucotelli).
29
+ - Cache per-module path-related properties during serialization ([8bd6cc4](https://github.com/mkdocstrings/griffe/commit/8bd6cc4b34e96fc8235271cfa93a1a6a77091707) by Timothée Mazzucotelli).
30
+ - Do not fire load events when no extension has hooked them ([0e2ae7c](https://github.com/mkdocstrings/griffe/commit/0e2ae7c8cd1563d6dcca7a6c37fb8f2ec072cb24) by Timothée Mazzucotelli).
31
+ - Compute costly message lazily in alias resolution errors ([1e391b8](https://github.com/mkdocstrings/griffe/commit/1e391b8239747bb62908819e55468a961ffbaa99) by Timothée Mazzucotelli).
32
+ - Avoid iterating many times over function parameters when merging stubs ([03cae74](https://github.com/mkdocstrings/griffe/commit/03cae743e02c56af7375ffbfa70d6acf02e5491d) by Timothée Mazzucotelli).
33
+ - Avoid iterating many times over function parameters when diff'ing ([d3cf2c4](https://github.com/mkdocstrings/griffe/commit/d3cf2c41bb5f734e57b612b42d178e87af605ae8) by Timothée Mazzucotelli).
34
+ - Improve efficiency of AST parameter extraction ([1e37cd4](https://github.com/mkdocstrings/griffe/commit/1e37cd488d6adf55065b3ce4e7932faf1ff7d186) by Timothée Mazzucotelli).
35
+ - Cache serializable expression fields ([f9e48c1](https://github.com/mkdocstrings/griffe/commit/f9e48c16ebaeb719d5768cb921637aebe377a639) by Timothée Mazzucotelli).
36
+ - Use maps to make JSON encoder faster ([b7de96f](https://github.com/mkdocstrings/griffe/commit/b7de96fb516218ae3bf6a8e6d014a223df67f4a3) by Timothée Mazzucotelli).
37
+ - Avoid recomputing inherited members when diff'ing ([a29e028](https://github.com/mkdocstrings/griffe/commit/a29e028ff034752ff747dda17f3f875f22c2a192) by Timothée Mazzucotelli).
38
+ - Make Google, Numpy and Sphinx docstring parsers faster ([7f39373](https://github.com/mkdocstrings/griffe/commit/7f39373f8da779fb104dd2b6c11a02d95da628c4) by Timothée Mazzucotelli).
39
+ - Pre-compile patterns for docstring style detection ([ad58ad5](https://github.com/mkdocstrings/griffe/commit/ad58ad5b86390a8a02311189315dd4f59e0300a4) by Timothée Mazzucotelli).
40
+ - LRU-cache parsing of type annotations in docstrings ([1671e59](https://github.com/mkdocstrings/griffe/commit/1671e59fb675e9b45338956ce8aa5f5e56692690) by Timothée Mazzucotelli).
41
+
8
42
  ## [2.2.0](https://github.com/mkdocstrings/griffe/releases/tag/2.2.0) - 2026-08-16
9
43
 
10
44
  <small>[Compare with 2.1.0](https://github.com/mkdocstrings/griffe/compare/2.1.0...2.2.0)</small>
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: griffe
3
- Version: 2.2.0
3
+ Version: 2.3.0
4
4
  Summary: Signatures for entire Python programs. Extract the structure, the frame, the skeleton of your project, to generate API documentation or find breaking changes in your API.
5
5
  Project-URL: Homepage, https://mkdocstrings.github.io/griffe
6
6
  Project-URL: Documentation, https://mkdocstrings.github.io/griffe
@@ -30,10 +30,10 @@ Classifier: Topic :: Software Development :: Documentation
30
30
  Classifier: Topic :: Utilities
31
31
  Classifier: Typing :: Typed
32
32
  Requires-Python: >=3.10
33
- Requires-Dist: griffecli==2.2.0
34
- Requires-Dist: griffelib==2.2.0
33
+ Requires-Dist: griffecli==2.3.0
34
+ Requires-Dist: griffelib==2.3.0
35
35
  Provides-Extra: pypi
36
- Requires-Dist: griffelib[pypi]==2.2.0; extra == 'pypi'
36
+ Requires-Dist: griffelib[pypi]==2.3.0; extra == 'pypi'
37
37
  Description-Content-Type: text/markdown
38
38
 
39
39
  # Griffe
@@ -93,6 +93,34 @@ By default it will search in the paths found in [`sys.path`][sys.path], which ca
93
93
 
94
94
  If Griffe cannot find sources for the specified object in the given search paths, it will try to import the specified object and use dynamic analysis on it (introspection). See [Forcing dynamic analysis](#forcing-dynamic-analysis) and [Disallowing dynamic analysis](#disallowing-dynamic-analysis).
95
95
 
96
+ ## Preferring stub docstrings
97
+
98
+ When Griffe finds both a Python source file (`.py`) and its corresponding stub file (`.pyi`), it merges the information from both files. By default, a docstring from the source file takes precedence, and a docstring from the stub is only used when the matching object in the source has no docstring.
99
+
100
+ If your stubs are the authoritative source of documentation, set `prefer_stubs_docs=True`. A docstring from a stub will then replace the corresponding source docstring. If the stub has no docstring, the source docstring is kept.
101
+
102
+ === "`load`"
103
+ ```python
104
+ import griffe
105
+
106
+ my_package = griffe.load("my_package", prefer_stubs_docs=True)
107
+ ```
108
+
109
+ === "`GriffeLoader`"
110
+ ```python
111
+ import griffe
112
+
113
+ loader = griffe.GriffeLoader(prefer_stubs_docs=True)
114
+ my_package = loader.load("my_package")
115
+ ```
116
+
117
+ === "CLI"
118
+ ```bash
119
+ griffe dump my_package --prefer-stubs-docstrings
120
+ ```
121
+
122
+ The same Python option is available on [`load_git`][griffe.load_git] and [`load_pypi`][griffe.load_pypi], while the `-P`/`--prefer-stubs-docstrings` CLI flag is shared by the `dump` and `check` commands. The option only controls which docstring wins when source and stub data are merged. To search for a separately installed stubs-only package, also set `find_stubs_package=True` in Python or pass `-B`/`--find-stubs-packages` on the command line.
123
+
96
124
  ## Forcing dynamic analysis
97
125
 
98
126
  Griffe always tries first to find sources for the specified object. Then, unless told otherwise, it uses static analysis to load API data, i.e. it parses the sources and visits the AST (Abstract Syntax Tree) to extract information. If for some reason you want Griffe to use dynamic analysis instead (importing and inspecting runtime objects), you can pass the `force_inspection=True` argument:
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes