* Vincent Bernat <ber...@debian.org>, 2009-07-05, 10:48:
"'%s' is not a valid module name" % module_name)
Pyrex.Compiler.Errors.CompileError:
/build/user-soya_0.14-3-amd64-ECEolt/soya-0.14/_soya.pyx:0:0: 'soya-0.14._soya'
is not a valid module name
make: *** [debian/python-module-stampdir/python-soya] Error 1
This is not easy to fix. A change in pyrex will try to guess full module
name. It gets soya-0.14._soya (while previous versions just get _soya)
instead of soya._soya. This seems simpler to fix in pyrex than in soya.
Actually, I find extracting module names a nice feature of Pyrex. What
is broken is the directory structure of soya. Fortunately, you can
easily work-around this by monkey-patching Pyrex. See the attached
patch. (Please note that I only tested if soya builds fine, not if it
works fine.)
--
Jakub Wilk
diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -80,6 +80,13 @@
MACOSX_DEPLOYMENT_TARGET = os.getenv('MACOSX_DEPLOYMENT_TARGET')
try:
+ from Pyrex.Compiler.Main import Context
+ def extract_module_name(self, path):
+ dir, filename = os.path.split(path)
+ module_name, _ = os.path.splitext(filename)
+ return module_name
+ Context.extract_module_name = extract_module_name
+ del Context
from Pyrex.Distutils import build_ext
HAVE_PYREX = 1
except: