[Distutils] [Enthought-dev] Namespace packages and egg-info confusion when using bdist_rpm
Dave Peterson
dpeterson at enthought.com
Thu Aug 9 23:23:00 CEST 2007
Ryan May wrote:
> Ryan May wrote:
>
>>> On Thu, July 26, 2007 2:01 pm, Phillip J. Eby wrote:
>>>
>>>> At 01:37 PM 7/26/2007 -0400, Stanley A. Klein wrote:
>>>>
>>>>> I had the same error. Should I have put in an "import enthought" in all
>>>>> the others?
>>>>>
>>>> No, apparently the manual import doesn't help. Presumably the ones
>>>> you changed need something more like this:
>>>>
>>>> import enthought; enthought.traits = sys.modules['enthought.traits']
>>>> import enthought.traits; enthought.traits.ui =
>>>> sys.modules['enthought.traits.ui']
>>>>
>>>> I thought the import would be sufficient, but apparently it's not. :(
>>>>
>>>> Again, let me know if it works so I can change setuptools accordingly.
>>>>
>> This solution worked for me initially, but now I'm getting warnings when
>> I run any python script I get:
>>
>> warning: Not importing directory
>> '/usr/lib64/python2.5/site-packages/enthought/traits': missing __init__.py
>> warning: Not importing directory
>> '/usr/lib64/python2.5/site-packages/enthought/traits/ui': missing
>> __init__.py
>>
>>
>> This is when I added the above lines to the .pth files for both traits
>> and traits.ui. What am I doing wrong?
>>
>>
> Turns out that another package (kiva) decided it would be a good idea to
> put a __init__.py in the enthought directory, which made python angry.
>
> Sorry for the noise, distutils.
>
> Enthought guys, anybody wanna take a crack at why kiva (and only kiva)
> insisted on adding a __init__.py to enthought?
>
Well, I just checked the source and 'enthought' is declared as a
namespace package in setup.py, and the enthought/__init__.py contains
nothing but:
try:
__import__('pkg_resources').declare_namespace(__name__)
except:
pass
which is what our other projects have. So, since I'm not a bdist_rpm
expert, I'm at a loss of even where to begin on this one.
-- Dave
More information about the Distutils-SIG
mailing list