[Distutils] PEP 426: proposed change to extension fields + entry points
Daniel Holth
dholth at gmail.com
Mon Feb 25 18:27:24 CET 2013
I can accept a rename but there is no way to avoid having 2 names not 1 new
name for the feature.
We go halfway now. The next version can go any other way.
On Feb 25, 2013 12:23 PM, "Vinay Sajip" <vinay_sajip at yahoo.co.uk> wrote:
> Nick Coghlan <ncoghlan <at> gmail.com> writes:
>
> > The other area where I think such an "embedded JSON" approach could
> > work is coming up with a clean format for an Entry-Points field.
> > Specifically, I am thinking of proposing the setuptools.setup
> > inspired:
> >
> > Entry-Points: {
> > "console_scripts": {
> > "foo": "my_package.some_module:main_func",
> > "bar": "other_module:some_func"
> > },
> > "gui_scripts": {
> > "baz": "my_package_gui.start_func"
> > }
> > }
> >
>
> What is the reason for this half-way-house, rather than going straight to
> JSON?
> I suppose one could argue backward compatibility, but since we are moving
> quite
> a distance from a plain old key-value here, we may as well embrace JSON
> properly.
> Perhaps we should embrace the dict rather than any specific file format,
> as I
> did with dictConfig in logging.
>
> Note that distlib already supports entry points, though these are called
> "exports" because they may or may not be callable code. (The name "exports"
> was suggested by PJE and, IMO, is better/more general than "entry points").
>
> For example, for Babel-0.9.6:
>
> "exports": {
> "babel.extractors": [
> "ignore = babel.messages.extract:extract_nothing",
> "python = babel.messages.extract:extract_python",
> "javascript = babel.messages.extract:extract_javascript"
> ],
> "distutils.commands": [
> "compile_catalog = babel.messages.frontend:compile_catalog",
> "extract_messages = babel.messages.frontend:extract_messages",
> "init_catalog = babel.messages.frontend:init_catalog",
> "update_catalog = babel.messages.frontend:update_catalog"
> ],
> "babel.checkers": [
> "num_plurals = babel.messages.checkers:num_plurals",
> "python_format = babel.messages.checkers:python_format"
> ],
> "distutils.setup_keywords": [
> "message_extractors =
> babel.messages.frontend:check_message_extractors"
> ],
> "scripts": {
> "console": [
> "pybabel = babel.messages.frontend:main"
> ]
> }
> }
>
> This is currently used, for example, in distlib's script generation logic
> (for
> example, to generate the pybabel script for Babel).
>
> Regards,
>
> Vinay Sajip
>
> _______________________________________________
> Distutils-SIG maillist - Distutils-SIG at python.org
> http://mail.python.org/mailman/listinfo/distutils-sig
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/distutils-sig/attachments/20130225/5e62c992/attachment-0001.html>
More information about the Distutils-SIG
mailing list