Skip to content

Conversation

@renovate
Copy link

@renovate renovate bot commented Mar 13, 2025

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
mkdocstrings (changelog) ^0.15.0 -> ^0.29.0 age adoption passing confidence

Release Notes

mkdocstrings/mkdocstrings (mkdocstrings)

v0.29.0

Compare Source

Compare with 0.28.3

This is the last version before v1!

Build
  • Depend on MkDocs 1.6 (11bc400 by Timothée Mazzucotelli).
Features
Code Refactoring
  • Save and forward titles to autorefs (f49fb29 by Timothée Mazzucotelli).
  • Use a combined event (each split with a different priority) for on_env (8d1dd75 by Timothée Mazzucotelli).

v0.28.3

Compare Source

Compare with 0.28.2

Deprecations

All public objects must now be imported from the top-level mkdocstrings module. Importing from submodules is deprecated, and will raise errors starting with v1. This should be the last deprecation before v1.

Build
  • Make python extra depend on latest mkdocstrings-python (1.16.2) (ba9003e by Timothée Mazzucotelli).
Code Refactoring
  • Finish exposing/hiding public/internal objects (0723fc2 by Timothée Mazzucotelli).
  • Re-expose public API in the top-level mkdocstrings module (e66e080 by Timothée Mazzucotelli).
  • Move modules to internal folder (23fe23f by Timothée Mazzucotelli).

v0.28.2

Compare Source

Compare with 0.28.1

Build
  • Depend on mkdocs-autorefs >= 1.4 (2c22bdc by Timothée Mazzucotelli).

v0.28.1

Compare Source

Compare with 0.28.0

Bug Fixes

v0.28.0

Compare Source

Compare with 0.27.0

Breaking Changes

Although the following changes are "breaking" in terms of public API, we didn't find any public use of these classes and methods on GitHub.

  • mkdocstrings.extension.AutoDocProcessor.__init__(parser): Parameter was removed
  • mkdocstrings.extension.AutoDocProcessor.__init__(md): Positional parameter was moved
  • mkdocstrings.extension.AutoDocProcessor.__init__(config): Parameter was removed
  • mkdocstrings.extension.AutoDocProcessor.__init__(handlers): Parameter kind was changed: positional or keyword -> keyword-only
  • mkdocstrings.extension.AutoDocProcessor.__init__(autorefs): Parameter kind was changed: positional or keyword -> keyword-only
  • mkdocstrings.extension.MkdocstringsExtension.__init__(config): Parameter was removed
  • mkdocstrings.extension.MkdocstringsExtension.__init__(handlers): Positional parameter was moved
  • mkdocstrings.extension.MkdocstringsExtension.__init__(autorefs): Positional parameter was moved
  • mkdocstrings.handlers.base.Handlers.__init__(config): Parameter was removed
  • mkdocstrings.handlers.base.Handlers.__init__(theme): Parameter was added as required
  • mkdocstrings.handlers.base.Handlers.__init__(default): Parameter was added as required
  • mkdocstrings.handlers.base.Handlers.__init__(inventory_project): Parameter was added as required
  • mkdocstrings.handlers.base.Handlers.__init__(tool_config): Parameter was added as required

Similarly, the following parameters were renamed, but the methods are only called from our own code, using positional arguments.

  • mkdocstrings.handlers.base.BaseHandler.collect(config): Parameter was renamed options
  • mkdocstrings.handlers.base.BaseHandler.render(config): Parameter was renamed options

Finally, the following method was removed, but this is again taken into account in our own code:

  • mkdocstrings.handlers.base.BaseHandler.get_anchors: Public object was removed

For these reasons, and because we're still in v0, we do not bump to v1 yet. See following deprecations.

Deprecations

mkdocstrings 0.28 will start emitting these deprecations warnings:

The handler argument is deprecated. The handler name must be specified as a class attribute.

Previously, the get_handler function would pass a handler (name) argument to the handler constructor. This name must now be set on the handler's class directly.

class MyHandler:
    name = "myhandler"

The domain attribute must be specified as a class attribute.

