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

cdionysio pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/systemds.git


The following commit(s) were added to refs/heads/main by this push:
     new 9f8e37a494 [MINOR] Move Package Dependencies for Python Testing
9f8e37a494 is described below

commit 9f8e37a4943f608f766458633d6aa6773db1710b
Author: Christina Dionysio <[email protected]>
AuthorDate: Thu Oct 9 10:34:46 2025 +0200

    [MINOR] Move Package Dependencies for Python Testing
    
    This commit divides the installation of packages into a part that installs 
all generally needed packages and one part that is only installed for specific 
test runs like Scuro. Additionally, torch hub get's cached which reduces setup 
time.
---
 .github/workflows/python.yml              | 31 ++++++++++++++++++++++---------
 src/main/python/systemds/utils/helpers.py |  1 -
 2 files changed, 22 insertions(+), 10 deletions(-)

diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml
index 0e05dca308..ac2857cc22 100644
--- a/.github/workflows/python.yml
+++ b/.github/workflows/python.yml
@@ -46,6 +46,8 @@ jobs:
   test:
     runs-on: ${{ matrix.os }}
     timeout-minutes: 60
+    env: 
+      TORCH_HOME: ${{ github.workspace }}/.torch  # cache root for 
hub/checkpoints
     strategy:
       fail-fast: false
       matrix:
@@ -110,15 +112,6 @@ jobs:
           requests \
           pandas \
           unittest-parallel \
-          torchvision \
-          transformers \
-          opencv-python \
-          torch \
-          librosa \
-          h5py \
-          gensim \
-          opt-einsum \
-          nltk
 
     - name: Build Python Package
       run: |
@@ -150,9 +143,29 @@ jobs:
         cd src/main/python
         ./tests/federated/runFedTest.sh
 
+    - name: Cache Torch Hub
+      if: ${{ matrix.test_mode == 'scuro' }}
+      id: torch-cache
+      uses: actions/cache@v4
+      with:
+        path: .torch
+        key: ${{ runner.os }}-torch-${{ hashFiles('requirements.txt') }}
+        restore-keys: |
+            ${{ runner.os }}-torch-
+
     - name: Run Scuro Python Tests 
       if: ${{ matrix.test_mode == 'scuro' }}
       run: |
+        pip install \
+          torchvision \
+          transformers \
+          opencv-python \
+          torch \
+          librosa \
+          h5py \
+          gensim \
+          opt-einsum \
+          nltk
         cd src/main/python
         python -m unittest discover -s tests/scuro -p 'test_*.py'
 
diff --git a/src/main/python/systemds/utils/helpers.py 
b/src/main/python/systemds/utils/helpers.py
index 887b3140eb..8fa6e81069 100644
--- a/src/main/python/systemds/utils/helpers.py
+++ b/src/main/python/systemds/utils/helpers.py
@@ -23,7 +23,6 @@ import os
 from importlib.util import find_spec
 from itertools import chain
 from typing import Dict, Iterable
-import torch
 from systemds.utils.consts import MODULE_NAME
 
 

Reply via email to