-
Notifications
You must be signed in to change notification settings - Fork 66
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Document how to use generated Cython .pxi
headers
#589
Comments
At a quick look this looks like a bug. However, the bug is in Meson, not in meson-python. It should be reported there. If you can synthesize a minimal example that shows the problem (not the compilation error, but the bogus dependencies) it would make isolating and fixing the problem much easier. I suspect that there are not that many projects using generated |
I had a quick look and actually Meson includes a test case that does precisely this: a Cython extension module with a generated In your example, this would be something like: _hashtable_pxi_dep = declare_dependency(sources: _hashtable_class_helper, _hashtable_func_helper)
py.extension_module(
hashtable,
'hashtable.pyx',
dependencies: _hashtable_pxi_dep,
cython_args: cython_args,
...
) Can you check if this solves your issue? |
Ah OK - that makes sense. As far as the dotgraph is concerned I still the same output but will test and see |
Looks like that did it - thanks @dnicolodi ! |
There are a few subtleties in compiling Cython. It would be nice to have a section in the documentation dedicated to Cython. Let's turn this issue into a documentation issue. |
.pxi
headers
Sometimes when compiling pandas you end up having to compile twice to get the library to completely build. The files that get compiled the second time tend to be the outputs of a Tempita process.
Here are some small excerpts from pandas (some parts intentionally omitted to try and keep minimal):
When I look at the dotgraph that ninja generates, I noticed that the tempita outputs are declared as dependencies of both the
cython_COMPILER
andc_COMPILER
steps, which is where I think a possible race condition leading up to thec_COMPILER
step could be what requires a recompile.Shouldn't the generated cython files only be a dependency for the
cython_COMPILER
? Is there a way to explicitly declare this?The text was updated successfully, but these errors were encountered: