Skip to content

Add plugin system with hooks to override doctype transpilation - #130

Merged
lagru merged 13 commits into
scientific-python:mainfrom
lagru:plugin-system
Nov 4, 2026
Merged

lagru merged 13 commits into
scientific-python:mainfrom
lagru:plugin-system

Conversation

@lagru

@lagru lagru commented Nov 3, 2026 •

Copy link
Copy Markdown
Member

Adds a plugin system based on pluggy. For now, we only allow plugins as standalone Python files that must be explicitly loaded in the configuration.

Closes #114, since this PR makes expansions like requested in #114 possible (see this plugin example).

Also includes some performance improvements (caching of doctypes per worker)
and a good amount of refactoring to make this possible. 😮‍💨

Release note

For maintainers and optionally contributors, please refer to changelist's README on how to document this PR for the release notes.

Add a new plugin system to Docstub with 2 hooks.
These hooks allow overriding/extending the default grammar and 
transformer that are used to transform doctypes into annotations.
Add a minimal guide and documentation too.
{label="enhancement"}
Cache transformed doctypes in each worker.
Aggregated cache statistics are printed when showing debug
information (`-vv` option).
{label="performance"}

@lagru lagru added this to the v0.7 milestone Nov 3, 2026
@lagru lagru added the enhancement New feature or functionality label Nov 3, 2026
@lagru
lagru marked this pull request as ready for review November 4, 2026 14:17
@lagru
lagru merged commit d61ea7b into scientific-python:main Nov 4, 2026
9 checks passed
@lagru
lagru deleted the plugin-system branch November 4, 2026 14:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add a more powerful pre-processing before parsing doctypes

1 participant