[openstack-dev] [all] [glance] python namespaces considered harmful to development, lets not introduce more of them
doug at doughellmann.com
Thu Aug 28 16:22:43 UTC 2014
On Aug 28, 2014, at 6:41 AM, Radomir Dopieralski <openstack at sheep.art.pl> wrote:
> On 27/08/14 16:31, Sean Dague wrote:
>> In python 2.7 (using pip) namespaces are a bolt on because of the way
>> importing modules works. And depending on how you install things in a
>> namespace will overwrite the base __init__.py for the top level part of
>> the namespace in such a way that you can't get access to the submodules.
>> It's well known, and every conversation with dstuft that I've had in the
>> past was "don't use namespaces".
> I think this is actually a solved problem. You just need a single line
> in your __init__.py files:
The problem is that the setuptools implementation of namespace packages breaks in a way that is repeatable but difficult to debug when a common OpenStack installation pattern is used. So the fix is “don’t do that” where I thought “that” meant the installation pattern and Sean thought it meant “use namespace packages”. :-)
More information about the OpenStack-dev