Plugin System#
Pyccel’s plugin system is built on pluggy.
How it works#
Available hooks are declared in pyccel/plugins/hookspecs.py. Plugins implement the three hooks required for the command line interface, as well as any additional hooks relevant for the functionality. The helpers in pyccel/plugins/plugin_tools.py build augmented parser/codegen/wrapping classes by layering plugin methods on top of the base classes.
Writing a plugin#
Create a module that imports
hookimplfrompycceland decorates each hook implementation with it.Publish it as a Python package with the entry-point
pyccel(seepluggydocs and setuptools docs for more information).
Built-in plugins#
Plugin |
Location |
Purpose |
|---|---|---|
|
[ |
Inserts source-line comments into generated code |
Note#
The set of available hooks is still evolving. Always check hookspecs.py for the current interface.