diff --git a/Dockerfile.tmpl b/Dockerfile.tmpl index 11b05eb..f319387 100644 --- a/Dockerfile.tmpl +++ b/Dockerfile.tmpl @@ -167,28 +167,12 @@ RUN pip install jax[cpu] && \ RUN export PATH=/usr/local/cuda/bin:$PATH && \ export CUDA_ROOT=/usr/local/cuda && \ pip install pycuda \ - pynvrtc \ + # TODO(379932879): pip resolver fails when not specified. + pynvrtc==9.2 \ pynvml && \ /tmp/clean-layer.sh {{ end }} -# b/308525631: Pin Matplotlib until seaborn can be upgraded -# to >0.13.0 (now it's stuck by a package conflict with ydata-profiling 4.5.1). -RUN JAXVER=$(pip freeze | grep -e "^jax==") && \ - pip install --upgrade \ - "matplotlib<3.8.0" \ - # ipympl adds interactive widget support for matplotlib - ipympl==0.7.0 \ - "seaborn==0.12.2" \ - pyupset \ - python-dateutil dask dask-expr igraph \ - pyyaml joblib geopy mne pyshp \ - pandas \ - polars \ - flax \ - "${JAXVER}" && \ - /tmp/clean-layer.sh - RUN apt-get update && \ apt-get install -y default-jre && \ /tmp/clean-layer.sh @@ -390,8 +374,7 @@ RUN pip install bleach \ ipykernel \ ipython \ ipython-genutils \ - # Fix qgrid by pinning ipywidgets https://github.com/quantopian/qgrid/issues/376 - ipywidgets==7.7.1 \ + ipywidgets==8.1.5 \ isoweek \ jedi \ jsonschema \ @@ -480,7 +463,6 @@ RUN pip install wandb \ rm -rf /opt/conda/lib/python3.10/site-packages/numpy* && \ pip install "numpy==1.26.4" && \ pip install pytorch-ignite \ - qgrid \ bqplot \ earthengine-api \ transformers \ @@ -543,11 +525,30 @@ ENV TESSERACT_PATH=/usr/bin/tesseract \ # For Theano with MKL MKL_THREADING_LAYER=GNU +# b/308525631: Pin Matplotlib until seaborn can be upgraded +# to >0.13.0 (now it's stuck by a package conflict with ydata-profiling 4.5.1). +RUN JAXVER=$(pip freeze | grep -e "^jax==") && \ + pip install --upgrade \ + "matplotlib==3.7.5" \ + # ipympl adds interactive widget support for matplotlib + ipympl==0.7.0 \ + "seaborn==0.12.2" \ + pyupset \ + python-dateutil dask dask-expr igraph \ + pyyaml joblib geopy mne pyshp \ + pandas \ + polars \ + flax \ + "${JAXVER}" && \ + /tmp/clean-layer.sh + # Temporary fixes and patches # Temporary patch for Dask getting downgraded, which breaks Keras RUN pip install --upgrade dask && \ # Stop jupyter nbconvert trying to rewrite its folder hierarchy mkdir -p /root/.jupyter && touch /root/.jupyter/jupyter_nbconvert_config.py && touch /root/.jupyter/migrated && \ + # TODO(b/380921973): Ensure only matplotlib 3.7.5 files are present. + rm -r /opt/conda/lib/python3.10/site-packages/matplotlib-3.9.2.dist-info/ && \ mkdir -p /.jupyter && touch /.jupyter/jupyter_nbconvert_config.py && touch /.jupyter/migrated && \ # Stop Matplotlib printing junk to the console on first load sed -i "s/^.*Matplotlib is building the font cache using fc-list.*$/# Warning removed by Kaggle/g" /opt/conda/lib/python3.10/site-packages/matplotlib/font_manager.py && \ diff --git a/tests/test_kagglehub.py b/tests/test_kagglehub.py index 37b1124..f2c3e2a 100644 --- a/tests/test_kagglehub.py +++ b/tests/test_kagglehub.py @@ -8,8 +8,10 @@ class TestKagglehub(unittest.TestCase): def test_login(self): with self.assertLogs('kagglehub', level='INFO') as l: with mock.patch("builtins.input") as mock_input: - mock_input.side_effect = ["lastplacelarry", "some-key"] - # Disabling credentials validation since network access is disabled in unittest. - kagglehub.login(validate_credentials=False) + with mock.patch("getpass.getpass") as mock_getpass: + mock_input.side_effect = ["lastplacelarry"] + mock_getpass.return_value = "some-key" - self.assertIn("credentials set", l.output[0]) + kagglehub.login(validate_credentials=False) + + self.assertIn("credentials set", l.output[0]) diff --git a/tests/test_qgrid.py b/tests/test_qgrid.py deleted file mode 100644 index e97ef2a..0000000 --- a/tests/test_qgrid.py +++ /dev/null @@ -1,16 +0,0 @@ -import unittest - -import numpy as np -import pandas as pd - -from qgrid import QgridWidget - - -class TestQgrid(unittest.TestCase): - def test_nans(self): - df = pd.DataFrame([(pd.Timestamp('2017-02-02'), np.nan), - (4, 2), - ('foo', 'bar')]) - view = QgridWidget(df=df) - - self.assertIsNotNone(view.get_changed_df())