Skip to content

Commit c011b59

Browse files
authored
Install ibmmq from a wheel in IBM MQ lowest-dependency tests (#74132)
Lowest-direct resolution picked ibmmq 2.0.6, which is sdist-only and needed the IBM MQ C client downloaded from public.dhe.ibm.com; the job failed whenever that host timed out. ibmmq 2.1.0 is the first release with a Linux x86_64 wheel, so raising the floor removes the download and its manifest. The tests fall back to the fake ibmmq module when the wheel is installed but the C client library is not available.
1 parent da5af33 commit c011b59

8 files changed

Lines changed: 18 additions & 43 deletions

File tree

‎Dockerfile.ci‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1553,7 +1553,7 @@ function reinstall_shared_distributions() {
15531553
uv pip install --no-deps $(ls -d /opt/airflow/shared/*/)
15541554
}
15551555

1556-
PROVIDERS_NEEDING_PRE_EXTRAS_INSTALL=("ibm.mq")
1556+
PROVIDERS_NEEDING_PRE_EXTRAS_INSTALL=()
15571557

15581558
function run_pre_extras_install_if_registered() {
15591559
local provider_id="${1}"

‎contributing-docs/12_provider_distributions.rst‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -158,8 +158,10 @@ Because the new group is *not* part of ``dev``, a plain ``uv sync`` on a contrib
158158
will not try to install it. The CI image installs it via ``ci-image``.
159159

160160
**Shape B: the Python package's wheel build needs a proprietary SDK that cannot live in the
161-
base CI image** (e.g. IBM MQ's ``ibmmq`` needs the IBM MQ Redistributable Client headers and
162-
``MQ_FILE_PATH`` set at build time). Bundling such SDKs in the base image has licence,
161+
base CI image** (e.g. ``ibmmq`` releases before 2.1.0 were sdist-only and needed the IBM MQ
162+
Redistributable Client headers and ``MQ_FILE_PATH`` set at build time). First check whether
163+
raising the lower bound to a release that ships wheels avoids the build — a download at test
164+
time makes the job depend on the upstream host being reachable. Bundling such SDKs in the base image has licence,
163165
maintenance, and image-size costs that the project does not want to pay on every CI run.
164166
The lowest-direct-dependency provider tests still call ``uv sync --all-extras`` inside the
165167
provider directory, so simply mocking the package in tests is not enough — the sync itself
@@ -185,7 +187,7 @@ must succeed first. Use the per-provider pre-extras-install manifest:
185187

186188
.. code:: yaml
187189
188-
# providers/ibm/mq/pre_extras_install.yaml
190+
# providers/<id>/pre_extras_install.yaml
189191
downloads:
190192
- url: https://public.dhe.ibm.com/.../9.4.0.0-IBM-MQC-Redist-LinuxX64.tar.gz
191193
sha256: <64 lowercase hex chars>

‎providers/ibm/mq/docs/index.rst‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ Install them when installing from PyPI. For example:
139139
==================== ===============================================================================
140140
Extra Dependencies
141141
==================== ===============================================================================
142-
``ibmmq`` ``ibmmq>=2.0.6; platform_machine != "aarch64" and platform_machine != "arm64"``
142+
``ibmmq`` ``ibmmq>=2.1.0; platform_machine != "aarch64" and platform_machine != "arm64"``
143143
``common.messaging`` ``apache-airflow-providers-common-messaging>=2.0.0``
144144
==================== ===============================================================================
145145

‎providers/ibm/mq/pre_extras_install.yaml‎

Lines changed: 0 additions & 33 deletions
This file was deleted.

‎providers/ibm/mq/pyproject.toml‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,9 @@ dependencies = [
7272
# Required at Runtime
7373
# IBM MQ ships its native C client only for Linux x86_64 / Windows x64, so the `ibmmq`
7474
# bindings cannot be built on ARM. Skip it there (mirrors provider.yaml excluded-platforms).
75-
"ibmmq>=2.0.6; platform_machine != \"aarch64\" and platform_machine != \"arm64\"",
75+
# 2.1.0 is the first release with a Linux x86_64 wheel; older ones are sdist-only and need the
76+
# IBM MQ C client to build.
77+
"ibmmq>=2.1.0; platform_machine != \"aarch64\" and platform_machine != \"arm64\"",
7678
]
7779
"common.messaging" = [
7880
"apache-airflow-providers-common-messaging>=2.0.0"

‎providers/ibm/mq/tests/conftest.py‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,12 @@ def _ensure_fake_ibmmq_if_missing():
3434
behavior.
3535
"""
3636

37-
if importlib.util.find_spec("ibmmq") is not None:
38-
# Real package available, nothing to do.
37+
try:
38+
importlib.import_module("ibmmq")
39+
except ImportError:
40+
# Not installed, or installed from a wheel without the IBM MQ C client (libmqm_r) available.
41+
pass
42+
else:
3943
yield
4044
return
4145

‎scripts/docker/entrypoint_ci.sh‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,7 @@ function reinstall_shared_distributions() {
432432
# export. Providers cannot run arbitrary code through this hook. Maintainers should
433433
# review every addition to this list as a privileged change. See
434434
# contributing-docs/12_provider_distributions.rst.
435-
PROVIDERS_NEEDING_PRE_EXTRAS_INSTALL=("ibm.mq")
435+
PROVIDERS_NEEDING_PRE_EXTRAS_INSTALL=()
436436

437437
function run_pre_extras_install_if_registered() {
438438
local provider_id="${1}"

‎uv.lock‎

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)