0

I'm working on a plugin system and was thinking of simply using a setup.py file for each 'plugin' since it's already an existing dependency. The thing is, I need a way to test requirements.

Is there already an existing API in place for this, or would it make more sense just to roll a custom system and check it manually?

William Chambers
  • 499
  • 2
  • 13

1 Answers1

2

setup.py is a script, and you can't generally parse that to figure out requirements, especially since some setup scripts will change the requirements depending on the python version used to run them.

There is an upcoming standard that will fix this: PEP 345. At this point in time very few packages make use of this though. For more information on this topic you can look at the distutils-sig list archives where this topic has come up several times.

Have you looked at egg entry points? They basically implement a plugin system that you can use directly. This stackoverflow question has some information that might be interesting.

Community
  • 1
  • 1
Wichert Akkerman
  • 4,918
  • 2
  • 23
  • 30