Re: [Distutils] modules in different folders but under same namespace

2010-02-04 Thread Tarek Ziadé
On Thu, Feb 4, 2010 at 5:53 PM, Riccardo-Maria BIANCHI riccardo.maria.bian...@cern.ch wrote: Hi, Hi, I have a package structured like this: package/__init__.py   src/ __init__.py          mod1.py   share/__init__.py            mod2.py Now I can import them as: package.src.mod1

Re: [Distutils] modules in different folders but under same namespace

2010-02-04 Thread Robert Kern
On 2010-02-04 10:53 AM, Riccardo-Maria BIANCHI wrote: Hi, I have a package structured like this: package/__init__.py src/ __init__.py mod1.py share/__init__.py mod2.py Now I can import them as: package.src.mod1 package.share.mod2 How can I use Distutils to be able to import both of them

Re: [Distutils] modules in different folders but under same namespace

2010-02-04 Thread Robert Kern
On 2010-02-04 11:06 AM, Robert Kern wrote: On 2010-02-04 10:53 AM, Riccardo-Maria BIANCHI wrote: Hi, I have a package structured like this: package/__init__.py src/ __init__.py mod1.py share/__init__.py mod2.py Now I can import them as: package.src.mod1 package.share.mod2 How can I use

Re: [Distutils] modules in different folders but under same namespace

2010-02-04 Thread Robert Kern
On 2010-02-04 11:05 AM, Tarek Ziadé wrote: On Thu, Feb 4, 2010 at 5:53 PM, Riccardo-Maria BIANCHI riccardo.maria.bian...@cern.ch wrote: Hi, Hi, I have a package structured like this: package/__init__.py src/ __init__.py mod1.py share/__init__.py mod2.py

Re: [Distutils] modules in different folders but under same namespace

2010-02-04 Thread Riccardo-Maria BIANCHI
Thanks Robert and Tarek for your answer, I implemented the __path__ solution, and it works perfectly. Thanks! and sorry if I was off-topic: I thought that distutils had options for multi-folders setup, for package_dir and packages variables. Best regards, Ric. Robert Kern wrote: On

Re: [Distutils] modules in different folders but under same namespace

2010-02-04 Thread Tarek Ziadé
On Thu, Feb 4, 2010 at 6:11 PM, Robert Kern robert.k...@gmail.com wrote: On 2010-02-04 11:05 AM, Tarek Ziadé wrote: On Thu, Feb 4, 2010 at 5:53 PM, Riccardo-Maria BIANCHI riccardo.maria.bian...@cern.ch  wrote: Hi, Hi, I have a package structured like this: package/__init__.py   src/

Re: [Distutils] modules in different folders but under same namespace

2010-02-04 Thread Robert Kern
On 2010-02-04 11:24 AM, Tarek Ziadé wrote: Not sure why you want to remove the __init__.py files in sub and share in your solution though. It prevents accidentally importing both package.src.mod1 and package.mod1 and helps readers of the code understand that only package.mod1 is correct.

Re: [Distutils] modules in different folders but under same namespace

2010-02-04 Thread Floris Bruynooghe
On Thu, Feb 04, 2010 at 05:53:16PM +0100, Riccardo-Maria BIANCHI wrote: Now I can import them as: package.src.mod1 package.share.mod2 How can I use Distutils to be able to import both of them under the same package namespace as: import package.mod1 import package.mod2 In

Re: [Distutils] modules in different folders but under same namespace

2010-02-04 Thread Robert Kern
On 2010-02-04 11:37 AM, Floris Bruynooghe wrote: On Thu, Feb 04, 2010 at 05:53:16PM +0100, Riccardo-Maria BIANCHI wrote: Now I can import them as: package.src.mod1 package.share.mod2 How can I use Distutils to be able to import both of them under the same package namespace as: import

Re: [Distutils] modules in different folders but under same namespace

2010-02-04 Thread P.J. Eby
At 05:53 PM 2/4/2010 +0100, Riccardo-Maria BIANCHI wrote: Hi, I have a package structured like this: package/__init__.py src/ __init__.py mod1.py share/__init__.py mod2.py Now I can import them as: package.src.mod1 package.share.mod2 How can I use Distutils to be