Skip to content

Commit 0761dd3

Browse files
Fix pip from source build testing
Change-Id: I83da21eae64ac2972f19689186d579b6955fd89b
1 parent 93e8662 commit 0761dd3

1 file changed

Lines changed: 17 additions & 3 deletions

File tree

tests/system/singlesite/omd/test_python.py

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -140,14 +140,28 @@ def test_03_pip_interpreter_version(site: Site, pip_cmd: PipCommand) -> None:
140140

141141

142142
def test_04_pip_user_can_install_non_wheel_packages(site: Site) -> None:
143-
# ibm_db must be compiled from source, so choosing this also ensures that the Python headers
144-
# can be found by pip
143+
# ibm_db is compiled from source, so choosing this also ensures that the Python headers can be
144+
# found by pip. Note that ibm_db publishes prebuilt manylinux wheels which pip prefers over the
145+
# sdist, so --no-binary is what actually makes this a source build.
145146
package_name = "ibm_db"
147+
# Do not downgrade: releases before 3.3.0 miss an `#include <wctype.h>` and do not compile with
148+
# current gcc, and releases before 3.2.5 still use Python APIs that were removed in 3.12.
149+
package_spec = f"{package_name}==3.3.0"
150+
# ibm_db downloads its native CLI driver while building, by default the latest one. Pin it, as
151+
# newer drivers are built against GLIBC_2.32 and cannot be loaded on our older distros, whereas
152+
# v11.5.9 needs at most GLIBC_2.14.
153+
clidriver_version = "v11.5.9"
146154

147155
# We're testing this only for one supported pip command as building from source just takes too long
148156
pip_cmd = PipCommand(["pip3"], False)
149157

150-
assert_install_package(pip_cmd.command + ["install", package_name], package_name, site)
158+
assert_install_package(
159+
["env", f"CLIDRIVER_VERSION={clidriver_version}"]
160+
+ pip_cmd.command
161+
+ ["install", "--no-binary", package_name, package_spec],
162+
package_name,
163+
site,
164+
)
151165
assert_local_package_install_path(site, package_name, _local_package_installation_path(site))
152166
assert_uninstall_and_purge_cache(pip_cmd, package_name, site)
153167

0 commit comments

Comments
 (0)