Implementing a Plugin System in Python

后端 未结 2 1079
孤独总比滥情好
孤独总比滥情好 2021-02-15 12:13

I am writing an application (a server wrapper for Minecraft) that I wish to make extensible with plugins. I have a system in place that works, however I think that in the long r

2条回答
  •  [愿得一人]
    2021-02-15 12:24

    I would suggest to use setuptools, because plugins are linked eventually to the management of the sys.path list:

    http://peak.telecommunity.com/DevCenter/PkgResources

    In the long run, a distribution/packaging based solution like setuptools would always be a solid choice since:

    • you have to load plugins without conflicts or missing requirements,
    • even if the plugins loaded depend themselves on other dynamic dependencies, and
    • you have to keep the list of available plugins updated as packages are installed and removed.

提交回复
热议问题