[Distutils] scripts versus console_scripts

Reinout van Rees reinout at vanrees.org
Wed Sep 2 15:07:43 CEST 2009


First things first: what I want to accomplish is to install pyflakes and
docutils in a buildout.  That is, I want to have a bin/pyflakes and bin/rst2*
scripts.

- Buildout listens to the console_scripts entry point.

- pyflakes and docutils use the (apparently old) scripts=['scripts/pyflakes']
  option instead of a console_scripts entry point.


So I have three choices:

- Ask pyflakes and docutils to use the console_scripts entry point.  Is there
  a reason not to use console_scripts?  The "scripts=[]" comes from plain
  distutils which is in the official python distribution and setuptools is
  an add-on.  Can this be a cause?

- Fix up buildout to also support scripts=[].  (I'm trying that one right
  now).

- Write a wrapper library that depends on pyflakes/docutils and provides
  proper entry points.  Feels a bit dirty.


I have two questions:

- Has the console_scripts entry point superseded scripts=[]?  Should it be
  considered a bug in pyflakes?  Or is it OK to still use it?

- How do I access that 'scripts=[....]' which is sitting right there in my
  setup() call?  From buildout?  Buildout does something like:

       req = pkg_resources.Requirement.parse('my.package')
       dist = working_set.find('my.package')
  
  dist ends up as a pkg_resources.Distribution class, which doesn't seem to
  have anything with which to do "dist.scripts" or so.  Anyone know the magic
  call?  In easy_install there's a "self.distribution.scripts", but after 4
  levels of inheritance and a monkey patch I lost track where
  self.distribution comes from...


Reinout


-- 
Reinout van Rees - reinout at vanrees.org - http://reinout.vanrees.org
Software developer at http://www.thehealthagency.com
"Military engineers build missiles. Civil engineers build targets"



More information about the Distutils-SIG mailing list