• flickr
  • twitter
  • facebook
  • delicious
  • Google Buzz

Using subversion 1.5 with setuptools in Python (technical)

by Christian Scholz on July 19, 2008

Usually I am using buildout for doing all my Python development work which is great as it gives you a flexible sandbox for developing.
One problem might strike you though if you upgrade your subversion installation to 1.5 as I just did. When running buildout again a la


bin/buildout

you might encounter an error like this:


NameError: global name 'log' is not defined

and buildout to stop. As far as I digged into it and read on mailinglists this has to do with a different format of the .svn/entries of Subversion 1.5 (setuptools uses this to check version numbers afaik).

This bug seems to be fixed in the setuptools trunk in subversion but no release is made yet. So in order to get this fixed what I did was the following (there is probably a better way to do this but I was too lazy to dig into this further as this only is supposed to be a temporary workaround anyway):

  1. Check out the setuptools trunk: svn co http://svn.python.org/projects/sandbox/trunk/setuptools in some working directory
  2. Build an egg out of it: python setup.py bdist_egg You can find it in dist/ then
  3. Copy this egg into the eggs/ directory of your buildout (or in the egg directory you have configured in ~/.buildout/default.cfg
  4. Open bin/buildout with your editor and change the path to the egg used to the one you just copied (should have some name like setuptools-0.7a1dev_r0-py2.4.egg.

Now your buildout should run again (but might give some warnings about those .svn/entries files.

(This was done on Mac OSX, should be similar on Linux, might be slightly different on Windows due to the setup of bin\buildout.exe)

And now that it works with subversion 1.5, I am eager to try out it’s new features such as merge tracking.

PS: Maybe there is a way to specify the setuptools egg directly via some configuration. If so, I would like to learn about it :-)

Technorati Tags: , , , , ,

Ähnliche Artikel

  • No Related Post

5 comments

You do realize that you can just “easy_install setuptools==dev06″ to update to the latest version? That also (probably) applies to specifying that version in buildout (==dev06,>=0.6c9dev)

by Phillip J. Eby on 19.7.2008 at 20:41. Reply #

No, but thanks for the hint.
Where would I get this information from? Looking again at the pypi I might have deduced it from the branch which is linked but that's not too obvious IMHO.

I am still struggling though to make this work in buildout. It works when it's installed globally but I wonder how you can tell it to use this version. Will dig into it now.

by Christian Scholz on 19.7.2008 at 23:36. Reply #

besides that running

easy_install setuptools==dev06

now also produces the "log" error.

by Christian Scholz on 19.7.2008 at 23:43. Reply #

thanks for this tip. I could of used it a week ago but this is great!

by Robzonenet on 20.7.2008 at 10:15. Reply #

@christian: i got the 'chicken-egg-problem', too when trying to upgrade setuptools. I just patched my local sdist.py (basically, just replace the erroneous log statement with a simple pass statement).

then run the upgrade command.

all in all, probably the fastest way to get rid of the problem…

HTH,

tom

by Tom Lazar on 21.7.2008 at 19:23. Reply #

Leave your comment

Required.

Required. Not published.

If you have one.

Twitter Users
Enter your personal information in the form or sign in with your Twitter account by clicking the button below.