Skip to content

recent changes seem to require adding Cython as a build dependency #359

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

Closed
grlee77 opened this issue Mar 13, 2018 · 2 comments
Closed

recent changes seem to require adding Cython as a build dependency #359

grlee77 opened this issue Mar 13, 2018 · 2 comments

Comments

@grlee77
Copy link
Contributor

grlee77 commented Mar 13, 2018

Per the discussion in #321, there was a preference for distributing the generated C files in the PyPI sdist so that Cython is not a build-time dependency.

However, as part of the changes enabling C99 complex support in #300, some statements such as the following were added to the Cython code:

IF HAVE_C99_CPLX:

These types of statements occur multiple places in both _dwt.pyx and _swt.pyx.

This means that the C code that will be generated will only include these lines if C99 support was enabled. This is problematic in terms of distributing the C code in the sdist: e.g. if the generated code supports C99, but the user's compiler does not!

Unless there is an alternative solution, I think this means we will need to not distribute Cython-generated C files and add Cython as a build dependency in the next release.

@rgommers
Copy link
Member

Hmm, that's unfortunate. The alternative solution is to let the generated code keep that if branch in all cases, not sure how easy that is to do though. Removing the relevant bits of setup.py seems straightforward; in the .pyx files it would be inserting the ifdefs as C code rather than a Python if statement.

If it's not easy then changing to a build time dependency for Cython is also not the end of the world though. We just have to think about what versions of Cython to require: <= latest tested or just leave empty. The latter is nicer for most users (won't force a Cython downgrade in some cases), however new Cython releases may then break our existing releases.

@rgommers
Copy link
Member

rgommers commented Nov 6, 2021

Cython is now a build dependency in pyproject.toml. That should be fine, we're following the same strategy as SciPy there. So I'll close this issue.

@rgommers rgommers closed this as completed Nov 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants