From 1c2ecd75eba9daa3fe09c7b86343f85c3f417e47 Mon Sep 17 00:00:00 2001 From: Sergey Fedoseev Date: Thu, 28 Nov 2024 13:28:03 +0100 Subject: [PATCH] numpy < 2 --- .github/workflows/py-ci.yml | 2 +- lambdas/scripts/build_zip.sh | 4 +--- lambdas/tabular_preview/requirements.txt | 6 ++++-- lambdas/tabular_preview/setup.py | 5 +++++ 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/.github/workflows/py-ci.yml b/.github/workflows/py-ci.yml index ffddc520620..d5f1f1fc4e6 100644 --- a/.github/workflows/py-ci.yml +++ b/.github/workflows/py-ci.yml @@ -196,7 +196,7 @@ jobs: # - Run "strip" on shared libraries python -m pip install -t deps --no-deps -r lambdas/${{ matrix.path }}/requirements.txt lambdas/${{ matrix.path }} find deps -name tests -type d -exec rm -r \{} \+ - find deps \! -path '*/numpy.libs/*' \( -name '*.so.*' -o -name '*.so' \) -type f -exec strip \{} \+ + find deps \( -name '*.so.*' -o -name '*.so' \) -type f -exec strip \{} \+ if [ ${{ matrix.path }} == "tabular_preview" ] then diff --git a/lambdas/scripts/build_zip.sh b/lambdas/scripts/build_zip.sh index 60e7a373739..20c3e8faa99 100755 --- a/lambdas/scripts/build_zip.sh +++ b/lambdas/scripts/build_zip.sh @@ -40,9 +40,7 @@ find . \( -name 'test_*' -o -name '*.py' -o -name '*.h' -o -name '*.c' -o -name for lib in pyarrow/*.so.*; do rm -f "${lib%%.*}.so"; done find . -name tests -type d -exec rm -r \{} \+ -# Stripping numpy.libs results in libscipy_openblas64_-ff651d7f.so: ELF load command address/offset not properly aligned -# which is probably caused by some bug in glibc (it happens on Ubuntu 22.04, Amazon Linux 2/2023, but not on Ubuntu 24.04). -find . \! -path '*/numpy.libs/*' \( -name '*.so.*' -o -name '*.so' \) -type f -exec strip \{} \+ +find . \( -name '*.so.*' -o -name '*.so' \) -type f -exec strip \{} \+ MAX_SIZE=262144000 size=$(du -b -s . | cut -f 1) diff --git a/lambdas/tabular_preview/requirements.txt b/lambdas/tabular_preview/requirements.txt index 72f0c5c8d88..f628b1031cd 100644 --- a/lambdas/tabular_preview/requirements.txt +++ b/lambdas/tabular_preview/requirements.txt @@ -33,8 +33,10 @@ multidict==6.1.0 # via # aiohttp # yarl -numpy==2.1.3 - # via pandas +numpy==1.26.4 + # via + # pandas + # t4_lambda_tabular_preview (setup.py) openpyxl==3.1.5 # via t4_lambda_tabular_preview (setup.py) pandas==2.2.3 diff --git a/lambdas/tabular_preview/setup.py b/lambdas/tabular_preview/setup.py index e0fbe2ec70f..c7333b3ce2b 100644 --- a/lambdas/tabular_preview/setup.py +++ b/lambdas/tabular_preview/setup.py @@ -11,6 +11,11 @@ "xlrd >=2,< 3", "openpyxl >=3,<4 ", "fsspec[http] >= 2022.1.0", + # Stripping numpy.libs in numpy 2 results in + # libscipy_openblas64_-ff651d7f.so: ELF load command address/offset not properly aligned + # which is probably caused by some bug in glibc (it happens on Ubuntu 22.04, Amazon Linux 2/2023, + # but not on Ubuntu 24.04). + "numpy < 2", ( "t4_lambda_shared @ https://github.com/quiltdata/quilt/archive/" "f45d8ab51f2d60e98efda7510322f94d822e4eb4.zip"