From 03e5316c924a2b568596b3b5be095b169aa71325 Mon Sep 17 00:00:00 2001 From: Devin Smith Date: Tue, 12 Mar 2024 16:34:20 -0700 Subject: [PATCH] Update auditwheel command to use --exclude (#132) 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 "/home/runner/work/jpy/jpy/.github/env/Linux/auditwheel-keep-libjvm.py", line 4, in from auditwheel.policy import _POLICIES ImportError: cannot import name '_POLICIES' from 'auditwheel.policy' (/opt/hostedtoolcache/Python/3.12.2/x64/lib/python3.12/site-packages/auditwheel/policy/__init__.py) ``` This PR fixes that by relying on the command line `--exclude` flag. Very similar to PR from https://github.com/deephaven/deephaven-server-docker/pull/83 https://github.com/pypa/auditwheel/releases/tag/6.0.0 --- .github/env/Linux/auditwheel-keep-libjvm.py | 11 ----------- .github/env/Linux/bdist-wheel.sh | 3 ++- .github/env/Linux/requirements.txt | 4 +++- 3 files changed, 5 insertions(+), 13 deletions(-) delete mode 100755 .github/env/Linux/auditwheel-keep-libjvm.py diff --git a/.github/env/Linux/auditwheel-keep-libjvm.py b/.github/env/Linux/auditwheel-keep-libjvm.py deleted file mode 100755 index 4f77bae4..00000000 --- a/.github/env/Linux/auditwheel-keep-libjvm.py +++ /dev/null @@ -1,11 +0,0 @@ -import re -import sys -from auditwheel.main import main -from auditwheel.policy import _POLICIES - -for policy in _POLICIES: - policy['lib_whitelist'].append('libjvm.so') - -if __name__ == '__main__': - sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) - sys.exit(main()) diff --git a/.github/env/Linux/bdist-wheel.sh b/.github/env/Linux/bdist-wheel.sh index a5de44ff..04716174 100755 --- a/.github/env/Linux/bdist-wheel.sh +++ b/.github/env/Linux/bdist-wheel.sh @@ -12,9 +12,10 @@ python -m pip install -r "${__dir}/requirements.txt" python setup.py bdist_wheel --dist-dir dist.linux # Note: auditwheel only works with a single file argument - we are relying on finding exactly one wheel -python "${__dir}/auditwheel-keep-libjvm.py" \ +auditwheel \ repair \ --plat "manylinux_2_17_$(arch)" \ --only-plat \ + --exclude libjvm.so \ --wheel-dir dist/ \ dist.linux/* diff --git a/.github/env/Linux/requirements.txt b/.github/env/Linux/requirements.txt index a0d07ab7..3828bf67 100644 --- a/.github/env/Linux/requirements.txt +++ b/.github/env/Linux/requirements.txt @@ -1,4 +1,6 @@ setuptools wheel -auditwheel +auditwheel>=6.0.0; python_version >= '3.8' +auditwheel>=5.4.0; python_version == '3.7' +auditwheel>=5.3.0; python_version == '3.6' patchelf