Skip to content

Commit 902fda3

Browse files
authored
chore: remove unused packages & rework optional module tests (#1806)
1 parent 5765cae commit 902fda3

File tree

4 files changed

+61
-18
lines changed

4 files changed

+61
-18
lines changed

docker/build_scripts/install-build-packages.sh

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,18 +15,19 @@ source "${MY_DIR}/build_utils.sh"
1515
# make sure the corresponding library is added to RUNTIME_DEPS if applicable
1616

1717
if [ "${OS_ID_LIKE}" = "rhel" ]; then
18-
COMPILE_DEPS=(bzip2-devel ncurses-devel readline-devel gdbm-devel libpcap-devel xz-devel openssl openssl-devel keyutils-libs-devel krb5-devel libcom_err-devel curl-devel uuid-devel libffi-devel kernel-headers libdb-devel perl-IPC-Cmd)
18+
COMPILE_DEPS=(bzip2-devel ncurses-devel readline-devel gdbm-devel xz-devel openssl openssl-devel curl-devel uuid-devel libffi-devel kernel-headers perl-IPC-Cmd)
1919
if [ "${AUDITWHEEL_POLICY}" == "manylinux2014" ]; then
20-
COMPILE_DEPS+=(libidn-devel libXft-devel)
20+
COMPILE_DEPS+=(libXft-devel)
21+
COMPILE_DEPS+=(keyutils-libs-devel krb5-devel libcom_err-devel libidn-devel) # we rebuild curl
2122
elif [ "${AUDITWHEEL_POLICY}" == "manylinux_2_28" ]; then
22-
COMPILE_DEPS+=(libidn-devel tk-devel)
23+
COMPILE_DEPS+=(tk-devel)
2324
else
24-
COMPILE_DEPS+=(libidn2-devel tk-devel)
25+
COMPILE_DEPS+=(tk-devel)
2526
fi
2627
elif [ "${OS_ID_LIKE}" == "debian" ]; then
27-
COMPILE_DEPS=(libbz2-dev libncurses-dev libreadline-dev tk-dev libgdbm-dev libdb-dev libpcap-dev liblzma-dev openssl libssl-dev libkeyutils-dev libkrb5-dev comerr-dev libidn2-0-dev libcurl4-openssl-dev uuid-dev libffi-dev linux-headers-generic)
28+
COMPILE_DEPS=(libbz2-dev libncurses-dev libreadline-dev tk-dev libgdbm-dev libdb-dev liblzma-dev openssl libssl-dev libcurl4-openssl-dev uuid-dev libffi-dev linux-headers-generic)
2829
elif [ "${OS_ID_LIKE}" == "alpine" ]; then
29-
COMPILE_DEPS=(bzip2-dev ncurses-dev readline-dev tk-dev gdbm-dev libpcap-dev xz-dev openssl openssl-dev keyutils-dev krb5-dev libcom_err libidn-dev curl-dev util-linux-dev libffi-dev linux-headers)
30+
COMPILE_DEPS=(bzip2-dev ncurses-dev readline-dev tk-dev gdbm-dev xz-dev openssl openssl-dev curl-dev util-linux-dev libffi-dev linux-headers)
3031
else
3132
echo "Unsupported policy: '${AUDITWHEEL_POLICY}'"
3233
exit 1

docker/build_scripts/install-runtime-packages.sh

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -46,25 +46,26 @@ fi
4646

4747
# RUNTIME_DEPS: Runtime dependencies. c.f. install-build-packages.sh
4848
if [ "${OS_ID_LIKE}" == "rhel" ]; then
49-
RUNTIME_DEPS=(zlib bzip2 expat ncurses readline gdbm libpcap xz openssl keyutils-libs libkadm5 libcom_err libcurl uuid libffi libdb)
49+
RUNTIME_DEPS=(zlib bzip2 expat ncurses readline gdbm xz openssl libcurl uuid libffi)
5050
if [ "${AUDITWHEEL_POLICY}" == "manylinux2014" ]; then
51-
RUNTIME_DEPS+=(libidn libXft)
51+
RUNTIME_DEPS+=(libXft)
52+
RUNTIME_DEPS+=(keyutils-libs libkadm5 libcom_err libidn) # we rebuild curl
5253
elif [ "${AUDITWHEEL_POLICY}" == "manylinux_2_28" ]; then
53-
RUNTIME_DEPS+=(libidn tk)
54+
RUNTIME_DEPS+=(tk)
5455
else
55-
RUNTIME_DEPS+=(libidn2 tk)
56+
RUNTIME_DEPS+=(tk)
5657
# for graalpy
5758
RUNTIME_DEPS+=(libxcrypt-compat)
5859
fi
5960
elif [ "${OS_ID_LIKE}" == "debian" ]; then
60-
RUNTIME_DEPS=(zlib1g libbz2-1.0 libexpat1 libncurses6 libreadline8 tk libgdbm6 libdb5.3 libpcap0.8 liblzma5 libkeyutils1 libkrb5-3 libcom-err2 libidn2-0 libcurl4 uuid)
61+
RUNTIME_DEPS=(zlib1g libbz2-1.0 libexpat1 libncurses6 libreadline8 tk libgdbm6 libdb5.3 liblzma5 libcurl4 uuid)
6162
if [ "${AUDITWHEEL_POLICY}" == "manylinux_2_31" ]; then
6263
RUNTIME_DEPS+=(libffi7 libssl1.1)
6364
else
6465
RUNTIME_DEPS+=(libffi8 libssl3)
6566
fi
6667
elif [ "${OS_ID_LIKE}" == "alpine" ]; then
67-
RUNTIME_DEPS=(zlib bzip2 expat ncurses-libs readline tk gdbm db xz openssl keyutils-libs krb5-libs libcom_err libidn2 libcurl libuuid libffi)
68+
RUNTIME_DEPS=(zlib bzip2 expat ncurses-libs readline tk gdbm xz openssl libcurl libuuid libffi)
6869
else
6970
echo "Unsupported policy: '${AUDITWHEEL_POLICY}'"
7071
exit 1
@@ -116,7 +117,7 @@ if [ "${AUDITWHEEL_POLICY}" == "manylinux2014" ]; then
116117
fi
117118
fixup-mirrors
118119
elif [ "${OS_ID_LIKE}" == "rhel" ]; then
119-
BASE_TOOLS+=(glibc-locale-source glibc-langpack-en hardlink hostname libcurl libnsl libxcrypt which)
120+
BASE_TOOLS+=(glibc-locale-source glibc-langpack-en gzip hardlink hostname libcurl libnsl libxcrypt which)
120121
echo "tsflags=nodocs" >> /etc/dnf/dnf.conf
121122
dnf -y upgrade
122123
EPEL=epel-release

docker/tests/modules-check.py

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
import unittest
2+
3+
4+
class TestModules(unittest.TestCase):
5+
def test_sqlite3(self):
6+
# Make sure sqlite3 module can be loaded properly and is the manylinux version one
7+
# c.f. https://github.com/pypa/manylinux/issues/1030
8+
import sqlite3
9+
10+
print(f"{sqlite3.sqlite_version=}", end=" ", flush=True)
11+
assert sqlite3.sqlite_version_info[0:2] >= (3, 50)
12+
13+
def test_tkinter(self):
14+
# Make sure tkinter module can be loaded properly
15+
import tkinter as tk
16+
17+
print(f"{tk.TkVersion=}", end=" ", flush=True)
18+
assert tk.TkVersion >= 8.6
19+
20+
def test_gdbm(self):
21+
# depends on libgdbm
22+
import dbm.gnu # noqa: F401
23+
24+
def test_ndbm(self):
25+
# depends on libdb or libgdbm_compat
26+
import dbm.ndbm # noqa: F401
27+
28+
def test_readline(self):
29+
# depends on libreadline
30+
import readline # noqa: F401
31+
32+
def test_ncurses(self):
33+
# depends on libncurses
34+
import curses
35+
36+
print(f"{curses.ncurses_version=}", end=" ", flush=True)
37+
38+
def test_ctypes(self):
39+
# depends on libffi
40+
import ctypes # noqa: F401
41+
42+
43+
if __name__ == "__main__":
44+
unittest.main(verbosity=2)

docker/tests/run_tests.sh

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,8 @@ for PYTHON in /opt/python/*/bin/python; do
6060
PYVERS=$(${PYTHON} -c "import sys; print('.'.join(map(str, sys.version_info[:2])))")
6161
PY_GIL=$(${PYTHON} -c "import sysconfig; print('t' if sysconfig.get_config_vars().get('Py_GIL_DISABLED', 0) else '')")
6262
if [ "${IMPLEMENTATION}" == "cpython" ]; then
63-
# Make sure sqlite3 module can be loaded properly and is the manylinux version one
64-
# c.f. https://github.com/pypa/manylinux/issues/1030
65-
$PYTHON -c 'import sqlite3; print(sqlite3.sqlite_version); assert sqlite3.sqlite_version_info[0:2] >= (3, 50)'
66-
# Make sure tkinter module can be loaded properly
67-
$PYTHON -c 'import tkinter; print(tkinter.TkVersion); assert tkinter.TkVersion >= 8.6'
63+
# check optional modules can be loaded
64+
$PYTHON "${MY_DIR}/modules-check.py"
6865
# cpython shall be available as python
6966
LINK_VERSION=$("python${PYVERS}${PY_GIL}" -VV)
7067
REAL_VERSION=$(${PYTHON} -VV)

0 commit comments

Comments
 (0)