Releases: mkdocstrings/griffe
Releases · mkdocstrings/griffe
1.3.2
1.3.2 - 2024-10-01
Bug Fixes
1.3.1
1.3.1 - 2024-09-12
Bug Fixes
- Refactor and fix logic again for fetching returns/yields/receives annotation from parents (a80bd3c by Timothée Mazzucotelli). Follow-up-of-PR-322
- Don't crash on invalid signature given "Receives" section (1cb8f51 by Timothée Mazzucotelli).
1.3.0
1.3.0 - 2024-09-10
Features
- Allow deselecting multiple or named items in Yields and Receives (344df50 by Marco Ricci). Issue-263
Bug Fixes
- Don't crash when trying to merge stubs into a compiled module that has no file path (e1f3ed9 by Timothée Mazzucotelli). Issue-323
- Fix identity checks in inspector when handling attributes (676cfb4 by Timothée Mazzucotelli).
Code Refactoring
1.2.0
1.2.0 - 2024-08-23
Features
1.1.1
1.1.0
1.0.0
1.0.0 - 2024-08-15
V1! 🚀 🔥 🌈
Breaking changes
Highlights:
- Extensions inherit from
Extension
, (VisitorExtension
andInspectorExtension
are removed) - Members are serialized (
as_dict
/JSON) as a dictionary instead of a list - All objects are available in the top-level
griffe
module, nowhere else
Removed objects:
- all modules under the
griffe
package - the
griffe.DocstringWarningCallable
class - the
griffe.When
class - the
griffe.ExtensionType
type - the
griffe.InspectorExtension
class - the
griffe.VisitorExtension
class - the
griffe.HybridExtension
extension - the
griffe.patch_logger
function - the
griffe.JSONEncoder.docstring_parser
attribute - the
griffe.JSONEncoder.docstring_options
attribute - the
griffe.Extensions.attach_visitor
method - the
griffe.Extensions.attach_inspector
method - the
griffe.Extensions.before_visit
method - the
griffe.Extensions.before_children_visit
method - the
griffe.Extensions.after_children_visit
method - the
griffe.Extensions.after_visit
method - the
griffe.Extensions.before_inspection
method - the
griffe.Extensions.before_children_inspection
method - the
griffe.Extensions.after_children_inspection
method - the
griffe.Extensions.after_inspection
method - the
griffe.GriffeLoader.load_module
method - the
has_special_name
andhas_private_name
properties on objects - the
is_explicitely_exported
andis_implicitely_exported
properties on objects - the
member_is_exported
method on objects
Renamed/moved objects:
griffe.Function.setter
->griffe.Attribute.setter
griffe.Function.deleter
->griffe.Attribute.deleter
Signatures:
griffe.docstring_warning(name)
parameter was removedgriffe.GriffeLoader.load(module)
parameter was removedgriffe.load(module)
parameter was removedgriffe.load_git(module)
parameter was removedgriffe.find_breaking_changes(ignore_private)
parameter was removed- see previous deprecations
Code Refactoring
0.49.0
0.49.0 - 2024-08-14
WARNING: ⚡ Imminent v1! ⚡🚀 See v0.46.
Deprecations
- Cancel deprecation of
get_logger
andpatch_loggers
(and deprecatepatch_logger
instead). Extensions need loggers too, distinct ones, and they were forgotten... Sorry for the back and forth 🙇 - Attributes
setter
anddeleter
onFunction
are deprecated. They were moved into theAttribute
class since properties are instantiated as attributes, not functions. - Extension hooks must accept
**kwargs
in their signature, to allow forward-compatibility. Accepting**kwargs
also makes it possible to remove unused arguments from the signature. - In version 1, Griffe will serialize object members as dictionaries instead of lists. Lists were initially used to preserve source order, but source order can be re-obtained thanks to the line number attributes (
lineno
,endlineno
). Version 0.49 is able to load both lists and dictionaries from JSON dumps, and version 1 will maintain this ability. However external tools loading JSON dumps will need to be updated.
Features
- Add
temporary_inspected_package
helper (3c4ba16 by Timothée Mazzucotelli). - Accept alias resolution related parameters in
temporary_visited_package
(7d5408a by Timothée Mazzucotelli). - Accept
inits
parameter intemporary_visited_package
(a4859b7 by Timothée Mazzucotelli). - Warn (DEBUG) when an object coming from a sibling, parent or external module instead of the current module or a submodule is exported (listed in
__all__
) (f82317a by Timothée Mazzucotelli). Issue-249, Related-to-PR-251 - Pass down agent to extension hooks (71acb01 by Timothée Mazzucotelli). Issue-312
- Add
source
property to docstrings, which return the docstring lines as written in the source (3f6a71a by Timothée Mazzucotelli). Issue-90
Bug Fixes
- Move
setter
anddeleter
toAttribute
class instead ofFunction
, since that's how properties are instantiated (309c6e3 by Timothée Mazzucotelli). Issue-311 - Reduce risk of recursion errors by excluding imported objects from
has_docstrings
, unless they're public (9296ca7 by Timothée Mazzucotelli). Issue-302 - Fix retrieval of annotations from parent for Yields section in properties (8a21f4d by Timothée Mazzucotelli). Issue-298
- Fix parsing Yields section (Google-style) when yielded values are tuples, and the description has more lines than tuple values (9091776 by Timothée Mazzucotelli).
- Fix condition on objects kinds when merging stubs (727f99b by Timothée Mazzucotelli).
Code Refactoring
- Sort keys when dumping JSON from the command line (8cdffe9 by Timothée Mazzucotelli). Issue-310
- Handle both lists and dicts for members when loading JSON data in preparation of v1 (f89050c by Timothée Mazzucotelli). Issue-310
- Accept
**kwargs
in extension hooks to allow forward-compatibility (2621d52 by Timothée Mazzucotelli). Issue-312 - Revert deprecation of
patch_loggers
in favor ofpatch_logger
(a20796a by Timothée Mazzucotelli). - Expose dummy
load_pypi
in non-Insiders version (a69cffd by Timothée Mazzucotelli). - Don't emit deprecation warnings through own usage of deprecated API (9922d74 by Timothée Mazzucotelli). Issue-mkdocstrings#676
- Finish preparing docstring style auto-detection feature (03bdec6 by Timothée Mazzucotelli). Issue-5
- Add DocstringStyle literal type to prepare docstring style auto detection feature (b7aaf64 by Timothée Mazzucotelli). Issue-5
- Inherit from
str, Enum
instead ofStrEnum
which needs a backport (77f1544 by Timothée Mazzucotelli). Issue-307
0.48.0
0.48.0 - 2024-07-15
WARNING: ⚡ Imminent v1! ⚡🚀 See v0.46.
Deprecations
- All submodules are deprecated. All objects are now exposed in the top-level
griffe
module. - All logger names are deprecated, and will be replaced with
"griffe"
in v1. In v1 our single"griffe"
logger will provide a method to temporarily disable logging, [logger.disable()
][griffe.Logger.disable], since that's the most common third-party use. - The
get_logger
function is deprecated. Instead, we'll use a globallogger
internally, and users are welcome to use it too. - The
patch_loggers
function is renamedpatch_logger
. - Following the logging changes, the [
docstring_warning
][griffe.docstring_warning] function can now directly log a warning message instead of returning a callable that does. Passing it a logger name (to get a callable) is deprecated in favor of passing it a docstring, message and offset directly.
Features
- Support
FORCE_COLOR
environment variable (e1b7bd9 by Timothée Mazzucotelli).
Bug Fixes
- Don't take a shortcut to the end of an alias chain when getting/setting/deleting alias members (1930609 by Timothée Mazzucotelli).
- Short-circuit
__all__
convention when checking if a module is public (5abf4e3 by Timothée Mazzucotelli). - Reuse existing loggers, preventing overwriting issues (3c2825f by Timothée Mazzucotelli).
- Ignore .pth files that are not utf-8 encoded (ea299dc by Andrew Sansom). Issue-300, PR-301
- Attributes without annotations cannot be dataclass parameters (c9b2e09 by Hassan Kibirige). PR-297
- When deciding to alias an object or not during inspection, consider module paths to be equivalent even with arbitrary private components (8c9f6e6 by Timothée Mazzucotelli). Issue-296
- Fix target path computation: use qualified names to maintain classes in the path (6e17def by Timothée Mazzucotelli). Issue-296
Code Refactoring
- Prepare loggers for simplification (381f10f by Timothée Mazzucotelli).
- Add all previous modules for backward compatibility (a86e44e by Timothée Mazzucotelli).
- Add main public modules (fb860b3 by Timothée Mazzucotelli).
- Simplify "is imported" check in
is_public
property (c2bbc10 by Timothée Mazzucotelli). - Use string and integer enumerations (06b383b by Timothée Mazzucotelli).
- Renamed agents nodes modules (ddc5b0c by Timothée Mazzucotelli).
- Clean up and document internal API, mark legacy code (92594a9 by Timothée Mazzucotelli).
- Renamed
dataclasses
internal modules tomodels
(5555de6 by Timothée Mazzucotelli). - Move sources under
_griffe
internal package (cbce6a5 by Timothée Mazzucotelli).
0.47.0
0.47.0 - 2024-06-18
WARNING: ⚡ Imminent v1! ⚡🚀 See v0.46.
Deprecations
- The
has_private_name
andhas_special_name
properties on objects and aliases have been renamedis_private
andis_special
. Theis_private
property now only returns true if the name is not special.
Features
- Add
deprecated
attribute andis_deprecated
property to objects/aliases (2a75d84 by Timothée Mazzucotelli). - Add
is_imported
property to objects/aliases (de926cc by Timothée Mazzucotelli). - Add
is_class_private
property to objects/aliases (491b6c4 by Timothée Mazzucotelli).
Code Refactoring
- Rename
has_private_name
andhas_special_name
tois_private
andis_special
(ae7c7e7 by Timothée Mazzucotelli).