setuptools and plone buildout
August 2018
Sun Mon Tue Wed Thu Fri Sat
      1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31  
About
This site is an effort to share some of the base knowledge I have gathered through all this years working with Linux, FreeBSD, OpenBSD, Python or Zope, among others. So, take a look around and I hope you will find the contents useful.
Recent Entries
Recent Comments
Recent Trackbacks
Categories
OpenBSD (9 items)
BSD (0 items)
FreeBSD (19 items)
Linux (3 items)
Security (3 items)
Python (22 items)
Zope (13 items)
Daily (144 items)
e-shell (9 items)
Hacks (14 items)
PostgreSQL (3 items)
OSX (8 items)
Nintendo DS (0 items)
enlightenment (0 items)
Apache (3 items)
Nintendo Wii (1 items)
Django (24 items)
Music (12 items)
Plone (7 items)
Varnish (0 items)
Lugo (2 items)
Sendmail (0 items)
europython (7 items)
Cherokee (1 items)
self (1 items)
Nature (1 items)
Hiking (0 items)
uwsgi (0 items)
nginx (0 items)
cycling (10 items)
Networking (1 items)
DNS (0 items)
Archives

Syndicate this site (XML)

RSS/RDF 0.91

29 agosto
2008

setuptools and plone buildout

you need the right version these days...

I've found the same problem 2 times this week, so I think it's worth to write a note about it.

If you are used to work with plone, you probably already know about buildout (or zc.buildout). It is the preferred way for plone-based website development. I'll not go inside buildout itself (just take a look at Martin Aspeli's great book, Professional Plone Development to learn more about it) but I think this could be a useful reminder for those of you who are using it.

In order to use buildout, you need to have some deps installed on your system, one of those is setuptools. As you will need to use python 2.4 with plone (no 2.5 support yet), you will need to install the 2.4 egg for setuptools. Following the installation instructions you will have to download this and install it like:

sudo sh setuptools-0.6c8-py2.4.egg

After that you can install the rest of the buildout deps (like ZopeSkel) using easy_install-2.4. If you do that, you will find a problem when running ./bin/buildout, something similar to:

