Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RFC: Pull in plugins from External Modules #202

Open
5 tasks
imnotjames opened this issue Sep 13, 2018 · 0 comments
Open
5 tasks

RFC: Pull in plugins from External Modules #202

imnotjames opened this issue Sep 13, 2018 · 0 comments

Comments

@imnotjames
Copy link
Contributor

imnotjames commented Sep 13, 2018

I'm opening this to go over a feature I'm working on that requires a bit of a change on the internals of skybot, so I thought it'd be best to open an RFC issue before I go and start throwing the pull requests out there.

I have been wanting to pull in plugins from external modules. Why? Because there are plugins that I have that I'd like to share - plugins which are useful (or useless but funny) but which I don't think fit in with the main skybot repository. They might require external modules (like a few reddit plugins I've made or the amazon plugin) or are just less useful for other folks (a plugin for an in-joke with the IRC channels the bot runs on).

I'm also be interested in pulling skybot as a dependency of a separate application so we can extend on top of it without having to copy all the files and adding in custom plugins with a simple install (eg teampeggle/ppp-helpdesk). Right now it's painful because I have to manually sync all the changes.

It is possible to do this! I've been experimenting with a few things to do this, which mostly entails cleaning up the codebase:

  • Make skybot run as a package rather than as a bunch of scripts Move skybot into its own "Package" directory #183
  • Clean up skybot's imports / reloader so they stop abusing globals WIP
  • Clean up the hook API on functions (stop over-polluting the function properties)
  • Update the reloader to pull in plugins via module name rather than filename
  • Add a configuration value to specify plugins to pull in via module

Ideally, the configuration for specifying plugins would default to all plugins under skybot.plugins.* (backwards compatibility), and if specified would then start pulling in plugins to use, setting up the reloader, etc.

After these are complete, any module within the python path can be used as a plugin! EG, if you were to pip install skybot-plugin-awesome, you could pull it in as a fantastic new plugin without copying it to the plugins directory!

Thoughts, concerns, etc?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant