Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: mkdocstrings/griffe
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 0.45.3
Choose a base ref
...
head repository: mkdocstrings/griffe
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 0.46.0
Choose a head ref
  • 14 commits
  • 21 files changed
  • 2 contributors

Commits on Jun 7, 2024

  1. Configuration menu
    Copy the full SHA
    ab2e947 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    c4e3bf2 View commit details
    Browse the repository at this point in the history

Commits on Jun 8, 2024

  1. refactor: Allow passing multiple extensions to load_extensions inst…

    …ead of a sequence
    
    Issue-268: #268
    pawamoy committed Jun 8, 2024
    Configuration menu
    Copy the full SHA
    fadb72b View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    9e6dcaa View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    08c3f40 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    b6ddcc4 View commit details
    Browse the repository at this point in the history

Commits on Jun 9, 2024

  1. 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
    pawamoy committed Jun 9, 2024
    Configuration menu
    Copy the full SHA
    b327b90 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    e5572d2 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    dd954ad View commit details
    Browse the repository at this point in the history

Commits on Jun 12, 2024

  1. 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]>
    has2k1 and pawamoy authored Jun 12, 2024
    Configuration menu
    Copy the full SHA
    e21eabe View commit details
    Browse the repository at this point in the history

Commits on Jun 16, 2024

  1. style: Format

    pawamoy committed Jun 16, 2024
    Configuration menu
    Copy the full SHA
    e6d3bb6 View commit details
    Browse the repository at this point in the history
  2. 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.
    pawamoy committed Jun 16, 2024
    Configuration menu
    Copy the full SHA
    be29c32 View commit details
    Browse the repository at this point in the history
  3. style: Format changelog

    pawamoy committed Jun 16, 2024
    Configuration menu
    Copy the full SHA
    0bba29d View commit details
    Browse the repository at this point in the history
  4. chore: Prepare release 0.46.0

    pawamoy committed Jun 16, 2024
    Configuration menu
    Copy the full SHA
    cb8b97a View commit details
    Browse the repository at this point in the history
Loading