[okfn-help] moving vdm.sqlalchemy to vdm: an unforeseen problem

Martijn Faassen faassen at startifact.com
Mon Oct 18 18:28:11 BST 2010


Hi there,

I just ran into an unforeseen problem with moving vdm.sqlalchemy to
vdm (so that you can simply import from vdm, as agreed earlier).

I wanted to keep vdm.sqlalchemy around with backwards compatibility
imports so that the old imports would continue to work (but be
deprecated).

Unfortunately, vdm.sqlalchemy is called "sqlalchemy". This means that
any imports that vdm code tries to do from sqlalchemy proper will
actually do a relative import
to the sub-package 'sqlalchemy' and that's not the real sqlalchemy. :)

The Python developers have fixed this problem in Python 2.5 and
onwards, making import always absolute. This feature can be enabled
using

from __future__ import absolute_import

I've used this and this fixes the issue.

But this means that vdm would not be compatible with Python 2.4
anymore. I don't think this is a problem, as Python 2.4 isn't
maintained anymore, but I thought I'd check.

So, is it okay to require python 2.5 and later?

Regards,

Martijn



More information about the okfn-help mailing list