<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On 20 October 2017 at 07:33, Donald Stufft <span dir="ltr"><<a href="mailto:donald@stufft.io" target="_blank">donald@stufft.io</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div style="overflow-wrap: break-word;"><span class="gmail-"><br><div><blockquote type="cite"><div>On Oct 19, 2017, at 5:26 PM, Tres Seaver <<a href="mailto:tseaver@palladion.com" target="_blank">tseaver@palladion.com</a>> wrote:</div><br class="gmail-m_5419924609431953797Apple-interchange-newline"><div><span style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;float:none;display:inline">Having the packaging</span><br style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><span style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;float:none;display:inline">system register those services at installation time (even if it doesn't</span><br style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><span style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;float:none;display:inline">care otherwise about them) seems pretty reasonable to me.</span></div></blockquote></div><br></span><div>It does register them at installation time, using an entirely generic feature of “you can add any file you want to a dist-info directory and we will preserve it”. It doesn’t need to know anything else about them other then it’s a file that needs preserved.</div></div></blockquote><div><br></div><div>That's all the *installer* needs to know. Publishing tools like flit need to know the internal format in order to replicate the effect of <a href="https://packaging.python.org/tutorials/distributing-packages/#console-scripts">https://packaging.python.org/tutorials/distributing-packages/#console-scripts</a> and to interoperate with any other pkg_resources based plugin ecosystem.</div><div><br></div><div>I personally find it useful to think of entry points as a pub/sub communications channel between package authors and other runtime components.</div><div><br></div><div>When you use the entry points syntax to declare a pytest plugin as a publisher, your intended subscriber is pytest, and pytest defines the possible messages. Ditto for any other entry points based plugin management system.</div><div></div><div><div><br><div>Installers are mostly just a relay 
link in that pub/sub channel - they take the entry point announcement messages in
 the sdist or wheel archive, and pass them along to the installation 
database.</div><div><br></div></div><div>The one exception to the "installers as passive relay" behaviour is that when you specify "console_scripts", your 
intended subscribers *are* package installation tools, and your message is "I'd 
like an executable wrapper for these entry points, please".</div><div></div></div><div><br></div><div>Right now, the only documented publishing API for 
that pub/sub channel is setuptools.setup(), and the only documented subscription
 API is pkg_resources. Documenting the file format explicitly changes that dynamic, such that any publisher that produces a compliant `entry_points.txt` file will be supported by pkg_resources, and any consumer that can read a compliant `entry_points.txt` file will be supported by setuptools.setup()<br></div><div><br></div></div><div class="gmail_quote">Cheers,</div><div class="gmail_quote">Nick.<br clear="all"></div><br>-- <br><div class="gmail_signature">Nick Coghlan   |   <a href="mailto:ncoghlan@gmail.com" target="_blank">ncoghlan@gmail.com</a>   |   Brisbane, Australia</div>
</div></div>