The domain class attribute on handlers is now mandatory and cannot be an empty string.

class MyHandler:
    domain = "mh"

The theme argument must be passed as a keyword argument.

This argument could previously be passed as a positional argument (from the get_handler function), and must now be passed as a keyword argument.

The custom_templates argument must be passed as a keyword argument.

Same as for theme, but with custom_templates.

The mdx argument must be provided (as a keyword argument).

The get_handler function now receives a mdx argument, which it must forward to the handler constructor and then to the base handler, either explicitly or through **kwargs:

=== "Explicitly"

```python
def get_handler(..., mdx, ...):
    return MyHandler(..., mdx=mdx, ...)

class MyHandler:
    def __init__(self, ..., mdx, ...):
        super().__init__(..., mdx=mdx, ...)
```

=== "Through **kwargs"

```python
def get_handler(..., **kwargs):
    return MyHandler(..., **kwargs)

class MyHandler:
    def __init__(self, ..., **kwargs):
        super().__init__(**kwargs)
```

In the meantime we still retrieve this mdx value at a different moment, by reading it from the MkDocs configuration.

The mdx_config argument must be provided (as a keyword argument).

Same as for mdx, but with mdx_config.

mkdocstrings v1 will stop handling 'import' in handlers configuration. Instead your handler must define a get_inventory_urls method that returns a list of URLs to download.

Previously, mkdocstrings would pop the import key from a handler's configuration to download each item (URLs). Items could be strings, or dictionaries with a url key. Now mkdocstrings gives back control to handlers, which must store this inventory configuration within them, and expose it again through a get_inventory_urls method. This method returns a list of tuples: an URL, and a dictionary of options that will be passed again to their load_inventory method. Handlers have now full control over the "inventory" setting.

from copy import deepcopy

def get_handler(..., handler_config, ...):
    return MyHandler(..., config=handler_config, ...)

class MyHandler:
    def __init__(self, ..., config, ...):
        self.config = config

    def get_inventory_urls(self):
        config = deepcopy(self.config["import"])
        return [(inv, {}) if isinstance(inv, str) else (inv.pop("url"), inv) for inv in config]

Changing the name of the key (for example from import to inventories) involves a change in user configuration, and both keys will have to be supported by your handler for some time.

def get_handler(..., handler_config, ...):
    if "inventories" not in handler_config and "import" in handler_config:
        warn("The 'import' key is renamed 'inventories'", FutureWarning)
        handler_config["inventories"] = handler_config.pop("import")
    return MyHandler(..., config=handler_config, ...)

Setting a fallback anchor function is deprecated and will be removed in a future release.

This comes from mkdocstrings and mkdocs-autorefs, and will disappear with mkdocstrings v0.28.

mkdocstrings v1 will start using your handler's get_options method to build options instead of merging the global and local options (dictionaries).

Handlers must now store their own global options (in an instance attribute), and implement a get_options method that receives local_options (a dict) and returns combined options (dict or custom object). These combined options are then passed to collect and render, so that these methods can use them right away.

def get_handler(..., handler_config, ...):
    return MyHandler(..., config=handler_config, ...)

class MyHandler:
    def __init__(self, ..., config, ...):
        self.config = config

    def get_options(local_options):
        return {**self.default_options, **self.config["options"], **local_options}

The update_env(md) parameter is deprecated. Use self.md instead.

Handlers can remove the md parameter from their update_env method implementation, and use self.md instead, if they need it.

No need to call super().update_env() anymore.

Handlers don't have to call the parent update_env method from their own implementation anymore, and can just drop the call.

The get_anchors method is deprecated. Declare a get_aliases method instead, accepting a string (identifier) instead of a collected object.

Previously, handlers would implement a get_anchors method that received a data object (typed CollectorItem) to return aliases for this object. This forced mkdocstrings to collect this object through the handler's collect method, which then required some logic with "fallback config" as to prevent unwanted collection. mkdocstrings gives back control to handlers and now calls get_aliases instead, which accepts an identifier (string) and lets the handler decide how to return aliases for this identifier. For example, it can replicate previous behavior by calling its own collect method with its own "fallback config", or do something different (cache lookup, etc.).

