[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: No __init__.py for namespaced module in Python 3.4



Hi barry,

Thanks for your answer.

On 09/06/2014 05:38 AM, Barry Warsaw wrote:
> On Sep 05, 2014, at 11:16 PM, Thomas Goirand wrote:
> 
>> Surprisingly, when I just do (as root):
>>
>> echo "" >/usr/lib/python3/dist-packages/oslo/__init__.py
>>
>> then everything works again, and subunit under Python3.4 can find the
>> local version of oslo.serialization.
> 
> Is there by any chance a /usr/lib/python3/dist-packages/oslo/__pycache__
> directory with an __init__<blah>.pyc file in it?

No, there's no such thing. No __pycache__ directory at all there.

> One thing you can do is run `python3 -v` to watch what Python tries to
> import.  It will be quite verbose though.
> 
>> Currently, I'm disabling the unit tests for Python 3.4 in
>> oslo.serialization, but this really doesn't seem to be the way to go,
>> and I would like to find a way to fix this.
> 
> Is this testable locally on a sid machine?

By all means, please do try by yourself. The package is still in the NEW
queue, so you'll have to get it from Git:

git clone \
  ssh://git.debian.org/git/openstack/python-oslo.serialization.git
cd python-oslo.serialization
./debian/rules gen-orig-xz

If you want to add Python3 tests, simply do:
-    set -ex ; for i in $(PYTHONS) ; do \
+    set -ex ; for i in $(PYTHONS) $(PYTHON3S) ; do \

in the debian/rules file.

BTW, I'm not sure I understand what Paultag tried to explained to me. :(

Sure, I get the point about not having an __init__.py file so that
"oslo" keeps being a namespace rather than a package. But is there
something in Paultag's reply that would help having working unit tests
in the python-oslo.serialization package? Or did I miss something?

Cheers,

Thomas Goirand (zigo)


Reply to: