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

estrauss 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 017af0b691 [SYSTEMDS-3901] Updated Python CI Test setup
017af0b691 is described below

commit 017af0b69122b90638c3c50b776587e50c909965
Author: e-strauss <[email protected]>
AuthorDate: Thu Jul 31 19:29:05 2025 +0200

    [SYSTEMDS-3901] Updated Python CI Test setup
    
    - split down of python test runs: w/ env, w/o env, federated
    - separate python formatting test
    
    These changes reduce the runtime of the single tests, and also make the 
Python test without environment to actually run without the SYSTEMDS_HOME 
installation.
    
    Closes #2300.
---
 .github/workflows/python.yml                       | 23 +++------
 .github/workflows/pythonFormatting.yml             | 56 ++++++++++++++++++++++
 .../python/systemds/context/systemds_context.py    |  2 +-
 3 files changed, 64 insertions(+), 17 deletions(-)

diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml
index 465df222ae..273ca6fd3d 100644
--- a/.github/workflows/python.yml
+++ b/.github/workflows/python.yml
@@ -53,8 +53,9 @@ jobs:
         os: [ubuntu-24.04]
         java: ['17']
         javadist: ['adopt']
+        test_mode: [env, noenv, federated]
 
-    name: ${{ matrix.os }} Java ${{ matrix.java }} ${{ matrix.javadist }} 
Python ${{ matrix.python-version }}
+    name: ${{ matrix.os }} Java ${{ matrix.java }} ${{ matrix.javadist }} 
Python ${{ matrix.python-version }}/ ${{ matrix.test_mode}}
     steps:
     - name: Checkout Repository
       uses: actions/checkout@v4
@@ -116,7 +117,6 @@ jobs:
           librosa \
           h5py \
           gensim \
-          black \
           opt-einsum \
           nltk
 
@@ -125,7 +125,8 @@ jobs:
         cd src/main/python
         python create_python_dist.py
 
-    - name: Run all python tests
+    - name: Run tests with env
+      if: ${{ matrix.test_mode == 'env' }}
       run: |
         export SYSTEMDS_ROOT=$(pwd)
         export PATH=$SYSTEMDS_ROOT/bin:$PATH
@@ -133,30 +134,20 @@ jobs:
         export LOG4JPROP=$SYSTEMDS_ROOT/src/test/resources/log4j.properties
         cd src/main/python
         unittest-parallel -t . -s tests -v
-        # python -m unittest discover -s tests -p 'test_*.py'
-        echo "Exit Status: " $?
 
-    - name: Run all python tests no environment
+    - name: Run tests no env
+      if: ${{ matrix.test_mode == 'noenv' }}
       run: |
         export LOG4JPROP=$(pwd)/src/test/resources/log4j.properties
         cd src/main/python
         unittest-parallel -t . -s tests -v
-        # python -m unittest discover -s tests -p 'test_*.py'
-        echo "Exit Status: " $?
 
     - name: Run Federated Python Tests
+      if: ${{ matrix.test_mode == 'federated' }}
       run: |
         export SYSTEMDS_ROOT=$(pwd)
         export PATH=$SYSTEMDS_ROOT/bin:$PATH
         cd src/main/python
         ./tests/federated/runFedTest.sh
 
-    - name: Check formatting according to Black (src/main/python/systemds)
-      run: |
-        black --check --exclude operator/algorithm src/main/python/systemds
-
-    - name: Check formatting according to Black (src/main/python/tests)
-      run: |
-        black --check src/main/python/tests
-
 
diff --git a/.github/workflows/pythonFormatting.yml 
b/.github/workflows/pythonFormatting.yml
new file mode 100644
index 0000000000..7ecc325c73
--- /dev/null
+++ b/.github/workflows/pythonFormatting.yml
@@ -0,0 +1,56 @@
+#-------------------------------------------------------------
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+#-------------------------------------------------------------
+
+name: Python Black Format Check
+
+on:
+  push:
+    paths:
+      - 'src/main/python/**'
+    branches:
+      - main
+  pull_request:
+    paths:
+      - 'src/main/python/**'
+    branches:
+      - main
+
+jobs:
+  black:
+    runs-on: ubuntu-latest
+    steps:
+      - name: Checkout Repository
+        uses: actions/checkout@v4
+
+      - name: Setup Python
+        uses: actions/setup-python@v5
+        with:
+          python-version: '3.x'
+
+      - name: Install Black
+        run: |
+          pip install --upgrade pip
+          pip install black
+
+      - name: Run Black Check
+        run: |
+          black --check --exclude operator/algorithm \
+          src/main/python/systemds src/main/python/tests
\ No newline at end of file
diff --git a/src/main/python/systemds/context/systemds_context.py 
b/src/main/python/systemds/context/systemds_context.py
index 440c51c3c8..00aa693cea 100644
--- a/src/main/python/systemds/context/systemds_context.py
+++ b/src/main/python/systemds/context/systemds_context.py
@@ -965,7 +965,7 @@ class DynamicStderrHandler(logging.StreamHandler):
     def __init__(self, level=logging.NOTSET, formatter=None):
         # Avoid setting stream directly to sys.stderr, we will do that 
dynamically
         # For more info see test case: 
tests/basics/test_context_creation/test_random_port_debug3
-        # where we redirect the err channel in between different contexts
+        # where we redirect the err channel between different contexts
         super().__init__(stream=None)
         self.setLevel(level)
         if formatter:

Reply via email to