Repository navigation
Conversation
| will be available. Executing this command will do the equivalent of | ||
| ``import sys; from spam import main_cli; sys.exit(main_cli())``. | ||
|
|
||
| Script entry points must use the ``module:object`` form. The object |
There was a problem hiding this comment.
Per EPS, this is called an "object reference." I think we should probably use that language consistently and link to it as well:
| Script entry points must use the ``module:object`` form. The object | |
| Script entry points are written as object references like ``importable.module``, or importable.module:object.attr``. The object |
Ref: https://packaging.python.org/en/latest/specifications/entry-points/#data-model
| reference should point to a function that can be called with no arguments, | ||
| not to a module by itself. |
There was a problem hiding this comment.
This is de facto true (I think), but in principle I think script entry points can be modules if the user does something cursed like forcefully instantiating a callable module instance.
Not sure if that's worth qualifying though, the "should" is probably good enough 🙂
|
Updated this to use the object reference terminology, link to the entry points spec, and avoid requiring the target to be strictly a function. |
rgommers
left a comment
There was a problem hiding this comment.
This isn't mergeable. Language like "should usually ..." is too imprecise for a spec. I don't see much effort here in trying to figure out the history, so I'm inclined to close this.
Closes python#1993 Supersedes and closes python#2060
Fixes #1993.
Summary:
Checks:
📚 Documentation preview 📚: https://python-packaging-user-guide--2060.org.readthedocs.build/en/2060/