Skip to content

Plugin factory #1524

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

David-Baddeley
Copy link
Contributor

Adds a factory for templating user plugins. Should ultimately replace https://github.com/python-microscopy/pyme-plugin, which has suffered a bit from bitrot. Main differences to https://github.com/python-microscopy/pyme-plugin:

  • uses new (current) module config which puts all the module related config stuff in one .yaml file rather than spread across many text files
  • avoids having to manually change package_name in umpteen places
  • has example code for the various plugin types, rather than just empty files.

Usage

python -m PYME.util.plugin_factory output_directory package_name

Defaults to creating all types of plugin (except reports), but that can be altered with optional command line flags:

usage: plugin_factory.py [-h] [--pymeimage PYMEIMAGE] [--pymevis PYMEVIS] [--recipe RECIPE] [--fit_factories FIT_FACTORIES] [--reports REPORTS] output_dir package_name

Create a template for a PYME plugin

positional arguments:
  output_dir            Directory to write the plugin template to
  package_name          Name of the package

optional arguments:
  -h, --help            show this help message and exit
  --pymeimage PYMEIMAGE
                        Create a PYMEImage plugin with the given name
  --pymevis PYMEVIS     Create a PYMEVisualize plugin with the given name
  --recipe RECIPE       Create a recipe module with the given name
  --fit_factories FIT_FACTORIES
                        Create a fit factory with the given name
  --reports REPORTS     Create a reports module with the given name

@csoeller
Copy link
Contributor

Just checking the status of this PR. I had a couple of people asking me about plugin writing and was wondering how far this PR is from becoming the preferred approach to get into it.

PS - WIth setuptools phase out this may ultimately need updating to the replacement build system but presumably still some time away??

@csoeller
Copy link
Contributor

To answer my own question - the factory is 99% functional but needs some tweaks to fix typos and other small glitches. I'll try to some up with patches and raise a PR against the parent branch of this PR if I can figure this out...

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

Successfully merging this pull request may close these issues.

2 participants