Skip to content

Releases: mkdocstrings/griffe

0.46.0

16 Jun 17:32
Compare
Choose a tag to compare

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

0.45.3

09 Jun 11:16
Compare
Choose a tag to compare

0.45.3 - 2024-06-09

Compare with 0.45.2

Bug Fixes

  • Always call on_package_loaded hook on a package, and not any other object (40db38d by Timothée Mazzucotelli). Issue-283

0.45.2

23 May 20:02
Compare
Choose a tag to compare

0.45.2 - 2024-05-23

Compare with 0.45.1

Bug Fixes

  • Support setuptools' new editable modules using type annotations (14d45e8 by Timothée Mazzucotelli). Issue-273

0.45.1

18 May 20:15
Compare
Choose a tag to compare

0.45.1 - 2024-05-18

Compare with 0.45.0

Bug Fixes

  • Fix loading of importable modules thanks to their __path__ attribute (56f5363 by Timothée Mazzucotelli). Issue-269

0.45.0

12 May 15:41
Compare
Choose a tag to compare

0.45.0 - 2024-05-12

Compare with 0.44.0

Features

  • Implement -x, --force-inspection CLI option (776063d by Timothée Mazzucotelli).
  • Implement force_inspection option in the loader API (3266f22 by Timothée Mazzucotelli).
  • Support inspecting packages (__init__ modules) (3f74f67 by Timothée Mazzucotelli).
  • Add parameters for resolving aliases to load functions (e418dee by Timothée Mazzucotelli).
  • Load private sibling modules by default when resolving aliases (4806189 by Timothée Mazzucotelli).

Bug Fixes

  • Pass down modules collection when inspecting (bc0f74b by Timothée Mazzucotelli).
  • Catch loading errors when loading additional modules during wildcard expansion and alias resolution (964e0d2 by Timothée Mazzucotelli).

Code Refactoring

  • Improve stats code and performance (eeb497f by Timothée Mazzucotelli).
  • Recurse immediately into non-discoverable submodules (no path on disk) during dynamic analysis (d0b7a1d by Timothée Mazzucotelli).
  • Simplify the code that checks if an object should be aliased or not during dynamic analysis (fc794c2 by Timothée Mazzucotelli).
  • Avoid side-effect in inspector by checking early if an object is a cached property (a6bfcfd by Timothée Mazzucotelli).

0.44.0

19 Apr 09:38
Compare
Choose a tag to compare

0.44.0 - 2024-04-19

Compare with 0.43.0

Features

  • Add resolved property on expression names, returning the corresponding Griffe object (9b5ca45 by Timothée Mazzucotelli).

Bug Fixes

  • Fix enumeration properties on expression names (6f22256 by Timothée Mazzucotelli).

0.43.0

18 Apr 13:16
Compare
Choose a tag to compare

0.43.0 - 2024-04-18

Compare with 0.42.2

Features

0.42.2

15 Apr 17:14
Compare
Choose a tag to compare

0.42.2 - 2024-04-15

Compare with 0.42.1

Bug Fixes

  • Fix target path of aliases for multipart imports (import a.b.c as x) (ee27ad9 by Timothée Mazzucotelli). Issue-259

0.42.1

19 Mar 17:12
Compare
Choose a tag to compare

0.42.1 - 2024-03-19

Compare with 0.42.0

Bug Fixes

  • Don't return class variables as parameters of dataclasses (2729c22 by Hassan Kibirige). PR-253
  • Don't turn items annotated as InitVar into dataclass members (6835ea3 by Hassan Kibirige). PR-252

0.42.0

11 Mar 18:25
Compare
Choose a tag to compare

0.42.0 - 2024-03-11

Compare with 0.41.3

Features

Bug Fixes

  • Don't return properties as parameters of dataclasses (again) (8c48397 by Hassan Kibirige). Issue-232, PR-248
  • Fix getting return type from parent property when parsing Sphinx docstrings (f314957 by Timothée Mazzucotelli). Issue-125

Code Refactoring

  • Warn (debug) when a submodule shadows a member with the same name (cdc9e1c by Timothée Mazzucotelli). Issue-124