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
32
32
# to avoid affecting the larger build, we'll post-install it.
33
33
RUN uv pip install --no-build-isolation --system "git+https://github.com/Kaggle/learntools"
34
34
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
+
35
38
# 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
36
39
RUN uv pip install --system "libpysal==4.9.2"
37
40
Original file line number Diff line number Diff line change 3
3
from distutils .version import StrictVersion
4
4
5
5
import numpy as np
6
- from numpy .distutils .system_info import get_info
6
+ import io
7
+ from contextlib import redirect_stdout
7
8
8
- class TestNumpy (unittest .TestCase ):
9
+ class TestNumpy (unittest .TestCase ):
9
10
def test_version (self ):
10
11
# b/370860329: newer versions are not capable with current tensorflow
11
12
self .assertEqual (StrictVersion (np .__version__ ), StrictVersion ("1.26.4" ))
@@ -18,5 +19,13 @@ def test_array(self):
18
19
# Numpy must be linked to the MKL. (Occasionally, a third-party package will muck up the installation
19
20
# and numpy will be reinstalled with an OpenBLAS backing.)
20
21
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