Skip to content
This repository has been archived by the owner on May 2, 2024. It is now read-only.

Why are official plugins installed differently than entrypoint plugins? #37

Closed
kdmccormick opened this issue Jan 31, 2022 · 2 comments
Closed
Labels
code health Proactive technical investment via refactorings, removals, etc. discovery Pre-work to determine if an idea is feasible

Comments

@kdmccormick
Copy link
Collaborator

kdmccormick commented Jan 31, 2022

Context

There are three types of plugins:

  1. DictPlugins: simple YAML files placed at plugin root.
  2. EntrypointPlugins: Python projects; when installed, they expose plugin(s) via the tutor.plugin.v0 setup.py entrypoint.
  3. OfficialPlugins: Python projects; Tutor loads a hard-coded list of them in main.py.

Why is the OfficialPlugin path necessary? Could Tutor instead just treat the official plugins like any other EntrypointPlugin, using a hard-coded list of plugins to enable by default?

Potential benefits:

  • tutor repo users (eg nightly users) get the same plugin experience as pip install tutor users
  • plugin loader implementation simplicity

Acceptance

See @regisb's comment bellow explaining why OfficialPlugin is used. See whether EntrypointPlugin could be used at the build step reliably instead.

  • If so: Replace OfficialPlugin usage at the build step with EntrypointPlugin usage.
  • If not: Add a note to the OfficialPlugin and/ortutor/main.py docstrings explaining their necessity.
@regisb
Copy link

regisb commented Feb 1, 2022

A couple assumptions are made about OfficialPlugin instances:

  1. The plugin import path is tutor{plugin_name}.plugin.
  2. Their version number is defined as tutor{plugin_name}.__about.__version__.

Not all Python plugins generated by the plugin cookiecutter would follow this pattern, so we should not make these assumptions for all plugins.

These assumptions allow us to load these plugins explicitly with OfficialPlugin.load when building the binary bundle with pyinstaller. I forget why I didn't go with EntrypointPlugin, but I believe it has to do with the fact that we cannot reliably iterate on entrypoints during the build step.

@kdmccormick kdmccormick added plugin-api discovery Pre-work to determine if an idea is feasible labels Feb 1, 2022
@kdmccormick kdmccormick moved this from Ungroomed to Groomed in Tutor DevEnv Adoption (OLD BOARD) Feb 9, 2022
@kdmccormick kdmccormick added code health Proactive technical investment via refactorings, removals, etc. and removed 🏗️ refactor labels May 31, 2023
@kdmccormick
Copy link
Collaborator Author

This doesn't seem important.

@kdmccormick kdmccormick closed this as not planned Won't fix, can't repro, duplicate, stale Mar 28, 2024
@github-project-automation github-project-automation bot moved this from 📋 To Do to 🚀 Closed in Tutor DevEnv Adoption Mar 28, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
code health Proactive technical investment via refactorings, removals, etc. discovery Pre-work to determine if an idea is feasible
Projects
None yet
Development

No branches or pull requests

2 participants