You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[FEATURE REQUEST] Salt's Entry Points should not need to be a callable #58939
This forces 3rd-party extensions to define a function which will return a list of paths from where the salt loader can then load modules.
Commonly, these 3rd-party extensions define all their loader related modules under a single package, to there's really no need for the entry point
to return a function, it can just return the module.
For example, on setup.cfg:
@max-arnold the current entrypoints is not going away. Worst case it will be on a deprecation path for a long time.
@dwoz your suggestion forces each loader to know the entrypoint name and at least an os.path.exists for each loader against the 3rd-party package. It also forces a directory layout for the 3rd-party package.
What's really the problem with the new way of defining entrypoints?
It's something you do and usually are done with it....
I think that your approach will likely make it harder to support both sintaxes, but I could be wrong.
Activity
dwoz commentedon Nov 17, 2020
Something seems weird about this to me. Generally when I've seen entrypoint used they pass the name of the plugin.
The way I saw this pan out was just use conventions to find the directories
max-arnold commentedon Nov 17, 2020
I've seen at least one project that uses this feature:
https://gitlab.com/spirostack/spirofs/-/blob/master/setup.py#L68-78
https://gitlab.com/spirostack/spirofs/-/blob/master/spirofs/loader.py
s0undt3ch commentedon Nov 17, 2020
@max-arnold the current entrypoints is not going away. Worst case it will be on a deprecation path for a long time.
@dwoz your suggestion forces each loader to know the entrypoint name and at least an
os.path.existsfor each loader against the 3rd-party package. It also forces a directory layout for the 3rd-party package.What's really the problem with the new way of defining entrypoints?
It's something you do and usually are done with it....
I think that your approach will likely make it harder to support both sintaxes, but I could be wrong.
s0undt3ch commentedon Nov 17, 2020
I'll see what changes are required to get a better opinion on your approach
Support loading entrypoints by passing a module instead of a function.