Opened 12 years ago
Last modified 10 years ago
#696 accepted enhancement
Version checking against MediaGoblin for plugins
| Reported by: | Christopher Allan Webber | Owned by: | |
|---|---|---|---|
| Priority: | minor | Milestone: | |
| Component: | programming | Keywords: | pluginapi |
| Cc: | Parent Tickets: |
Description
It would be nice if plugins could verify that they're compatible with the running version of MediaGoblin before they're turned on.
Change History (4)
comment:1 by , 12 years ago
| Status: | new → accepted |
|---|
comment:2 by , 12 years ago
comment:3 by , 12 years ago
Seems like a good solution. I'd love to try this soonish... if someone wants to try to turn this into a real patch though, a branch would be most welcome :)
comment:4 by , 10 years ago
| Type: | defect → enhancement |
|---|

One option is to use a generic
requires.txtin the plugin's directory and let mediagoblin check that at load/install/unit-testing time.Here's possible code to check this (see http://stackoverflow.com/q/15928101/1890086):
def checkfeature(feature): everything_okay = True f = pkg_resources.resource_stream(feature, "requires.txt") with f: for r in pkg_resources.parse_requirements(f): if pkg_resources.working_set.find(r) is None: print "%r not found, please install, otherwise this feature does not work" % (r,) everything_okay = False return everything_okayThis is one option to resolve this ticket.