From eff2889443b920c62769d8c64aba44617f8702a9 Mon Sep 17 00:00:00 2001 From: Devin Smith Date: Tue, 27 Feb 2024 07:54:26 -0800 Subject: [PATCH] Update auditwheel command to use --exclude The internal structure of auditwheel has changed with the 6.0.0 release, causing our current script to break: ``` Traceback (most recent call last): File "//auditwheel-keep-pyarrow.py", line 4, in from auditwheel.policy import _POLICIES ImportError: cannot import name '_POLICIES' from 'auditwheel.policy' (/usr/local/lib/python3.10/site-packages/auditwheel/policy/__init__.py) ``` This PR fixes that by relying on the command line `--exclude` flag. https://github.com/pypa/auditwheel/releases/tag/6.0.0 --- contexts/turbodbc-wheel/Dockerfile | 7 ++++--- contexts/turbodbc-wheel/auditwheel-keep-pyarrow.py | 12 ------------ contexts/turbodbc-wheel/requirements.txt | 4 ++-- 3 files changed, 6 insertions(+), 17 deletions(-) delete mode 100644 contexts/turbodbc-wheel/auditwheel-keep-pyarrow.py diff --git a/contexts/turbodbc-wheel/Dockerfile b/contexts/turbodbc-wheel/Dockerfile index a4789ee..2f376b0 100644 --- a/contexts/turbodbc-wheel/Dockerfile +++ b/contexts/turbodbc-wheel/Dockerfile @@ -25,12 +25,13 @@ RUN \ set -eux; \ pip wheel --no-cache-dir -w /wheels-tmp turbodbc==4.8.0 -RUN \ - --mount=type=bind,source=auditwheel-keep-pyarrow.py,target=auditwheel-keep-pyarrow.py \ - python auditwheel-keep-pyarrow.py \ +RUN set -eux; \ + auditwheel \ repair \ --plat manylinux_2_35_$(uname -m) \ --only-plat \ + --exclude libarrow_python.so \ + --exclude libarrow.so.1400 \ --wheel-dir /wheels \ /wheels-tmp/turbodbc* diff --git a/contexts/turbodbc-wheel/auditwheel-keep-pyarrow.py b/contexts/turbodbc-wheel/auditwheel-keep-pyarrow.py deleted file mode 100644 index 9d5fa16..0000000 --- a/contexts/turbodbc-wheel/auditwheel-keep-pyarrow.py +++ /dev/null @@ -1,12 +0,0 @@ -import re -import sys -from auditwheel.main import main -from auditwheel.policy import _POLICIES - -for policy in _POLICIES: - policy['lib_whitelist'].append('libarrow_python.so') - policy['lib_whitelist'].append('libarrow.so.1400') - -if __name__ == '__main__': - sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) - sys.exit(main()) diff --git a/contexts/turbodbc-wheel/requirements.txt b/contexts/turbodbc-wheel/requirements.txt index 5ab99e8..3030d70 100644 --- a/contexts/turbodbc-wheel/requirements.txt +++ b/contexts/turbodbc-wheel/requirements.txt @@ -1,5 +1,5 @@ wheel -auditwheel +auditwheel>=6.0.0 patchelf # The following requirements are copied from turbodbc/setup.py setup_requires @@ -10,5 +10,5 @@ numpy>=1.20 pybind11>=2.10.4 # hack to ensure turbodbc builds pyarrow bindings -# auditwheel-keep-pyarrow.py is targeting pyarrow 13 +# Ensure this is compatible with the auditwheel --exclude pyarrow==14.0.1