[qmtest] [PATCH] Removing ExtensionClass dependency

Zack Weinberg zack at codesourcery.com
Sun Apr 13 18:39:44 UTC 2003


Mark Mitchell <mark at codesourcery.com> writes:

> On Wed, 2003-04-09 at 22:30, Nathaniel Smith wrote:
>> One of the barriers to installing qmtest into the normal Python search
>> path is that it includes local copies of Zope's ExtensionClass and
>> DocumentTemplate, which may interfere with user-installed versions of
>> the same packages.  Also, it's a bit ugly.
>
> Thanks for faxing your assignment!
>
> I've been thinking more about this patch.
>
> First, I'm really keen on the idea of making QMTest play nicer with a
> standard Python installation, so that you use QMTest from other Python
> software.  On the other hand, the first priority is still making QMTest
> easy to use as an application.  (For example, we want to start providing
> binary distributions that actually include pre-built Python binaries so
> that users can download everything they need in a single download.)
>
> Could we solve the same problem you're trying to solve in a different
> way, namely, by providing a --without-dtml configure flag?  The idea
> being that if you already had that somewhere where Python was going to
> find it that you could configure with this flag to ignore the version in
> the QMTest source tree?

The two ideas are compatible.  Suppose we move the dtml library to
qm.external as Nathaniel suggests, but instead of doing

 import qm.external.DocumentTemplate as DocumentTemplate

in qm/web.py, we do instead

 try:
     try:
         import DocumentTemplate
     except ImportError:
         import qm.external.DocumentTemplate as DocumentTemplate
 except Exception, e:
     raise qm.common.QMException, e

This makes qmtest look for DocumentTemplate in the system library
first, and if that fails, fall back to the one we ship.  Then we can
have a --without-dtml configure flag that means just "don't install
qm.external.DocumentTemplate."

How's that sound?

zw



More information about the qmtest mailing list