-
Notifications
You must be signed in to change notification settings - Fork 8
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
Feat/plugin install #69
base: main
Are you sure you want to change the base?
Conversation
plugins can now be created as a type of addon adds regexes to convert from a repo or zip to a plugin with a source tests nearly all of the added code.
70cf1a5
to
a023c07
Compare
this is too involved to fix right now Solution involves returning zip files, but the changes to do that require commiting a zipfile, or zipping a zip file before the test. But the contents of that zipfile should be the expected format, so there needs to be several mock files for that. But then they should be in a test resources directory But then the test resources directory should have a few helper methods But then the test resources will need a large amount of review. So the short is, there is a fix for these tests, but it adds a subsystem and is out of scope of this pr.
a023c07
to
d96d7a7
Compare
a2c61c1
to
550764d
Compare
6a79437
to
1ebbed3
Compare
Linting workflows are going to fail until this is merged with main again due to how github merges then and a dependency mismatch. Given that there's so many merge commits already, I'm holding off on a merge until later. |
1ebbed3
to
bb9d3f8
Compare
This reverts commit 1c88421. Not part of the scope of this pr. Also should not have been here but a rebase would change more history than I want to change.
@@ -0,0 +1,29 @@ | |||
# NOTICE: This file is automatically generated by scripts/export_requirements.py |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file may not be needed. Currently discussing internally.
- don't require future annotations in modmail/addons/converters.py - make all `__all__` tuples - set score cutoff to a constant in modmail/addons/models.py - compress if statements - use {} in place of dict() - fix typos in some docstrings - use correct typehints where they are incorrect - decode the stderr stream only once in pip install - remove unnecessary logging debug statements - restructure finding plugins to be easy to be easier to read - use set() where previously it was {}. This would cause the variable to be of the wrong type
depends on #74
Relevant Issues
Closes #54
Closes #62
Closes #63
Overview
Installation system for plugins. Portions of this may be used in the future for other addons, so nearly everything up to when the import is done should be in an addons.py utility file.
The currently supported type of repos are in zip format, using the following structure:
This gives the advantage to be able to extend the addons api in the future without having to worry about the structure of the repo.
A sample repository is viewable here: onerandomusername/modmal-addons, with a clone to gitlab/onerandomusername/modmal-addons
Details
Provided a github or gitlab repo, parses it to get the specific plugin information, if it exists, from the plugin.toml file.
The plugin.toml file is supplemental to the folders, meaning that the nature of the toml file existing does not override the existing plugins.
Rather than provide a list of all of the features here, I recommend checking out the documentation for this pull request, found here: https://discord-modmail.readthedocs.io/en/feat-plugin-install/addons/