This is an automated email from the ASF dual-hosted git repository.

damccorm pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/beam.git


The following commit(s) were added to refs/heads/master by this push:
     new f6c7a06d90a Fix Update Python Dependencies (#39534)
f6c7a06d90a is described below

commit f6c7a06d90a9a4d8bfc540d234863cf862017a3a
Author: Abdelrahman Ibrahim <[email protected]>
AuthorDate: Wed Jul 29 16:43:24 2026 +0300

    Fix Update Python Dependencies (#39534)
    
    * Fix Update Python Dependencies
    
    * update tox-cache comment
---
 .../actions/setup-environment-action/action.yml    | 24 +++++++++++++++++++---
 .github/workflows/update_python_dependencies.yml   |  2 ++
 2 files changed, 23 insertions(+), 3 deletions(-)

diff --git a/.github/actions/setup-environment-action/action.yml 
b/.github/actions/setup-environment-action/action.yml
index f101133b5f7..b37d30953ed 100644
--- a/.github/actions/setup-environment-action/action.yml
+++ b/.github/actions/setup-environment-action/action.yml
@@ -56,6 +56,24 @@ runs:
           sdks/python/setup.py
           sdks/python/tox.ini
 
+    # Multiline python-version (e.g. 3.10\n3.11\n...) must not be embedded raw
+    # in cache keys: actions/cache treats each newline-separated line as a
+    # separate key and fails when there are more than 10 ("Keys are limited to
+    # a maximum of 10"). Collapse whitespace into a single key fragment.
+    - name: Sanitize Python version for tox cache key
+      if: ${{ inputs.python-version != '' && inputs.tox-cache == 'true' }}
+      id: py-cache-key
+      shell: bash
+      env:
+        PYTHON_VERSION_INPUT: ${{ inputs.python-version }}
+      run: |
+        if [[ "$PYTHON_VERSION_INPUT" == "default" ]]; then
+          sanitized="310"
+        else
+          sanitized=$(printf '%s' "$PYTHON_VERSION_INPUT" | tr -s '[:space:]' 
'-' | sed 's/^-//;s/-$//')
+        fi
+        echo "sanitized=$sanitized" >> "$GITHUB_OUTPUT"
+
     - name: Cache tox environments
       if: ${{ inputs.python-version != '' && inputs.tox-cache == 'true' }}
       uses: actions/cache@v6
@@ -64,10 +82,10 @@ runs:
           sdks/python/target/.tox
           !sdks/python/target/.tox/**/log
           !sdks/python/target/.tox/.package_cache
-        key: tox-${{ runner.os }}-py${{ inputs.python-version == 'default' && 
'310' || inputs.python-version }}-${{ hashFiles('sdks/python/tox.ini') }}-${{ 
hashFiles('sdks/python/setup.py') }}
+        key: tox-${{ runner.os }}-py${{ steps.py-cache-key.outputs.sanitized 
}}-${{ hashFiles('sdks/python/tox.ini') }}-${{ 
hashFiles('sdks/python/setup.py') }}
         restore-keys: |
-          tox-${{ runner.os }}-py${{ inputs.python-version == 'default' && 
'310' || inputs.python-version }}-${{ hashFiles('sdks/python/tox.ini') }}-
-          tox-${{ runner.os }}-py${{ inputs.python-version == 'default' && 
'310' || inputs.python-version }}-
+          tox-${{ runner.os }}-py${{ steps.py-cache-key.outputs.sanitized 
}}-${{ hashFiles('sdks/python/tox.ini') }}-
+          tox-${{ runner.os }}-py${{ steps.py-cache-key.outputs.sanitized }}-
 
     - name: Install Java
       if: ${{ inputs.java-version != '' }}
diff --git a/.github/workflows/update_python_dependencies.yml 
b/.github/workflows/update_python_dependencies.yml
index f8630ebd0ae..b934f402067 100644
--- a/.github/workflows/update_python_dependencies.yml
+++ b/.github/workflows/update_python_dependencies.yml
@@ -69,6 +69,8 @@ jobs:
           java-version: default
           go-version: default
           disable-cache: true
+          # generatePythonRequirementsAll does not use tox.
+          tox-cache: false
       - name: Update Python Dependencies
         uses: ./.github/actions/gradle-command-self-hosted-action
         with:

Reply via email to