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

[Distutils] PEP 376 -- new round

2010-02-04 Thread Tarek Ziadé
Hello, As mentioned on python-dev, I would like to do a new round of work on PEP 376 before Pycon, We had a short off-list conversation with Guido on PEP 376, I'd like to share here so we can discuss the point, it's about the REQUESTED file: Guido's question: I have a question about REQUESTED.

Re: [Distutils] PEP 376 -- new round

2010-02-04 Thread Laura Creighton
You need to think about dependencies more, I think. Having worked on building such a thing, the hellish problem comes when there are more than one way to support a package .. i.e. this is my new testing plugin, it works with either py.test or nose. Laura

Re: [Distutils] PEP 376 -- new round

2010-02-04 Thread P.J. Eby
At 01:55 AM 2/5/2010 +0100, Tarek Ziadé wrote: I think it's still useful, because it points the root packages that can be removed safely without breaking the system -- even if leaving orphaned packages behind. Any opinion ? I think it's a good idea to have a way to tell what packages were

Re: [Distutils] PEP 376 -- new round

2010-02-04 Thread Carl Meyer
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Tarek Ziadé wrote: So Guido wonders if adding this file is really necessary since higher-level installers/uninstallers will have to build the graph anyways. I think you (Tarek) summarized the situation correctly. Higher-level tools will need to