Skip to content
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

CythonRecipe: how to handle different settings for different .pyx files? #511

Closed
hottwaj opened this issue Dec 5, 2015 · 3 comments
Closed

Comments

@hottwaj
Copy link
Contributor

hottwaj commented Dec 5, 2015

Hey there, I have an issue that I'm not sure how to make progress on...

The CythonRecipe framework in the revamp framework seems to use the same settings (includes, libs, etc) for every .pyx file in a recipe.

Unless I'm missing something (quite possible!) this is a problem for a custom library I've built because:

  1. the library has some .pyx files that use c and others that use c++, and I can't give instructions on which files to compile using c++ settings (c is assumed for all by the CythonRecipe)
  2. the library has a couple of .pyx files that import different external libs, and I can't specify which .pyx file imports which lib

When using the old toolchain issues 1 and 2 were delegated to the setup.py file I wrote for my library, but with the revamp my setup.py is not actually used to cythonise the .pyx, hence 1 and 2 cause problems.

Am I missing something, or any ideas on how to make progress? Can I somehow use my setup.py to cythonise my .pyx files, instead of relying on the CythonRecipe?

Thanks!

@inclement
Copy link
Member

I thought the revamp does the same as the old toolchain here - for instance, the Kivy recipe shows how the files are cythonised outside the setup.py. The CythonRecipe is supposed to just abstract this to a single class, where this part duplicates exactly what the recipe.sh did. I don't think it was ever generally possible to let the setup.py do the cythonising because cython wasn't installed in the hostpython.

I guess I'm missing something here though, am I wrong about it, or is there a recipe in the old toolchain that demonstrates what you're trying? Did you have any extra behaviour, like installing cython in the hostpython?

I'm not sure how to solve your issue, but certainly it should be a reasonable thing to do. Maybe it would help if you could show your old recipe.sh, would that be possible?

@hottwaj
Copy link
Contributor Author

hottwaj commented Dec 6, 2015

Well that's embarassing: as soon as I read your reply I remembered that I had had to write a customised recipe for the old toolchain, but I'd forgotten that I had done that and assumed it was all in the setup.py file... Sorry for wasting time and thanks for pointing me in the right direction!

@hottwaj hottwaj closed this as completed Dec 6, 2015
@inclement
Copy link
Member

No worries. It sounds like your customisation is more advanced than the
current CythonRecipe, if you think it can be generalised then feel free
to suggest an upgrade to the CythonRecipe, or an alternative with your
method.

On 06/12/15 07:34, hottwaj wrote:

Well that's embarassing: as soon as I read your reply I remembered that
I had had to write a customised recipe for the old toolchain, but I'd
forgotten that I had done that and assumed it was all in the setup.py
file... Sorry for wasting time and thanks for pointing me in the right
direction!


Reply to this email directly or view it on GitHub
#511 (comment).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants