From 990e5365cc711e952d7de4eb873d703e2eb88eae Mon Sep 17 00:00:00 2001 From: jrmccluskey Date: Thu, 6 Aug 2026 15:19:19 +0000 Subject: [PATCH] Fix Python 3.14 Container Build, Streamline Installation --- sdks/python/container/Dockerfile | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/sdks/python/container/Dockerfile b/sdks/python/container/Dockerfile index a1e17edb82d1..acb637521c92 100644 --- a/sdks/python/container/Dockerfile +++ b/sdks/python/container/Dockerfile @@ -49,8 +49,6 @@ RUN \ rm -rf /var/lib/apt/lists/* && \ - pip install --upgrade pip setuptools wheel && \ - # Install required packages for Beam Python SDK and common dependencies used by users. # use --no-deps to ensure the list includes all transitive dependencies. # use --prefer-binary to avoid compiling wheels from source when prebuilt wheels exist. @@ -92,18 +90,12 @@ RUN \ if [ "${py_version}" = "3.10" ] || [ "${py_version}" = "3.11" ]; then \ pip install upgrade_ensurepip; \ python3 -m upgrade_ensurepip; \ - else \ - python3 /tmp/upgrade_bundled_pip.py; \ - fi; \ - # setuptools is not bundled with ensurepip in Python 3.12+ - if [ "${py_version}" = "3.10" ] || [ "${py_version}" = "3.11" ]; then \ find /usr/local/lib/python${py_version}/ensurepip/_bundled/setuptools-* -type f ! -name $(basename $(ls -v /usr/local/lib/python${py_version}/ensurepip/_bundled/setuptools-*-py3-none-any.whl | tail -n 1)) -delete; \ - fi; \ - find /usr/local/lib/python${py_version}/ensurepip/_bundled/pip-* -type f ! -name $(basename $(ls -v /usr/local/lib/python${py_version}/ensurepip/_bundled/pip-*-py3-none-any.whl | tail -n 1)) -delete; \ - if [ "${py_version}" = "3.10" ] || [ "${py_version}" = "3.11" ]; then \ pip uninstall upgrade_ensurepip -y; \ + else \ + python3 /tmp/upgrade_bundled_pip.py; \ fi; \ - python3 -m ensurepip; + find /usr/local/lib/python${py_version}/ensurepip/_bundled/pip-* -type f ! -name $(basename $(ls -v /usr/local/lib/python${py_version}/ensurepip/_bundled/pip-*-py3-none-any.whl | tail -n 1)) -delete; ENTRYPOINT ["/opt/apache/beam/boot"]