[SciPy-Dev] relative imports

Robert Kern robert.kern at gmail.com
Wed May 16 10:46:11 EDT 2012


On Wed, May 16, 2012 at 3:33 PM, Denis Laxalde <denis at laxalde.org> wrote:
> Robert Kern a écrit :
>> Relative imports won't allow subpackages to be built or tested
>> independently.
>
> Well, I've tried this for optimize and this does work.

Oh, adding relative imports won't *hurt* things, but it doesn't *help*
building and testing subpackages independently.

>>  The only thing preventing that right now is building a
>> subpackage by itself.
>
> What do you mean?
>
>  cd scipy/optimize
>  python setup.py install --user
>
> This works.

Great. Then in-place builds of individual subpackages should work fine too.

>>  If you solve that problem, then you just need to
>> do an in-place build of the whole scipy package once, and then
>> in-place builds of the subpackages that you modify. You can already
>> test subpackages independently.
>
> I agree, that's one possibility although I personally prefer standard
> "out-of-place" builds.

Installing just "optimize" won't be standard, either, so I'm not
really sure what the reluctance is. Building and testing individual
subpackages does not require relative imports. *Installing* individual
subpackages in non-standard ways is what does not work.

-- 
Robert Kern



More information about the SciPy-Dev mailing list