class MyHandler:
    def get_aliases(identifier):
        try:
            obj = self.collect(identifier, self.fallback_config)

### or obj = self._objects_cache[identifier]
        except CollectionError:  # or KeyError
            return ()
        return ...  # previous logic in `get_anchors`

The config_file_path argument in get_handler functions is deprecated. Use tool_config.get('config_file_path') instead.

The config_file_path argument is now deprecated and only passed to get_handler functions if they accept it. If you used it to compute a "base directory", you can now use the tool_config argument instead, which is the configuration of the SSG tool in use (here MkDocs):

base_dir = Path(tool_config.config_file_path or "./mkdocs.yml").parent

Most of these warnings will disappear with the next version of mkdocstrings-python.

Bug Fixes
  • Update handlers in JSON schema to be an object instead of an array (3cf7d51 by Matthew Messinger). Issue-733, PR-734
  • Fix broken table of contents when nesting autodoc instructions (12c8f82 by Timothée Mazzucotelli). Issue-348
Code Refactoring
  • Pass config_file_path to get_handler if it expects it (8c476ee by Timothée Mazzucotelli).
  • Give back inventory control to handlers (b84653f by Timothée Mazzucotelli). Related-to-issue-719
  • Give back control to handlers on how they want to handle global/local options (c00de7a by Timothée Mazzucotelli). Issue-719
  • Deprecate base handler's get_anchors method in favor of get_aliases method (7a668f0 by Timothée Mazzucotelli).
  • Register all identifiers of rendered objects into autorefs (434d8c7 by Timothée Mazzucotelli).
  • Use mkdocs-get-deps' download utility to remove duplicated code (bb87cd8 by Timothée Mazzucotelli).
  • Clean up data passed down from plugin to extension and handlers (b8e8703 by Timothée Mazzucotelli). PR-726

v0.27.0

Compare Source

Compare with 0.26.2

Features
Performance Improvements
  • Reduce footprint of template debug messages (5648e5a by Timothée Mazzucotelli).
Code Refactoring
  • Use %-formatting for logging messages (0bbb8ca by Timothée Mazzucotelli).

v0.26.2

Compare Source

Compare with 0.26.1

Build
  • Drop support for Python 3.8 (f26edeb by Timothée Mazzucotelli).

v0.26.1

Compare Source

Compare with 0.26.0

Bug Fixes
  • Instantiate config of the autorefs plugin when it is not enabled by the user (db2ab34 by Timothée Mazzucotelli). Issue-autorefs#57

v0.26.0

Compare Source

Compare with 0.25.2

Build
  • Upgrade Python-Markdown lower bound to 3.6 (28565f9 by Timothée Mazzucotelli).
Dependencies
  • Depend on mkdocs-autorefs v1 (33aa573 by Timothée Mazzucotelli).
Features

v0.25.2

Compare Source

Compare with 0.25.1

