[ZODB-Dev] RE: [Zope-Coders] revising layout of ZODB3 checkout

Tim Peters tim at zope.com
Fri Jan 9 00:50:45 EST 2004


[Tim Peters]
>> OTOH, if you build with
>>
>>     setup.py build_ext -i
>>
>> then "import ZODB" works fine.  But the *tests* don't run then. I'd
>> rather change that, since "build_ext -i" is the normal way to build
>> Zope from source, and there's no apparent reason for Zope and ZODB3
>> to favor different build procedures.

[Jeremy Hylton]
> It was convenient when we had to support multiple versions of Python,
> because you could have multiple builds from a single checkout.  I
> still find that useful, because I use Python 2.3 and CVS Python.  I
> don't do that because we need to support CVS Python, but it has been
> better a provoking some bugs than 2.3.

We differ here, in that I never try to use multiple builds in the same
directory, not even in ZODB3.  That's been the source of artificial bugs in
the past, and I don't want any chance of enduring them again -- so I nuke
everything and start over from scratch whenever switching Python versions.
This is easy and goes fast.  If you upgrade to Windows, I'll lend you a copy
of my .bat file <wink>.

> I'm also resistant to build_ext -i, because it's not the distutils
> default.

Sorry, I didn't follow that one (plain "build" isn't a disutils default
either, and what difference would distutils defaults make regardless?).

>>> I think we can fix this by moving all the source code to a top-level
>>> src directory.  As a result, a checkout would only have two
>>> top-level directories Doc and src.  It would also have setup.py,
>>> test.py, and a few other files.

Would "import ZODB" work then from the ZODB3 checkout directory, or would
you have to fiddle your PYTHONPATH, or switch to a different directory first
(src?), to get it to work?  I'm not clear on what setup.py would produce in
the end.


>>> This change would not affect a Zope checkout at all.  I would just
>>> re-arrange the repolinks for the ZODB3 CVS module.

>> Then what ZODB "looks like" would differ between a Zope checkout and
>> a ZODB3 checkout? ...

> ZODB and Zope checkouts don't look anything alike now.

Good point -- I missed that one <wink>.  That removes my biggest objection.

> In a Zope checkout, everything is in a lib/python directory.
> (I'm not sure why, actually.)  In ZODB3, everything is at the top
> level.  My suggestion is to change ZODB3 to look like Zope3.

When I'm doing anything with a ZODB3 checkout now, *except* for just running
the tests, I throw away the build directory and rebuild via "build_ext -i".
That's maximally convenient for me when trying to *use* ZODB3 in a
development branch.  To the extent that a ZODB3 checkout is changed to mimic
a structure maximally convenient for developing something else, I don't see
much point to it.

The original use case here was:

    If you then run python from the same directory and type "import
    ZODB," it will fail because it picks up the uncompiled source
    directory.

Is there some other point to this?  As above, I'm not sure that the
suggesting reshuffling will satisfy this use case.

> We're soon going to be supporting Zope2 and Zope3 with ZODB3, and
> Zope2 and Zope3 don't have the same layout.  I'd rather use the Zope3
> layout; I like it better.

Since (as you said) all the layouts are different anyway, I'd like to use a
ZODB3 layout that makes most sense for ZODB3.  Based on the use case,
"build_ext -i" already works great for ZODB3, except that the tests don't
run then, and that you're inhibited from chasing distutils bugs due to
multiple-build-directory confusions <wink>.




More information about the ZODB-Dev mailing list