Skip to content

Releases: mkdocstrings/griffe

1.3.1

12 Sep 13:19
Compare
Choose a tag to compare

1.3.1 - 2024-09-12

Compare with 1.3.0

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

10 Sep 15:02
Compare
Choose a tag to compare

1.3.0 - 2024-09-10

Compare with 1.2.0

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

  • Extract common functionality in Returns, Yields and Receives parsing (c768356 by Marco Ricci). Issue-263
  • Remove useless branch in resolve method, add tests for it (aa6c7e4 by Timothée Mazzucotelli).

1.2.0

23 Aug 19:25
Compare
Choose a tag to compare

1.2.0 - 2024-08-23

Compare with 1.1.1

Features

  • Support attribute syntax in __all__ values (ad99794 by Timothée Mazzucotelli). Issue-316

1.1.1

20 Aug 12:37
Compare
Choose a tag to compare

1.1.1 - 2024-08-20

Compare with 1.1.0

Bug Fixes

  • Pre-emptively expand __all__ values and wildcard imports before firing the on_package_loaded event (21b3780 by Timothée Mazzucotelli).

1.1.0

17 Aug 16:08
Compare
Choose a tag to compare

1.1.0 - 2024-08-17

Compare with 1.0.0

Features

  • Add on_wildcard_expansion event (c6bc6fa by Timothée Mazzucotelli). Issue-282
  • Add on_alias event (a760a8c by Timothée Mazzucotelli). Issue-282
  • Pass loader to on_package_loaded hooks (7f82dc3 by Timothée Mazzucotelli).

1.0.0

16 Aug 13:46
Compare
Choose a tag to compare

1.0.0 - 2024-08-15

Compare with 0.49.0

V1! 🚀 🔥 🌈

Breaking changes

Highlights:

  • Extensions inherit from Extension, (VisitorExtension and InspectorExtension 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 and has_private_name properties on objects
  • the is_explicitely_exported and is_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 removed
  • griffe.GriffeLoader.load(module) parameter was removed
  • griffe.load(module) parameter was removed
  • griffe.load_git(module) parameter was removed
  • griffe.find_breaking_changes(ignore_private) parameter was removed
  • see previous deprecations

Code Refactoring

0.49.0

14 Aug 17:27
Compare
Choose a tag to compare

0.49.0 - 2024-08-14

Compare with 0.48.0

WARNING: ⚡ Imminent v1! ⚡🚀 See v0.46.

Deprecations

  • Cancel deprecation of get_logger and patch_loggers (and deprecate patch_logger instead). Extensions need loggers too, distinct ones, and they were forgotten... Sorry for the back and forth 🙇
  • Attributes setter and deleter on Function are deprecated. They were moved into the Attribute 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 in temporary_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 and deleter to Attribute class instead of Function, 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 of patch_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 of StrEnum which needs a backport (77f1544 by Timothée Mazzucotelli). Issue-307

0.48.0

15 Jul 09:22
Compare
Choose a tag to compare

0.48.0 - 2024-07-15

Compare with 0.47.0

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 global logger internally, and users are welcome to use it too.
  • The patch_loggers function is renamed patch_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 to models (5555de6 by Timothée Mazzucotelli).
  • Move sources under _griffe internal package (cbce6a5 by Timothée Mazzucotelli).

0.47.0

18 Jun 11:14
Compare
Choose a tag to compare

0.47.0 - 2024-06-18

Compare with 0.46.1

WARNING: ⚡ Imminent v1! ⚡🚀 See v0.46.

Deprecations

  • The has_private_name and has_special_name properties on objects and aliases have been renamed is_private and is_special. The is_private property now only returns true if the name is not special.

Features

  • Add deprecated attribute and is_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 and has_special_name to is_private and is_special (ae7c7e7 by Timothée Mazzucotelli).

0.46.1

17 Jun 10:19
Compare
Choose a tag to compare

0.46.1 - 2024-06-17

Compare with 0.46.0

WARNING: ⚡ Imminent v1! ⚡🚀 See v0.46.

Bug Fixes

  • Always consider special objects ("dunder" attributes/methods/etc.) to be public (3319410 by Timothée Mazzucotelli). Issue-294, Issue-295
  • Don't consider imported objects as public (ea90952 by Timothée Mazzucotelli). Discussion-169