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

Fix build due to numpy #1430

Merged
merged 1 commit into from
Oct 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions Dockerfile.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,8 @@ ADD patches/keras_internal.py \
# b/350573866: xgboost v2.1.0 breaks learntools
RUN apt-get install -y libfreetype6-dev && \
apt-get install -y libglib2.0-0 libxext6 libsm6 libxrender1 libfontconfig1 --fix-missing && \
rm -rf /opt/conda/lib/python3.10/site-packages/numpy* && \
pip install "numpy==1.26.4" && \
pip install gensim \
textblob \
wordcloud \
Expand Down Expand Up @@ -425,8 +427,7 @@ RUN pip install bleach \
webencodings \
widgetsnbextension \
# Require pyarrow newer than https://github.com/advisories/GHSA-5wvp-7f3h-6wmm
{{ if eq .Accelerator "gpu" }} pyarrow {{ else }} "pyarrow>=14.0.1" {{ end }} \
fastai
{{ if eq .Accelerator "gpu" }} pyarrow {{ else }} "pyarrow>=14.0.1" {{ end }}

RUN python -m spacy download en_core_web_sm && python -m spacy download en_core_web_lg && \
apt-get update && apt-get install -y ffmpeg && \
Expand Down Expand Up @@ -470,7 +471,8 @@ RUN pip install wandb \
Rtree \
accelerate && \
apt-get -y install libspatialindex-dev && \
rm -rf /opt/conda/lib/python3.10/site-packages/numpy* && \
# b/370860329: newer versions are not capable with current tensorflow
rm -rf /opt/conda/lib/python3.10/site-packages/numpy* && \
pip install "numpy==1.26.4" && \
pip install pytorch-ignite \
qgrid \
Expand Down Expand Up @@ -501,6 +503,8 @@ RUN pip install wandb \
timm \
torchinfo && \
pip install git+https://github.com/facebookresearch/segment-anything.git && \
# b/370860329: newer versions are not capable with current tensorflow
pip install --no-dependencies fastai fastdownload && \
# b/343971718: remove duplicate aiohttp installs, and reinstall it
rm -rf /opt/conda/lib/python3.10/site-packages/aiohttp* && \
mamba install --force-reinstall -y aiohttp && \
Expand Down
7 changes: 7 additions & 0 deletions tests/test_fastai.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@
from fastai.tabular.all import *

class TestFastAI(unittest.TestCase):
# Basic import
def test_basic(self):
import fastai
import fastcore
import fastprogress
import fastdownload

def test_has_version(self):
self.assertGreater(len(fastai.__version__), 2)

Expand Down
8 changes: 7 additions & 1 deletion tests/test_numpy.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
import unittest

from distutils.version import StrictVersion

import numpy as np
from numpy.distutils.system_info import get_info

class TestNumpy(unittest.TestCase):
class TestNumpy(unittest.TestCase):
def test_version(self):
# b/370860329: newer versions are not capable with current tensorflow
self.assertEqual(StrictVersion(np.__version__), StrictVersion("1.26.4"))

def test_array(self):
array = np.array([1, 3])

Expand Down