On Thu, Jun 11, 2009 at 10:53 AM, Dag Sverre
Seljebotn<[email protected]> wrote:
> Ondrej Certik wrote:
>> On Thu, Jun 11, 2009 at 10:24 AM, Stefan Behnel<[email protected]> wrote:
>>
>>> Ondrej Certik wrote:
>>>
>>>> On Thu, Jun 11, 2009 at 1:59 AM, Stefan Behnel wrote:
>>>>
>>>>> Ondrej Certik wrote:
>>>>>
>>>>>> we use cmake to build the project (C++ and cython) and cmake
>>>>>> allows to build the project out of the tree, e.g. it leaves the .cpp
>>>>>> and .py files in the source dir and creates a build dir, where it
>>>>>> stores all the .o and .so files.
>>>>>>
>>>>> Uhm, so the real problem is that cmake fails to take the source directory
>>>>> structure into account when copying build artefacts over to the build
>>>>> directory?
>>>>>
>>>> I think cmake is doing it right, it only builds binary things in the
>>>> binary directory and leaves all the sources (be it python or C++) in
>>>> the source directory.
>>>>
>>> Ok, I get it, so all that's missing here to make this work is put either
>>> the __init__.py files next to the binaries or the binaries next to the
>>> __init__.py files.
>>>
>>
>> Yes, but putting binaries next to __init__.py files essentially means
>> building in the tree (then I can just build in the tree from the
>> beginning, which I do, but other people prefer not to pollute the
>> build tree), and putting __init__.py files next to binaries doesn't
>> work for me, because I then have the same module twice in my import
>> path (once in the source directory, once in the binary directory) and
>> it clashes -- at least I didn't make it work.
>>
> This is the real problem I think. The concept of a build directory is
> that the result ends up there -- thus, copy over any pure .py files to
> the build directory, and only have that as the import path.
>
> Really, that's how all out-of-tree builds work? Non-compiled files are
> copied.

When I copy all the .py files, then it of course works. So maybe you
are right, that I should just copy (or rather link them) all the .py
files into the build dir and be done with this.

>
> I'm against any changes needed only because of a wierd import path setting.

I don't think it's weird.

As far as Cython is concerned, the only problem I can see is that it
changes all import paths to the fully qualified import paths. Python
allows both ways, Cython only the fully qualified way. As Stefan
explained, this is needed, because it will then not work properly at
the moment. But I am not convinced this cannot be fixed -- though it
may happen that the fix is too tedious and not worthy.

Ondrej
_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev

Reply via email to