-
-
Notifications
You must be signed in to change notification settings - Fork 63
Comparing changes
Open a pull request
base repository: mkdocstrings/griffe
base: 0.45.3
head repository: mkdocstrings/griffe
compare: 0.46.0
- 14 commits
- 21 files changed
- 2 contributors
Commits on Jun 7, 2024
-
feat: Populate lines collection within helpers
GitHub-issue-270: #270 Radicle-issue-0d6a513: https://app.radicle.xyz/nodes/seed.radicle.garden/rad:z23ZVuA1DWS99PDJ1rcarCtJi99x1/issues/0d6a51328f554f235c38a2a652b844c4ba21bba5
Configuration menu - View commit details
-
Copy full SHA for ab2e947 - Browse repository at this point
Copy the full SHA ab2e947View commit details -
refactor: Allow passing multiple labels to
Object.has_labelsinstea……d of set Issue-267: #267
Configuration menu - View commit details
-
Copy full SHA for c4e3bf2 - Browse repository at this point
Copy the full SHA c4e3bf2View commit details
Commits on Jun 8, 2024
-
refactor: Allow passing multiple extensions to
load_extensionsinst……ead of a sequence Issue-268: #268
Configuration menu - View commit details
-
Copy full SHA for fadb72b - Browse repository at this point
Copy the full SHA fadb72bView commit details -
Configuration menu - View commit details
-
Copy full SHA for 9e6dcaa - Browse repository at this point
Copy the full SHA 9e6dcaaView commit details -
fix: Populate lines collection before visiting/inspecting modules wit…
…hin helpers Issue-272: #272
Configuration menu - View commit details
-
Copy full SHA for 08c3f40 - Browse repository at this point
Copy the full SHA 08c3f40View commit details -
Configuration menu - View commit details
-
Copy full SHA for b6ddcc4 - Browse repository at this point
Copy the full SHA b6ddcc4View commit details
Commits on Jun 9, 2024
-
refactor: Rework "exported" and "public" logic
We observed that Griffe's internals/API were a bit confusing, so decided to refactor them. Griffe has a concept of "exported member". A **module member** is considered: - **explicitly exported** when its name appears in the module's `__all__` - **implicitly exported** when the module's `__all__` is undefined, the member is available at runtime (for example not guarded behind `if TYPE_CHECKING`), and the member is an alias (defined elsewhere), *except* if it's a submodule, *unless* it was also imported in the current module A **class member** is considered **implicitly exported**, the same way as module members are considered implicitly exported. It is never considered explicitly exported because we don't/can't use `__all__` in class bodies. This "exported" marker is then used in a few places, 3 of of them being of interest to us here. - if `__all__` is defined in the wildcard imported module, add all objects referenced in the imported module's `__all__` to the importing module - else, add all objects that are implicitly exported by the imported module to the importing module There is a first issue here: members starting with `_` are considered implicitly exported. This is wrong: actual wildcard imports will not import these objects at runtime. Between the same old and same new module, if a member disappeared, and it was either a submodule, or it was exported (explicitly or implicitly), we consider its disappearance a breaking change. Again, it's wrong here to consider that a private object's disappearance makes a breaking change. This issue wasn't spotted before because the code that checks breaking changes has an earlier condition on the object names: it skips private objects anyway. Griffe objects have an `is_public()` method that tell if an object is public or not. An object is: - **strictly public** if: - its `public` attribute is true - or it is explicitly exported - **public** if: - it is strictly public - or it's not private (name not starting with `_`) and it's not imported Griffe gained this method later on, to be used by mkdocstrings-python. --- "Exported" is usually used to say "public" (we export an object to make it public), but in Griffe it's rather used to say "the object is exposed in regard to the wildcard import runtime mechanism". So we renamed "exported" to "wildcard exposed". Then we fixed the issue mentioned above about private members being considered implicitly exposed. And since wildcard imports are not configurable, we dropped the distinction between explicitly and implicitly exposed. An object is either exposed, or it's not. Finally the code that checks breaking changes now uses the "public" API instead of the "exposed" one. Issue-281: #281
Configuration menu - View commit details
-
Copy full SHA for b327b90 - Browse repository at this point
Copy the full SHA b327b90View commit details -
Configuration menu - View commit details
-
Copy full SHA for e5572d2 - Browse repository at this point
Copy the full SHA e5572d2View commit details -
Configuration menu - View commit details
-
Copy full SHA for dd954ad - Browse repository at this point
Copy the full SHA dd954adView commit details
Commits on Jun 12, 2024
-
feat: Add docstring attribute to parameters
This change gives the Parameter class the `docstring` and `function` attributes. The docstring value is only populated for dataclasses. This makes it possible to access this information for all dataclass parameters, especially those set as `InitVar` where it was not possible to get it since they are not members (attributes) of the class. This slot can also be used to support things like PEP 727 (with extensions). In the future, we might add such a docstring slot to yielded, received and returned values too. Issue-286: #286 Related-to-mkdocstrings/griffe#252: #252 PR-288: #288 Co-authored-by: Timothée Mazzucotelli <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for e21eabe - Browse repository at this point
Copy the full SHA e21eabeView commit details
Commits on Jun 16, 2024
-
Configuration menu - View commit details
-
Copy full SHA for e6d3bb6 - Browse repository at this point
Copy the full SHA e6d3bb6View commit details -
fix: Handle partials as functions while inspecting
This doesn't solve the issue that `functools.partial` does not set the `__module__` attribute of the resulting partial to be the module of the wrapped function, which means that the inspector always treats partials as aliases (since it finds out they were defined in the `functools` module). This issue cannot be fixed on our side, because special-casing partials to decide that they are always defined in the current module would not work for partials imported from elsewhere. Therefore, devs *must* set the `__module__` attribute of partials themselves.
Configuration menu - View commit details
-
Copy full SHA for be29c32 - Browse repository at this point
Copy the full SHA be29c32View commit details -
Configuration menu - View commit details
-
Copy full SHA for 0bba29d - Browse repository at this point
Copy the full SHA 0bba29dView commit details -
Configuration menu - View commit details
-
Copy full SHA for cb8b97a - Browse repository at this point
Copy the full SHA cb8b97aView commit details
This comparison is taking too long to generate.
Unfortunately it looks like we can’t render this comparison for you right now. It might be too big, or there might be something weird with your repository.
You can try running this command locally to see the comparison on your machine:
git diff 0.45.3...0.46.0