Skip to content

0.46.0

Compare
Choose a tag to compare
@github-actions github-actions released this 16 Jun 17:32
· 185 commits to main since this release

0.46.0 - 2024-06-16

Compare with 0.45.3

WARNING: ⚡ Imminent v1! ⚡🚀
We are working on v1, and it will come soon, so we recommend that you consider adding an upper bound on Griffe. Version 1 will remove all legacy code! There will be a couple more v0 before so that you get all the deprecation warnings needed to upgrade your code using Griffe before upgrading to v1. See breaking changes and deprecations for v0.46 below.

Breaking Changes

We are still in v0, so no major bump yet.

  • Calling objects' [has_labels()][griffe.Object.has_labels] method with a labels keyword argument is not supported anymore. The parameter became a variadic positional parameter, so it cannot be used as a keyword argument anymore. Passing a sequence instead of multiple positional arguments still works but will emit a deprecation warning.
  • Calling the [load_extensions()][griffe.load_extensions] function with an exts keyword argument is not supported anymore. The parameter became a variadic positional parameter, so it cannot be used as a keyword argument anymore. Passing a sequence instead of multiple positional arguments still works but will emit a deprecation warning.

Deprecations

  • As seen above in the breaking changes section, the only parameters of [Object.has_labels()][griffe.Object.has_labels] and [load_extensions()][griffe.load_extensions] both became variadic positional parameters. Passing a sequence as single argument is deprecated in favor of passing multiple arguments. This is an ergonomic change: I myself often forgot to wrap extensions in a list. Passing sequences of labels (lists, sets, tuples) is also difficult from Jinja templates.
  • The following methods and properties on objects and aliases are deprecated: [member_is_exported()][griffe.Object.member_is_exported], [is_explicitely_exported][griffe.mixins.ObjectAliasMixin.is_explicitely_exported], [is_implicitely_exported][griffe.mixins.ObjectAliasMixin.is_implicitely_exported]. Use the [is_exported][griffe.mixins.ObjectAliasMixin.is_exported] property instead. See issue 281.
  • The [is_exported()][griffe.mixins.ObjectAliasMixin.is_exported] and [is_public()][griffe.mixins.ObjectAliasMixin.is_public] methods became properties. They can still be called like methods, but will emit deprecation warnings when doing so. See issue 281.
  • The ignore_private parameter of the [find_breaking_changes()][griffe.find_breaking_changes] function is now deprecated and unused. With the reworked "exported" and "public" API, this parameter became useless. See issue 281.
  • Using stats() instead of [Stats][griffe.stats.Stats] will now emit a deprecation warning.

Features

Bug Fixes

  • Handle partials as functions while inspecting (be29c32 by Timothée Mazzucotelli).
  • Populate lines collection before visiting/inspecting modules within helpers (08c3f40 by Timothée Mazzucotelli). Issue-272
  • Don't return all lines when line numbers are missing (9e6dcaa by Timothée Mazzucotelli). Issue-271

Code Refactoring

  • Emit deprecation warning when accessing stats instead of Stats (e5572d2 by Timothée Mazzucotelli).
  • Rework "exported" and "public" logic (b327b90 by Timothée Mazzucotelli). Issue-281
  • Allow passing multiple extensions to load_extensions instead of a sequence (fadb72b by Timothée Mazzucotelli). Issue-268
  • Allow passing multiple labels to Object.has_labels instead of set (c4e3bf2 by Timothée Mazzucotelli). Issue-267