@@ -412,11 +412,14 @@ function common::get_packaging_tool() {
412412 echo
413413 export PACKAGING_TOOL="uv"
414414 export PACKAGING_TOOL_CMD="uv pip"
415- if [[ ${AIRFLOW_INSTALLATION_METHOD=} == "." && -f "./pyproject.toml" ]]; then
415+ # --no-binary is needed in order to avoid libxml and xmlsec using different version of libxml2
416+ # (binary lxml embeds its own libxml2, while xmlsec uses system one).
417+ # See https://bugs.launchpad.net/lxml/+bug/2110068
418+ if [[ ${AIRFLOW_INSTALLATION_METHOD=} == "." && -f "./pyproject.toml" ]]; then
416419 # for uv only install dev group when we install from sources
417- export EXTRA_INSTALL_FLAGS="--group=dev"
420+ export EXTRA_INSTALL_FLAGS="--group=dev --no-binary lxml --no-binary xmlsec "
418421 else
419- export EXTRA_INSTALL_FLAGS=""
422+ export EXTRA_INSTALL_FLAGS="--no-binary lxml --no-binary xmlsec "
420423 fi
421424 export EXTRA_UNINSTALL_FLAGS=""
422425 export UPGRADE_TO_HIGHEST_RESOLUTION="--upgrade --resolution highest"
@@ -628,8 +631,12 @@ function install_from_sources() {
628631 echo
629632 echo "${COLOR_BLUE}Attempting to upgrade all packages to highest versions.${COLOR_RESET}"
630633 echo
634+ # --no-binary is needed in order to avoid libxml and xmlsec using different version of libxml2
635+ # (binary lxml embeds its own libxml2, while xmlsec uses system one).
636+ # See https://bugs.launchpad.net/lxml/+bug/2110068
631637 set -x
632- uv sync --all-packages --resolution highest --group dev --group docs --group docs-gen --group leveldb ${extra_sync_flags}
638+ uv sync --all-packages --resolution highest --group dev --group docs --group docs-gen \
639+ --group leveldb ${extra_sync_flags} --no-binary-package lxml --no-binary-package xmlsec
633640 else
634641 # We only use uv here but Installing using constraints is not supported with `uv sync`, so we
635642 # do not use ``uv sync`` because we are not committing and using uv.lock yet.
@@ -686,8 +693,12 @@ function install_from_sources() {
686693 echo
687694 echo "${COLOR_BLUE}Falling back to no-constraints installation.${COLOR_RESET}"
688695 echo
696+ # --no-binary is needed in order to avoid libxml and xmlsec using different version of libxml2
697+ # (binary lxml embeds its own libxml2, while xmlsec uses system one).
698+ # See https://bugs.launchpad.net/lxml/+bug/2110068
689699 set -x
690- uv sync --all-packages --group dev --group docs --group docs-gen --group leveldb ${extra_sync_flags}
700+ uv sync --all-packages --group dev --group docs --group docs-gen \
701+ --group leveldb ${extra_sync_flags} --no-binary-package lxml --no-binary-packag xmlsec
691702 set +x
692703 fi
693704 fi
@@ -1125,13 +1136,19 @@ function check_force_lowest_dependencies() {
11251136 exit 0
11261137 fi
11271138 cd "${AIRFLOW_SOURCES}/providers/${provider_id/.//}" || exit 1
1128- uv sync --resolution lowest-direct
1139+ # --no-binary is needed in order to avoid libxml and xmlsec using different version of libxml2
1140+ # (binary lxml embeds its own libxml2, while xmlsec uses system one).
1141+ # See https://bugs.launchpad.net/lxml/+bug/2110068
1142+ uv sync --resolution lowest-direct --no-binary-package lxml --no-binary-package xmlsec
11291143 else
11301144 echo
11311145 echo "${COLOR_BLUE}Forcing dependencies to lowest versions for Airflow.${COLOR_RESET}"
11321146 echo
11331147 cd "${AIRFLOW_SOURCES}/airflow-core"
1134- uv sync --resolution lowest-direct
1148+ # --no-binary is needed in order to avoid libxml and xmlsec using different version of libxml2
1149+ # (binary lxml embeds its own libxml2, while xmlsec uses system one).
1150+ # See https://bugs.launchpad.net/lxml/+bug/2110068
1151+ uv sync --resolution lowest-direct --no-binary-package lxml --no-binary-package xmlsec
11351152 fi
11361153}
11371154
0 commit comments