[Product-Developers] Re: Infinite setuptools recursion with paster entry points

Maurits van Rees m.van.rees at zestsoftware.nl
Wed Sep 23 10:52:47 UTC 2009


Mikko Ohtamaa, on 2009-09-22:
>
> Hi,
>
> Paster Plone skeletons create the following entry points for Plone apps (at
> least AT apps) by default:
>
>       # -*- entry_points -*- 
>       [distutils.setup_keywords]
>       paster_plugins = setuptools.dist:assert_string_list
>
>       [egg_info.writers]
>       paster_plugins.txt = setuptools.command.egg_info:write_arg
>
> They are needed to use paster addcontent command for Plone.
>
> However sometimes (always?) this leads to infinite recursion when you run
> buildout and there already exists .egg-info folders for the product from
> previous buildout run:
>
> Develop: '/srv/plone/saariselka/src/collective.mountpoint'
> Traceback (most recent call last):
>   File "/tmp/tmpWfiFy9", line 11, in ?
>     execfile('/srv/plone/saariselka/src/collective.mountpoint/setup.py')
>   File "/srv/plone/saariselka/src/collective.mountpoint/setup.py", line 72,
> in ?
>     paster_plugins = ["ZopeSkel"],
>   File "/usr/lib/python2.4/distutils/core.py", line 110, in setup
>     _setup_distribution = dist = klass(attrs)
>   File
> "/srv/plone/saariselka/eggs/setuptools-0.6c9-py2.4.egg/setuptools/dist.py",
> line 223, in __init__
>     _Distribution.__init__(self,attrs)
>   File "/usr/lib/python2.4/distutils/dist.py", line 240, in __init__
>     self.finalize_options()
>   File
> "/srv/plone/saariselka/eggs/setuptools-0.6c9-py2.4.egg/setuptools/dist.py",
> line 255, in finalize_options
>     ep.require(installer=self.fetch_build_egg)
>   File
> "/srv/plone/saariselka/eggs/setuptools-0.6c9-py2.4.egg/pkg_resources.py",
> line 1925, in require
>     working_set.resolve(self.dist.requires(self.extras),env,installer))
>   File
> "/srv/plone/saariselka/eggs/setuptools-0.6c9-py2.4.egg/pkg_resources.py",
> line 522, in resolve
>     dist = best[req.key] = env.best_match(req, self, installer)
>   File
> "/srv/plone/saariselka/eggs/setuptools-0.6c9-py2.4.egg/pkg_resources.py",
> line 758, in best_match
>     return self.obtain(req, installer) # try and download/install
>   File
> "/srv/plone/saariselka/eggs/setuptools-0.6c9-py2.4.egg/pkg_resources.py",
> line 770, in obtain
>     return installer(requirement)
>   File
> "/srv/plone/saariselka/eggs/setuptools-0.6c9-py2.4.egg/setuptools/dist.py",
> line 286, in fetch_build_egg
>     return cmd.easy_install(req)
>   File
> "/srv/plone/saariselka/eggs/setuptools-0.6c9-py2.4.egg/setuptools/command/easy_install.py",
> line 446, in easy_install
>     return self.install_item(spec, dist.location, tmpdir, deps)
>   File
> "/srv/plone/saariselka/eggs/setuptools-0.6c9-py2.4.egg/setuptools/command/easy_install.py",
> line 476, in install_item
>     dists = self.install_eggs(spec, download, tmpdir)
>   File
> "/srv/plone/saariselka/eggs/setuptools-0.6c9-py2.4.egg/setuptools/command/easy_install.py",
> line 655, in install_eggs
>     return self.build_and_install(setup_script, setup_base)
>   File
> "/srv/plone/saariselka/eggs/setuptools-0.6c9-py2.4.egg/setuptools/command/easy_install.py",
> line 930, in build_and_install
>     self.run_setup(setup_script, setup_base, args)
>   File
> "/srv/plone/saariselka/eggs/setuptools-0.6c9-py2.4.egg/setuptools/command/easy_install.py",
> line 921, in run_setup
>     raise DistutilsError("Setup script exited with %s" % (v.args[0],))
> distutils.errors.DistutilsError: Setup script exited with error: Setup
> script exited with error: Setup script exited with error: Setup script
> exited with error: Setup script exited with error: Setup script exited with
> error: Setup script exited with error: Setup script exited with error: Setup
> script exited with error: Setup script exited with error: Setup script
> exited with error: Setup script exited with error: Setup script exited with
> error: Setup script exited with error: Setup script exited with error: Setup
> script exited with error: Setup script exited with error: Setup script
> exited with error: Setup script exited with error: Setup script exited with
> error: Setup script exited with error: Setup script exited with error:
> Numerical result out of range
> While:
>   Installing.
>
> The cure is run this before running buildout:
>
> find src -iname "*.egg-info" | xargs rm -rf 
>
> But is there any more elegant solution available?
>
> - Fix paster templates?
>
> - Fix buildout?
>
> - Fix setuptools?

