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

Possible cyclic dependency with numpy #1843

Closed
infinity0 opened this issue Aug 24, 2017 · 1 comment
Closed

Possible cyclic dependency with numpy #1843

infinity0 opened this issue Aug 24, 2017 · 1 comment

Comments

@infinity0
Copy link

infinity0 commented Aug 24, 2017

An issue regarding a potential cyclic dependency was brought up on the Debian bug tracker:

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=870426

Apparently cython needs numpy to run its tests, but numpy also depends on cython. If we build cython without numpy, does this result in the same binary or does it have less capabilities? I can see for example:

Cython-0.26$ grep -Ri numpy
[..]
Cython/Build/Inline.py:    elif 'numpy' in sys.modules and isinstance(arg, sys.modules['numpy'].ndarray):
[..]

which suggests that this might be the case.

If true, is it possible to split off the numpy-related parts of the cython build into separate files, so that they can be put into separate binary Debian packages that can be omitted if one wishes to run the build without numpy? Importantly, the non-numpy files would then remain identical, when running the build with/without numpy.

(The alternative is that the "cython" packages contains different content when built with/without numpy, which is problematic for binary reproducibility purposes.)

@scoder
Copy link
Contributor

scoder commented Aug 25, 2017

Both the C code that Cython generates and the installed Cython binaries will always be the same, regardless of any externally installed dependencies. That's an intentional and highly valued feature.

The only reason why there is a build dependency on NumPy is the Cython test suite. It contains tests that use NumPy, and they will be disabled if NumPy is not installed. If you want a complete test suite run, you should install NumPy, as well as the other external packages listed in the test runner, currently IPython/Jupyter and Jedi (the other modules in that list come with Cython or Python). Since Debian builds on so many different platforms, running the complete test suite seems desirable, especially with the native data types that NumPy makes available. But it's not a strict requirement for the resulting package. After all, you could also build the Cython package without running the test suite at all...

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