Develop: '/mnt/data/xxxxxx/zzzzzz.net/plone/zzzzzz/src/zzzzzz.policy'
unrecognized .svn/entries format; skipping .
Traceback (most recent call last):
  File "/tmp/tmpCvdzgq", line 11, in ?
    execfile('/mnt/data/xxxxxx/zzzzzz.net/plone/zzzzzz/src/zzzzzz.policy/setup.py')
  File "/mnt/data/xxxxxx/zzzzzz.net/plone/zzzzzz/src/zzzzzz.policy/setup.py", line 30, in ?
    entry_points="""
  File "/usr/local/lib/python2.4/distutils/core.py", line 149, in setup
    dist.run_commands()
  File "/usr/local/lib/python2.4/distutils/dist.py", line 946, in run_commands
    self.run_command(cmd)
  File "/usr/local/lib/python2.4/distutils/dist.py", line 966, in run_command
    cmd_obj.run()
  File "/usr/local/lib/python2.4/site-packages/setuptools-0.6c8-py2.4.egg/setuptools/command/develop.py", line 27, in run
    self.install_for_development()
  File "/usr/local/lib/python2.4/site-packages/setuptools-0.6c8-py2.4.egg/setuptools/command/develop.py", line 85, in install_for_development
    self.run_command('egg_info')
  File "/usr/local/lib/python2.4/distutils/cmd.py", line 333, in run_command
    self.distribution.run_command(command)
  File "/usr/local/lib/python2.4/distutils/dist.py", line 966, in run_command
  cmd_obj.run()
  File "/usr/local/lib/python2.4/site-packages/setuptools-0.6c8-py2.4.egg/setuptools/command/egg_info.py", line 171, in run
    self.find_sources()
  File "/usr/local/lib/python2.4/site-packages/setuptools-0.6c8-py2.4.egg/setuptools/command/egg_info.py", line 252, in find_sources
    mm.run()
  File "/usr/local/lib/python2.4/site-packages/setuptools-0.6c8-py2.4.egg/setuptools/command/egg_info.py", line 306, in run
    self.add_defaults()
  File "/usr/local/lib/python2.4/site-packages/setuptools-0.6c8-py2.4.egg/setuptools/command/egg_info.py", line 333, in add_defaults
    rcfiles = list(walk_revctrl())
  File "/usr/local/lib/python2.4/site-packages/setuptools-0.6c8-py2.4.egg/setuptools/command/sdist.py", line 45, in walk_revctrl
    for item in ep.load()(dirname):
  File "/usr/local/lib/python2.4/site-packages/setuptools-0.6c8-py2.4.egg/setuptools/command/sdist.py", line 52, in _default_revctrl
    for path in finder(dirname,path):
  File "/usr/local/lib/python2.4/site-packages/setuptools-0.6c8-py2.4.egg/setuptools/command/sdist.py", line 98, in entries_finder
    log.warn("unrecognized .svn/entries format in %s", dirname)
NameError: global name 'log' is not defined
While:
  Installing.
  Processing develop directory '/mnt/data/xxxxxx/zzzzzz.net/plone/zzzzzz/src/zzzzzz.policy'.

An internal error occured due to a bug in either zc.buildout or in a
recipe being used:
Traceback (most recent call last):
  File "/usr/home/borja/xxxxxx/plone/zzzzzz/eggs/zc.buildout-1.1.1-py2.4.egg/zc/buildout/buildout.py", line 1477, in main
  File "/usr/home/borja/xxxxxx/plone/zzzzzz/eggs/zc.buildout-1.1.1-py2.4.egg/zc/buildout/buildout.py", line 324, in install
  File "/usr/home/borja/xxxxxx/plone/zzzzzz/eggs/zc.buildout-1.1.1-py2.4.egg/zc/buildout/buildout.py", line 556, in _develop
  File "/usr/home/borja/xxxxxx/plone/zzzzzz/eggs/zc.buildout-1.1.1-py2.4.egg/zc/buildout/easy_install.py", line 866, in develop
AssertionError

(notice that the error appears as I've added some modules developed here for my project, like that policy product, src/zzzzzz.policy)

The key there is:

File "/usr/local/lib/python2.4/site-packages/setuptools-0.6c8-py2.4.egg/setuptools/command/sdist.py", line 98, in entries_finder
  log.warn("unrecognized .svn/entries format in %s", dirname)
NameError: global name 'log' is not defined

That error will appear if you are using subversion 1.5 to manage your source code, as the release version of setuptools have some problems with that. To solve that problem, just upgrade setuptools using setuptools (WTF?):

sudo easy_install-2.4 setuptools==dev06

And you are done! (you will have to re-run python bootstrap.py and ./bin/buildout again).

Posted by wu at 16:07 | Comments (0) | Trackbacks (0)
<< Zope Security advisory 2008-08-12 | Main | Codigo23 & django t-shirts >>
Comments
Re: setuptools and plone buildout

thanks, i had the same problem (and solution) three weeks ago (before going on vacation) and now again, after i came back. of course, i had forgotten the exact solution already, so your timing couldn't have been any better!

however, in my case it was necessary to add the `-U` option, or else setuptools would just ignore the new version, so if anybody has problems with the above solution, try this instead:

sudo easy_install-2.4 -U setuptools==dev06

Posted by: Tom Lazar at agosto 30,2008 09:16
Re: setuptools and plone buildout

Today I've found exactly this very same problem again, and the upgrading trick didn't work...

Just in case someone else has found the same issue, I solved it this time removing the old setuptools package from the site-packages dir of my python installation and reinstalling it (downloading the new .egg from Pypi and reinstalling it manually.

Of course, if you are using your OS package management tool to manage the setuptools package, just upgrade it properly using it. Should work too.

Posted by: Wu at diciembre 03,2008 19:23
Trackbacks
Please send trackback to:http://blog.e-shell.org/96/tbping
There are no trackbacks.
Post a comment