Alex Rivera | Logout

Alternative implementations of python/setuptools entry points (extensions) in other languages/applications

Asked 2011-08-13T15:58:25.600
51

While this question has a python backend, the question is not tied to python itself, but rather about extension mechanisms and how to register/lookup for plugins.

In python, the concept of entrypoints was introduced by setuptools, and is tied to the metadata of installed python distributions (called packages in other packaging systems).

As of my understanding, one of the features provided by entrypoints is to allows an application to define a place where others can put things in, so any application wanting to use an entrypoint can get a list of registered classes/functions there. Let's take an example:

  • Foo defines the entrypoint "entrypoint1" and look for plugins registered under this name.
  • Bar register a callable (Bar.callable) on the "entrypoint1" entrypoint.
  • Any python script is then able to list Bar.callable as one of the registered callables for "entrypoint1".

With setuptools, applications registers entrypoints at install time and the information is stored in metadata related to packaging, called .egginfo (which usually contain information about the distribution name, its dependencies, and some more metadata about packaging).

I have the feeling that packaging metadata is not the right place to store this kind of information, as I don't get why this information is tied to packaging.

I'm curious to hear about such entrypoints/extensions/plugins features in other languages, and especially if the concept is tied to metadata and packaging or not. And so the question is…

Do you have examples I should look at? Could you explain why the design choices have been made that way?

Can you see different ways to handle this problem? Do you know how this problem has already been solved in different tools? What are the downsides and the advantages of the current python implementation over others?

Edit
Report

1 Answer

0

As you started out speaking about programming language implementation / processing, it may be worth noting that recently gcc acquired plugin capabilities too.

answered 2011-08-19T13:52:02.357

Your Answer