Code Refactoring
  • Give precedence to Markdown heading level (##) (2e5f89e by Timothée Mazzucotelli).

v0.25.1

Compare Source

Compare with 0.25.0

Bug Fixes

v0.25.0

Compare Source

Compare with 0.24.3

Features
  • Support once parameter in logging methods, allowing to log a message only once with a given logger (1532b59 by Timothée Mazzucotelli).
  • Support blank line between ::: path and YAML options (d799d2f by Timothée Mazzucotelli). Issue-450
Code Refactoring
  • Allow specifying name of template loggers (c5b5f69 by Timothée Mazzucotelli).

v0.24.3

Compare Source

Compare with 0.24.2

Bug Fixes
  • Support HTML toc labels with Python-Markdown 3.6+ (uncomment code...) (7fe3e5f by Timothée Mazzucotelli).

v0.24.2

Compare Source

Compare with 0.24.1

Bug Fixes

v0.24.1

Compare Source

Compare with 0.24.0

Code Refactoring

v0.24.0

Compare Source

Compare with 0.23.0

Features
Bug Fixes
Code Refactoring
  • Drop support for MkDocs < 1.4, modernize usages (b61d4d1 by Oleh Prypin). PR #​629

v0.23.0

Compare Source

Compare with 0.22.0

Breaking Changes
  • Removed BaseCollector and BaseRenderer classes: they were merged into the BaseHandler class.
  • Removed the watch feature, as MkDocs now provides it natively.
  • Removed support for selection and rendering keys in YAML blocks: use options instead.
  • Removed support for loading handlers from the mkdocstrings.handler namespace.
    Handlers must now be packaged under the mkdocstrings_handlers namespace.
Features
  • Register all anchors for each object in the inventory (228fb73 by Timothée Mazzucotelli).
Bug Fixes
  • Don't add codehilite CSS class to inline code (7690d41 by Timothée Mazzucotelli).
  • Support cross-references for API docs rendered in top-level index page (b194452 by Timothée Mazzucotelli).
Code Refactoring
  • Sort inventories before writing them to disk (9371e9f by Timothée Mazzucotelli).
  • Stop accepting sets as return value of get_anchors (only tuples), to preserve order (2e10374 by Timothée Mazzucotelli).
  • Remove deprecated parts (0a90a47 by Timothée Mazzucotelli).
  • Use proper parameters in Inventory.register method (433c6e0 by Timothée Mazzucotelli).

v0.22.0

Compare Source

Compare with 0.21.2

Features
Code Refactoring

v0.21.2

Compare Source

Compare with 0.21.1

Bug Fixes

v0.21.1

Compare Source

Compare with 0.21.0

Bug Fixes
  • Fix missing typing-extensions dependency on Python less than 3.10 (bff760b by Timothée Mazzucotelli). Issue #​548

v0.21.0

Compare Source

Compare with 0.20.0

Features

v0.20.0

Compare Source

Compare with 0.19.1

Features
Bug Fixes
Code Refactoring

v0.19.1

Compare Source

Compare with 0.19.0

Bug Fixes
Code Refactoring

v0.19.0

Compare Source

Compare with 0.18.1

Highlights

We decided to deprecate a few things to pave the way towards a more
stable code base, bringing us closer to a v1.

  • Selection and rendering options are now combined into a single
    options key. Using the old keys will emit a deprecation warning.
  • The BaseCollector and BaseRenderer classes are deprecated in favor
    of BaseHandler, which merges their functionality. Using the old
    classes will emit a deprecation warning.

New versions of the Python handler and the legacy Python handler
were also released in coordination with mkdocstrings 0.19.
See their respective changelogs:
python,
python-legacy.
Most notably, the Python handler gained the members and filters options
that prevented many users to switch to it.

mkdocstrings stopped depending directly on the legacy Python handler.
It means you now have to explicitely depend on it, directly or through
the extra provided by mkdocstrings, if you want to continue using it.

Packaging / Dependencies
  • Stop depending directly on mkdocstrings-python-legacy (9055d58 by Timothée Mazzucotelli). Issue #​376
Features
Code Refactoring
  • Support options / deprecated options mix-up (7c71f26 by Timothée Mazzucotelli).
  • Deprecate watch feature in favor of MkDocs' built-in one (c20022e by Timothée Mazzucotelli).
  • Log relative template paths if possible, instead of absolute (91f5f83 by Timothée Mazzucotelli).
  • Deprecate selection and rendering YAML keys (3335310 by Timothée Mazzucotelli). PR #​420
  • Deprecate BaseCollector and BaseRenderer (eb822cb by Timothée Mazzucotelli). PR #​413

v0.18.1

Compare Source

Compare with 0.18.0

Bug Fixes
  • Don't preemptively register identifiers as anchors (c7ac043 by Timothée Mazzucotelli).

v0.18.0

Compare Source

Compare with 0.17.0

Highlights
Packaging / Dependencies
  • Add Crystal extra, update Python extras versions (b8222b0 by Timothée Mazzucotelli). PR #​374
  • Update autorefs to actually required version (fc6c7f6 by Timothée Mazzucotelli).
  • Drop Python 3.6 support (7205ac6 by Timothée Mazzucotelli).
Features
  • Allow unwrapping the <p> tag in convert_markdown filter (5351fc8 by Oleh Prypin). PR #​369
  • Support handlers spanning multiple locations (f42dfc6 by Timothée Mazzucotelli). PR #​355
Code Refactoring

v0.17.0

Compare Source

Compare with 0.16.2

Features
Bug Fixes
Code Refactoring

v0.16.2

Compare Source

Compare with 0.16.1

Dependencies
  • Support pymdown-extensions v9.x (0831343 by Ofek Lev and 38b22ec by Timothée Mazzucotelli).

v0.16.1

Compare Source

Compare with 0.16.0

Bug Fixes
  • Fix ReadTheDocs "return" template (598621b by Timothée Mazzucotelli).

v0.16.0

Compare Source

Compare with 0.15.0

Features
Bug Fixes
Code Refactoring
  • Move writing extra files to an earlier stage in the build (3890ab5 by Oleh Prypin). PR #​275

Configuration

📅 Schedule: Branch creation - "* 0-3 * * *" (UTC), Automerge - At any time (no schedule defined).

🚦 Automerge: Enabled.

Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@renovate renovate bot requested a review from billsioros as a code owner March 13, 2025 01:21
@renovate renovate bot added the 🎲 dependencies Working on dependencies label Mar 13, 2025
@renovate
Copy link
Author

renovate bot commented Mar 13, 2025

⚠️ Artifact update problem

Renovate failed to update an artifact related to this branch. You probably do not want to merge this PR as-is.

♻ Renovate will retry this branch, including artifacts, only when one of the following happens:

  • any of the package files in this branch needs updating, or
  • the branch becomes conflicted, or
  • you click the rebase/retry checkbox if found above, or
  • you rename this PR's title to start with "rebase!" to trigger it manually

The artifact failure details are included below:

File name: poetry.lock
Creating virtualenv dotify-goMkGsqJ-py3.13 in /home/ubuntu/.cache/pypoetry/virtualenvs
Updating dependencies
Resolving dependencies...


The current project's Python requirement (>=3.7,<4.0) is not compatible with some of the required packages Python requirement:
  - mkdocstrings requires Python >=3.9, so it will not be satisfied for Python >=3.7,<3.9

Because mkdocstrings (0.29.0) requires Python >=3.9
 and no versions of mkdocstrings match >0.29.0,<0.30.0, mkdocstrings is forbidden.
So, because dotify depends on mkdocstrings (^0.29.0), version solving failed.

  • Check your dependencies Python requirement: The Python requirement can be specified via the `python` or `markers` properties
    
    For mkdocstrings, a possible solution would be to set the `python` property to ">=3.9,<4.0"

    https://python-poetry.org/docs/dependency-specification/#python-restricted-dependencies,
    https://python-poetry.org/docs/dependency-specification/#using-environment-markers

@stale
Copy link

stale bot commented Mar 20, 2025

This issue has been marked stale, as it had no activity in the last 7 days. If the issue remains stale for an additional 7 days (a total of two weeks with no activity), it will be automatically closed.

@stale stale bot added the 💀 stale This had no recent activity label Mar 20, 2025
@stale
Copy link

stale bot commented Mar 27, 2025

Closing the issue due to inactivity.

@stale stale bot closed this Mar 27, 2025
@renovate
Copy link
Author

renovate bot commented Mar 27, 2025

Renovate Ignore Notification

Because you closed this PR without merging, Renovate will ignore this update (^0.29.0). You will get a PR once a newer version is released. To ignore this dependency forever, add it to the ignoreDeps array of your Renovate config.

If you accidentally closed this PR, or if you changed your mind: rename this PR to get a fresh replacement PR.

@renovate renovate bot deleted the renovate/mkdocstrings-0.x branch March 27, 2025 03:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🎲 dependencies Working on dependencies 💀 stale This had no recent activity

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants