Repository navigation
Update numpy hook for compatibility with 1.22 - #6474
Conversation
The referenced issues do not seem to be actual anymore. On the other hand, the xfail annotation hides the fact that scipy tests end up broken with numpy 1.22.
We are unlikely to encounter scipy < 0.16 under python versions that we support. The removed version comparison, while harmless by itself, used distutils.LooseVersion, so removing the check also allows us to remove dependency on distutils for this particular test.
52e4341 to
4926900
Compare
As of numpy 1.22, distutils and numpy.distutils are required by numpy.testing (due to added import of numpy.testing._private.extbuild), which in turn is used for example by scipy.optimize (via its scipy.optimize._constraints module). So we cannot exclude them anymore, except for earlier numpy versions.
|
[Sigh], yet again I find myself wishing that NumPy's test suite and building machinery where not part of the NumPy package itself. |
|
Yeah, the best part is that |
For python 3.7, use 1.21.5, which is the last release supporting python 3.7. Use 1.22 with python 3.8 and newer, including python 3.10.
I'll try it as a pull request and see what they say. At the very least, having that dependency knocks up the |
|
Although, now that I remember that scipy's test suite takes about a day and a half to run, this may take a while. |
|
This takes care of of I noticed |
|
I imagine that |
There are a couple of others which are only loaded by some submodules. But it's the same story for each of them - they're all trivially replaceable. Although only the last is actually loaded on importing anything public. |
As of
numpy1.22.0,numpy.testingimportsnumpy.testing._private.extbuild, which in turn importsnumpy.distutilsanddistutilsthat we explicitly exclude in the hook.The
numpy.testingis imported byscipy.optimize(viascipy.optimize._constraints); therefore, a frozen application using that module and numpy 1.22 ends up with missingnumpy.distutilsmodule error, as seen in #6473.But before we tackle
numpyhook itself, the scipy tests need to be cleaned up a bit - the lack of failure on Windows and macOS runners due to xfail does not exactly inspire confidence...