Not sure what the correct way is, but this is related to the version
of ZopeSkel, Cheetah and Markdown.


maurits at kronos:~/tmp $ virtualenv --no-site-packages bar
...
maurits at kronos:~/tmp $ cd bar
maurits at kronos:~/tmp/bar $ bin/easy_install ZopeSkel==2.12
...
Processing dependencies for ZopeSkel==2.12
Searching for Cheetah>1.0
...
Best match: Cheetah 2.2.2
...
Searching for Markdown>=2.0.1
...
Best match: Markdown 2.0.1
...
markdown.MarkdownException: Failed to import ElementTree


Okay, let's easy install Cheetah separately.


maurits at kronos:~/tmp/bar $ bin/easy_install Cheetah
Searching for Cheetah
Best match: Cheetah 2.2.2
...
Processing dependencies for Cheetah
Searching for Markdown>=2.0.1
...
Best match: Markdown 2.0.1
Downloading http://pypi.python.org/packages/source/M/Markdown/Markdown-2.0.1.tar.gz
Processing Markdown-2.0.1.tar.gz
Running Markdown-2.0.1/setup.py -q bdist_egg --dist-dir /tmp/easy_install-5PX56c/Markdown-2.0.1/egg-dist-tmp-pZDd2X

error: Setup script exited with error: Setup script exited with error:
Setup script exited with error: Setup script exited with error: Setup
script exited with error: Setup script exited with error: Setup script
exited with error: Setup script exited with error: Setup script exited
with error: Setup script exited with error: Setup script exited with
error: Setup script exited with error: Setup script exited with error:
Setup script exited with error: Setup script exited with error: Setup
script exited with error: Setup script exited with error: Setup script
exited with error: Setup script exited with error: Setup script exited
with error: Setup script exited with error: Setup script exited with
error: Setup script exited with error: Setup script exited with error:
Setup script exited with error: Setup script exited with error:
Numerical result out of range


Like I just posted on the plone-setup list, the following works for me
in a fresh virtualenv with --no-site-packages:

easy_install Cheetah==2.2.1 ZopeSkel==2.12

or

easy_install elementtree Markdown==1.7 Cheetah==2.2.1 ZopeSkel==2.12

ZopeSkel 2.12 (released today) adds a requirement on elementtree,
which is needed because Markdown requires it but does not specify it;
Markdown itself is a requirement of Cheetah starting from Cheetah
2.2.2.

Note that the order is important.  If you easy_install ZopeSkel==2.12
first, easy_install will not yet see that you specify Cheetah==2.2.1
so it will install the lastest 2.2.2 and things will go wrong.

Note also that Cheetah 2.2.2 depends on Markdown 2.0.1 or higher and
that version is not happy with elementtree but it really wants to
import Elementtree, so there you *will* need to apt-get install
python-elementtree.


Those are the numbers, I hope this takes you a step closer to a
solution.

-- 
Maurits van Rees | http://maurits.vanrees.org/
            Work | http://zestsoftware.nl/
"This is your day, don't let them take it away." [Barlow Girl]





More information about the Product-Developers mailing list