Hi,

Stephane DROUARD wrote:
> Today our source code database structure does not care at all of the final
> package structure. So the fact that PXD files need to be located withing the
> same directory structure as the PYD/SO files clearly is an issue for us.

That is clearly an unusual requirement. I had never heard of anyone who
doesn't keep Python modules in their package.


> This could be seen like any C code that needs a dynamic library:

C isn't comparable, as it doesn't have a notion of packages.


>  - the application has to find the dynamic library (.so/.dll) possibly
> through LD_LIBRARY_PATH/PATH environment variables.

You can always use a flat module setup and require users to set their
PYTHONPATH to achieve the same result.


> So I'm "pushing" to get this behaviour, considering that PXD files have to
> be found at Cython'ization stage (through -I options), while SO/PYD files at
> execution stage (Python stuff). No need for a strong relationship between
> them.

Well, yes, there is a relationship, even in Python. For example, your
exception doctests will break if you import the tested module from a different
package.

Python3 even has a dedicated syntax for relative imports to separate them
clearly from top-level imports. This means that moving modules out of or into
packages can break your code.


> Now if you tell me that it is an intented behaviour, and you don't plan to
> modify it (or support both?), I will stop ennoying you with my requests.

Did you actually describe your use case anywhere? I don't see why users should
be allowed to move modules all over the place. That would result in import
code that will fail miserably when moved to other systems. Why do you use
packages in the first place, if your users don't care about them anyway?

Stefan

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

Reply via email to