Re: [Distutils] command hooks...

2012-05-25 Thread Erik Bray
On Thu, May 24, 2012 at 8:27 PM, PJ Eby p...@telecommunity.com wrote:
 On Thu, May 24, 2012 at 6:56 PM, Daniel Holth dho...@gmail.com wrote:

  For something like Pyramid the main piece that's missing is support
  for an entry_points like system.  As Tarek and other have pointed out
  the past, such a system could still be supported through a third-party
  plugin system that works via setup hooks and custom metadata.  I think
  there was even a prototype for something like that at one point...

 'packaging' will be powerful enough to copy entry_points.txt into the
 .dist-info directory as a resource. Python bug #11880.

 The existing entry points code has a plugin mechanism for itself that
 will make it easy to iterate over entry_points.txt in dist-info as
 well as egg-info directories. Just write that plugin and you should be
 good to go. Though you might have to install the plugin in an egg-info
 directory at first...


 What plugin mechanism are you talking about here, specifically?

 For that matter, which existing entry points code are you talking about,
 too?  ;-)

Yeah, I'm a little confused by this too.  Sure you could include an
entry_points.txt in the dist-info. Though it's not clear to me that
there's an entirely straightforward way to do this yet.  I think some
ideas have been tossed about for how to make it easier to include
custom files in dist-info, but that there were no conclusions on that.
 Or maybe it already is easy and I'm just missing something.

Then there would need to be some interface like
pkg_resources.iter_entry_points() available to all software that
relies on entry_points.  This could be provided by the same plugin
that adds entry_points.txt to dist-info.  That plugin would have to be
an installation requirement for any software that relies on it (as is
setuptools for any package that currently uses entry_points, so I
don't think that's such a hardship...)

Erik
___
Distutils-SIG maillist  -  Distutils-SIG@python.org
http://mail.python.org/mailman/listinfo/distutils-sig


Re: [Distutils] command hooks...

2012-05-25 Thread Daniel Holth
This discussion is confusing because we are either talking about a
general plugin discovery mechanism for Python, or a plugin mechanism
that packaging itself uses.

After the patch, entry_points.txt (which you are encouraged to write
yourself) is copied by means of a new {dist-info} category using the
resources = mechanism in packaging. This is a straightforward way to
copy anything into the .dist-info directory. Apart from copying the
file, 'packaging' has no role.

setup.cfg:

[files]
packages = mypackage
resources =
entry_points.txt={dist-info}

That's all there is to it.
___
Distutils-SIG maillist  -  Distutils-SIG@python.org
http://mail.python.org/mailman/listinfo/distutils-sig


Re: [Distutils] command hooks...

2012-05-25 Thread Erik Bray
On Fri, May 25, 2012 at 2:24 PM, Daniel Holth dho...@gmail.com wrote:
 This discussion is confusing because we are either talking about a
 general plugin discovery mechanism for Python, or a plugin mechanism
 that packaging itself uses.

 After the patch, entry_points.txt (which you are encouraged to write
 yourself) is copied by means of a new {dist-info} category using the
 resources = mechanism in packaging. This is a straightforward way to
 copy anything into the .dist-info directory. Apart from copying the
 file, 'packaging' has no role.

 setup.cfg:

 [files]
 packages = mypackage
 resources =
    entry_points.txt={dist-info}

 That's all there is to it.

Neat! I didn't realize there was a {dist-info} resource category.
That, plus the register_finder() approach mentioned in the other
thread could be a way to go for interoperability with packages using
setuptools.  It would still require a bit of hackery though...  I
suspect there would be resistance to adding support for this directly
in packaging.  But a setup_hook could set this up.

Erik
___
Distutils-SIG maillist  -  Distutils-SIG@python.org
http://mail.python.org/mailman/listinfo/distutils-sig