File tree Expand file tree Collapse file tree 2 files changed +16
-4
lines changed
Expand file tree Collapse file tree 2 files changed +16
-4
lines changed Original file line number Diff line number Diff line change @@ -32,6 +32,9 @@ RUN uv pip uninstall --system google-cloud-bigquery-storage
3232# to avoid affecting the larger build, we'll post-install it.
3333RUN uv pip install --no-build-isolation --system "git+https://github.com/Kaggle/learntools"
3434
35+ # DO_NOT_MERGE: Wait for Colab to fix mkl in image.
36+ RUN uv pip install --system --force-reinstall -i https://pypi.anaconda.org/intel/simple numpy
37+
3538# b/328788268 We install an incompatible pair of libs (shapely<2, libpysal==4.9.2) so we can't put this one in the requirements.txt
3639RUN uv pip install --system "libpysal==4.9.2"
3740
Original file line number Diff line number Diff line change 33from distutils .version import StrictVersion
44
55import numpy as np
6- from numpy .distutils .system_info import get_info
6+ import io
7+ from contextlib import redirect_stdout
78
8- class TestNumpy (unittest .TestCase ):
9+ class TestNumpy (unittest .TestCase ):
910 def test_version (self ):
1011 # b/370860329: newer versions are not capable with current tensorflow
1112 self .assertEqual (StrictVersion (np .__version__ ), StrictVersion ("1.26.4" ))
@@ -18,5 +19,13 @@ def test_array(self):
1819 # Numpy must be linked to the MKL. (Occasionally, a third-party package will muck up the installation
1920 # and numpy will be reinstalled with an OpenBLAS backing.)
2021 def test_mkl (self ):
21- # This will throw an exception if the MKL is not linked correctly or return an empty dict.
22- self .assertTrue (get_info ("blas_mkl" ))
22+ try :
23+ from numpy .distutils .system_info import get_info
24+ # This will throw an exception if the MKL is not linked correctly or return an empty dict.
25+ self .assertTrue (get_info ("blas_mkl" ))
26+ except :
27+ # Fallback to check if mkl is present via show_config()
28+ config_out = io .StringIO ()
29+ with redirect_stdout (config_out ):
30+ np .show_config ()
31+ self .assertIn ("mkl_rt" , config_out .getvalue ())
You can’t perform that action at this time.
0 commit comments