[17:11:54] <rindolf> andr_: FFY00 : hi - i am back
[18:59:34] <toad_polo> Does anyone know the history of how entry points came to require a function and to disallow a module name?
[19:00:03] <toad_polo> I originally thought it would be difficult to actually execute a module, but it seems like it would be easy enough to generate a script that uses `runpy`.
[19:06:07] <FFY00> different modules for multiple entrypoints seems severely overkill
[19:15:35] <toad_polo> I'm saying why is it forbidden to use a module.
[19:16:20] <toad_polo> Like if you are already exposing all your entry points via `python -m <entrypoint>`, then you already have module references. You could point `console_scripts` at them and it would be unambiguous what to do with them.
[20:06:13] <dstufft> toad_polo: you're thinking too much specific to console scripts I think
[20:06:52] <dstufft> remember entry points are a generic extension mechanicism, one of the examples in the docs IIRC is loading different renderers for content at runtime
[20:07:42] <toad_polo> dstufft: The spec has console scripts explicitly called out as special.
[20:08:55] <toad_polo> And things other than console scripts can take arbitrary object references including modules.
[20:10:46] <dstufft> toad_polo: there's also some history too, I don't think -m existed until... 2.4? I'm pretty sure this predates 2.4, or at least predates 2.4+ being ubiquitous, and -m didn't support running from inside of a package (rather than a single file modulee) untill.. 2.5? 2.6?
[20:11:24] <toad_polo> Interesting, so entry points predates -m?
[20:11:59] <dstufft> Or they were developed around the same time
[20:12:31] <toad_polo> I wonder if we'd be able to swing adding support for modules into entry points at this point. Probably not easily
[20:12:55] <dstufft> https://www.python.org/dev/peps/pep-0338/ says that -m on a package was added in 2.5, and the -m support in 2.4 didn't work inside zipimport, which was probably a problem for .eggs
[20:13:04] <toad_polo> You'd need to do something like specify them in a different way and deprecate the old way, while maintaining shim scripts.
[20:14:02] <dstufft> It's probably not worthwhile tbh, I mean I don't want to discourage you if you feel like it'd be useful, but to me personally that feels like a lot of effort to save one needless function
[20:14:38] <dstufft> I just end up making my __main__.py files nothing but an import and a function call anyways
[20:14:54] <toad_polo> Yeah I agree it's not worth it.
[20:15:05] <toad_polo> Just was brainstorming to see if it would be difficult.
[20:15:22] <toad_polo> Probably worthwhile if we ever do a revamp of the entry points system for other reasons.
[20:16:59] <toad_polo> It's also possible (but I wouldn't recommend it) for backends to support it anyway by auto-generating a module with a function in it that executes the module.