Opened 7 years ago

Last modified 4 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.

Subtickets

Change History (4)

comment:1 Changed 7 years ago by Christopher Allan Webber

Status: newaccepted

comment:2 Changed 7 years ago by Elrond

One option is to use a generic requires.txt in 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_okay

This is one option to resolve this ticket.

comment:3 Changed 6 years ago by Christopher Allan Webber

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 Changed 4 years ago by Loic Dachary

Type: defectenhancement
Note: See TracTickets for help on using tickets.