[PROPOSAL] Plugin Discovery and Namespace Code Structure#130
Open
gustavorps wants to merge 1 commit into
Open
Conversation
…ability and maintainability
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces a new plugin-based architecture for enrichers in the Flowsint project, leveraging Python's entry points and lazy loading to improve modularity and startup performance. It also adds new workspace package configurations and updates Python version requirements. The most important changes are grouped below:
Plugin architecture and lazy loading
flowsint.enricher.util.importlib, enabling modules and entry points to be loaded only when first accessed, which reduces unnecessary imports and speeds up startup.flowsint.enricher.__init__.pyto discover and lazily load plugins via entry points, printing loaded plugins and registry contents for debugging.EnricherABCinflowsint.enricher.abc.py, which automatically registers subclasses with the enricher registry, supporting plugin discovery and registration.Example plugin implementation
flowsint-example-pluginwith entry point configuration and a sampleEnricherclass, demonstrating the new plugin system and type annotations for input/output. [1] [2] [3]Workspace and core package changes
pyproject.tomlfiles forflowsint-core-next,flowsint-enrichers-next, andflowsint-types-next, specifying Python version requirements and editable sources for modular development. [1] [2] [3]__init__.pyfiles to expose relevant symbols and updated the Python version to 3.13 in.python-versionfor compatibility with new features. [1] [2] [3]Redis connection initialization fix
EventEmitterby adding aconnect()method, preventing premature connection during module import and fixing issues when importing enrichers. [1] [2]These changes lay the foundation for a scalable, plugin-based enrichment system with improved dependency management and startup efficiency.
How to test the PR