Hi! On 1 Mai, 21:46, [email protected] wrote: > Anyway. It seems the key problem is that the modules in the package > pGroupCohomology are unaware that they belong to a package. And I have > no clue why.
The thread here seems relevant: http://www.mail-archive.com/[email protected]/msg02790.html It starts with the same observation that when a cython module foo with a class Foo is part of a package pkg then one has pkg.foo.Foo ().__module__ == 'foo', while it should be == 'pkg.foo'. It is also said (if I understand correctly) that it is a pyrex vs. cython issue. The difference is that the poster also wants to be able to fix the fully qualified module name at run time, not at compile time. I would be happy to fix the fully qualified module name at compile time --- but I don't know how, since Cython apparently gets it wrong. Meanwhile I wonder how all the extension modules in Sage get their fully qualified names. After Robert's advice off list, I changed the folder names in my sources so that it reflects the intended package- module structure. Now I have spkg-install src/ setup.py pGroupCohomology/ (before, i used CohoSrc/) __init__.py mtx.pyx ... In setup.py, I have name="pGroupCohomology", packages=["pGroupCohomology"], ext_modules=[... Extension("pGroupCohomology.mtx", sources = ["pGroupCohomology/mtx.pyx"], libraries = ["mtx"], include_dirs = ["mtx2.2.3/src/", "pGroupCohomology"] ), ... ] But still mtx does not now that it is part of the pGroupCohomology package. And I don't see a fundamental difference to all the 100s extensions in Sage. Is setup.py not the right place to determine the package-module structure? Is it needed to hard-code the fully qualified name into mtx.pyx? But how? Cheers, Simon --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/sage-support URLs: http://www.sagemath.org -~----------~----~----~----~------~----~------~--~---
