
Hi there, Tonight I attempted a package reorganisation myself, integrating vlibxml2 into lxml from the other direction, leaving most of lxml's build scripts and testing framework intact. My attempts are here: http://codespeak.net/svn/lxml/branch/lxml-reorg/ The build story works ('make' does the trick). The tests are picked up by the test runner. I noticed that on reorg-20041120 'make' tries to install in site-packages directly, which is something that doesn't happen on my branch. I think it's cleaner not to have to install in site packages just for testing, and the test.py runner takes care of this in lxml. Another thing I tried to do conscientiously on my branch is use 'svn move', so that version control history of various files is not lost during reorganisation. Did you use that, Victor? Everything is currently in the lxml directory (except for vlibxml2_mod.so, but I tried placing it there as well and it's an easy change to setup.py). The problem is that I can't get vlibxml2 tests to get anywhere near passing. When running the tests, I get many, many obscure errors along these lines: Exception exceptions.NameError: 'vlibxml2' in <lxml.vlibxml2_subclasses.xmlNodeSub object at 0x404337cc> ignored Alternate source organisations result in import errors instead.. I tried rearranging the source every which way, but I think the problem remains that vlibxml2_mod uses (through wrapfuncs.pxi) vlibxml2_subclasses.py, where vlibxml2_subclasses.py imports from vlibxml2_mod to actually do the subclassing. This circular setup is driving me rather crazy. I suspect that the original vlibxml2 setup had some magic source code organisation that somehow avoided this problem. I do not know where the magic is though; Victor, could you perhaps explain? Preferably I'd like to break this circular import, as it's obviously hard to maintain. I apparently can't do it. :) Is there any way to accomplish this? I understand that we need to subclass for weak-referencability, but is there any way to do this in .pyx code directly instead of in Python? Or could we make the weakreffable classes the root base class, so there's no need for them to inherit from vlibxml2_mod classes first, and then be used in vlibxml2_mod again? Please help! :) Regards, Martijn