Search code examples
pythonpluginspackagesetuptools

setuptools: add entry points from several packages in the same group


I want to add several plugins in the same entry points group with setuptools.

package1:

setup(                                                                                       
    py_modules=['api', 'internal'],                       
    entry_points={'parsers': ['dummy1 = api:DummyAPI1', ]}
 )                                                        

package2:

setup(                                                                                    
        py_modules=['api', 'internal'],                     
        entry_points={'parsers': ['dummy2 = api:DummyAPI2', ]}
     )                                                      

After installation of a both plugins I have the only last installed entry point. Is it expected behavior? Can I add several plugins in the same group from different packages?


Solution

  • I found. I'm a lazy dude - I didn't added a name argument to a setup function call in both of packages. By default a name is UNKNOWN. Obvious that both of the packages had the same name so for a system these are the same package so setuptools overwritten the group.

    Always use name argument for setup method.