ManimCommunity / ManimCommunity/manim
Using pluggy for managing Plugins
- Dominant language
- Python
- Stars
- 40.9k
- Forks
- 3.1k
- Avg merge
- 3d 12h
- Merged PRs (30d)
- 25
Description
## Enhancement proposal
Pluggy: https://pluggy.readthedocs.io/
Currently how out plugin system works is
- Get the list of plugins from the user config file
- Add them to the global namespace, so when the user does `from manim import *` the plugin will also be imported.
- Has no possible way to extend parts of the library without monkey patching or making a new subclass out of the original one. See how `manim-onlinetex` does this currently, https://github.com/ManimCommunity/manim-onlinetex/blob/38ed76c55f387e9205beeb28307a634b46691df1/src/manim_onlinetex/manim_onlinetex.py#L109
With pluggy in place, we can decide the parts of the library which can be extendable without subclassing, see an example. https://pluggy.readthedocs.io/en/latest/#a-toy-example
And it feels like we shouldn't reinvent the wheel rather than using something which is already available.
## Additional comments
This would kinda require all the plugins to update to use pluggy. Let the previous implementation of importing to global namespace stay, for backward compatibility.
---
Proof of concept
- #2635
Contributor guide
Research direction
Review the existing plugin behavior described in the issue, the manim-onlinetex example, Pluggy's toy example, and proof of concept #2635. Define the supported extension points and the backward-compatibility and plugin-migration criteria before implementation; the issue does not name specific repository files or tests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- developer-experience
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100