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

mck pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/cassandra-ccm.git


The following commit(s) were added to refs/heads/trunk by this push:
     new 1b348f8  Add github actions for different python versions (and C* 4.0, 
4.1, and trunk)
1b348f8 is described below

commit 1b348f89c466a483d54632f876e6063acfefb8bd
Author: mck <[email protected]>
AuthorDate: Sun Dec 14 13:55:46 2025 +0100

    Add github actions for different python versions (and C* 4.0, 4.1, and 
trunk)
    
    Also always test the latest patch versions
    
     patch by Mick Semb Wever; reviewed by Dmitry Kropachev
---
 .github/workflows/main-python-2-7.yml | 92 +++++++++++++++++++++++++++++++++++
 .github/workflows/main.yml            | 54 ++++++++++++--------
 requirements.txt                      |  3 +-
 setup.cfg                             |  8 ++-
 4 files changed, 132 insertions(+), 25 deletions(-)

diff --git a/.github/workflows/main-python-2-7.yml 
b/.github/workflows/main-python-2-7.yml
new file mode 100644
index 0000000..6acd9a9
--- /dev/null
+++ b/.github/workflows/main-python-2-7.yml
@@ -0,0 +1,92 @@
+# 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: CI - Python 2.7
+
+on:
+  push:
+  pull_request:
+  workflow_dispatch:
+
+jobs:
+  lint_test_smoke:
+    runs-on: ubuntu-24.04
+    container:
+      image: python:2.7-slim
+
+    steps:
+      - uses: actions/checkout@v4
+
+      - name: Install system dependencies
+        run: |
+          # Update sources to use Debian archive since Buster is EOL
+          sed -i 's/deb.debian.org/archive.debian.org/g' /etc/apt/sources.list
+          sed -i '/security.debian.org/d' /etc/apt/sources.list
+          sed -i '/stretch-updates/d' /etc/apt/sources.list
+          sed -i '/buster-updates/d' /etc/apt/sources.list
+          mkdir -p /usr/share/man/man1
+          apt-get update
+          apt-get install -y curl netcat-openbsd sudo git gcc python-dev 
openjdk-11-jdk-headless ant
+
+      - name: Set up Python environment
+        run: |
+          python -m pip install --upgrade 'pip<21.0' 'setuptools<45' 
'wheel<0.35'
+          mkdir -p /github/home/.cache/pip
+          pip install -r requirements.txt
+          pip install 'pylint==1.9.5'
+
+      - name: Run linter
+        run: |
+          pylint --output-format msvs --reports y ccmlib || true
+          pylint --output-format msvs --reports y tests || true
+
+      - name: Smoke tests
+        shell: bash
+        run: |
+          export JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64
+          # hack to fix setup.cfg not being parsed by pbr (FIXME why isn't pbr 
working...)
+          export PBR_VERSION=$(grep version setup.cfg | awk -F= '{print $2}' | 
xargs)
+          ./setup.py install
+          set -x
+          LATEST_4_0=$(curl -s https://downloads.apache.org/cassandra/ | grep 
-oE '4\.0\.[0-9]+' | sort -V | tail -1)
+          LATEST_4_1=$(curl -s https://downloads.apache.org/cassandra/ | grep 
-oE '4\.1\.[0-9]+' | sort -V | tail -1)
+          ccm_test() {
+            for i in {1..9}; do
+              echo "Checking nc -z 127.0.0.1 7000"
+              while nc -z 127.0.0.1 7000 ; do echo . ; ./ccm stop || true ; 
sleep 1 ; done
+              ./ccm start -v --root && ./ccm remove && return 0 || echo 
retrying
+              sleep 20
+            done
+            echo "ccm start failed after 9 attempts"
+            exit 1
+          }
+          export -f ccm_test
+          ./ccm create -h
+          ./ccm create test -v ${LATEST_4_0} -n1 --vnodes --quiet
+          ccm_test
+          ./ccm create test -v ${LATEST_4_1} -n1 --vnodes --quiet
+          ccm_test
+          ./ccm create test --version='git:cassandra-4.0' -n1 --vnodes --quiet
+          ccm_test
+          ./ccm create test --version='git:cassandra-4.1' -n1 --vnodes --quiet
+          ccm_test
+
+      - name: Publish Test Report
+        uses: mikepenz/action-junit-report@v5
+        if: always()
+        with:
+          report_paths: 'junit.xml'
+          annotate_only: true
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index 81a5249..bea1f0f 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -14,7 +14,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-name: CI
+name: CI - Python 3.x
 
 on:
   push:
@@ -22,26 +22,30 @@ on:
   workflow_dispatch:
 
 jobs:
-  build:
+  lint_test_smoke:
     runs-on: ubuntu-24.04
+    strategy:
+      matrix:
+        python-version: ['3.8', '3.11']  # TODO add '3.12' '3.13' '3.14'
+      fail-fast: false
 
     steps:
       - uses: actions/checkout@v4
 
-      - name: Create virtual environment
-        run: python -m venv venv
-
-      - name: Activate virtual environment
-        run: source venv/bin/activate
+      - name: Set up Python ${{ matrix.python-version }}
+        uses: actions/setup-python@v5
+        with:
+          python-version: ${{ matrix.python-version }}
 
-      - name: Install dependencies
-        run: pip install -r requirements.txt && pip install -r 
tests/requirements.txt
+      - name: Set up Python environment
+        run: |
+          pip install --upgrade pip
+          pip install -r requirements.txt && pip install -r 
tests/requirements.txt
 
       - name: Run linter
-        run: pylint --output-format msvs --reports y ccmlib || true
-
-      - name: Run linter for tests
-        run: pylint --output-format msvs --reports y tests || true
+        run: |
+          pylint --output-format msvs --reports y ccmlib || true
+          pylint --output-format msvs --reports y tests || true
 
       - name: Run tests
         run: |
@@ -51,12 +55,14 @@ jobs:
         run: |
           sudo ./setup.py install
           set -x
-
+          LATEST_4_0=$(curl -s https://downloads.apache.org/cassandra/ | grep 
-oE '4\.0\.[0-9]+' | sort -V | tail -1)
+          LATEST_4_1=$(curl -s https://downloads.apache.org/cassandra/ | grep 
-oE '4\.1\.[0-9]+' | sort -V | tail -1)
+          LATEST_5_0=$(curl -s https://downloads.apache.org/cassandra/ | grep 
-oE '5\.0\.[0-9]+' | sort -V | tail -1)
           ccm_test() {
-            for i in {1..9}; do 
+            for i in {1..9}; do
               echo "Checking nc -z 127.0.0.1 7000"
               while nc -z 127.0.0.1 7000 ; do echo . ; ./ccm stop || true ; 
sleep 1 ; done
-              ./ccm start && ./ccm remove && return 0 || echo retrying
+              ./ccm start -v && ./ccm remove && return 0 || echo retrying
               sleep 20
             done
             echo "ccm start failed after 9 attempts"
@@ -64,14 +70,24 @@ jobs:
           }
           export -f ccm_test
           ./ccm create -h
-          ./ccm create test -v 5.0.3 -n1 --vnodes --quiet
+          ./ccm create test -v ${LATEST_4_0} -n1 --vnodes --quiet
+          ccm_test
+          ./ccm create test -v ${LATEST_4_1} -n1 --vnodes --quiet
+          ccm_test
+          ./ccm create test -v ${LATEST_5_0} -n1 --vnodes --quiet
+          ccm_test
+          ./ccm create test --version='git:cassandra-4.0' -n1 --vnodes --quiet
+          ccm_test
+          ./ccm create test --version='git:cassandra-4.1' -n1 --vnodes --quiet
+          ccm_test
+          ./ccm create test --version='git:cassandra-5.0' -n1 --vnodes --quiet
           ccm_test
-          ./ccm create test --version='git:cassandra-5.0.3' -n1 --vnodes 
--quiet
+          ./ccm create test --version='git:trunk' -n1 --vnodes --quiet
           ccm_test
           ./ccm create test -v 6.8.54 -n1 --vnodes --dse --quiet
           ccm_test
 
-          # todo, when available
+          # todo, when hcd is available
           #./ccm create test -v 1.1.0 -n1 --vnodes --hcd --quiet
           #ccm_test
 
diff --git a/requirements.txt b/requirements.txt
index a22ad06..c8153c0 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -14,7 +14,8 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-pyYaml
+pyYaml<5.4; python_version < '3'
+pyYaml; python_version >= '3'
 six >=1.4.1
 psutil
 
diff --git a/setup.cfg b/setup.cfg
index 1d81cba..7b3621c 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -2,7 +2,7 @@
 name=ccm
 version=3.1.6
 description=Cassandra Cluster Manager
-url='https://github.com/riptano/ccm'
+url='https://github.com/apache/cassandra-ccm'
 description-file = README.md
 description-content-type = text/markdown; charset=UTF-8
 classifier=
@@ -11,10 +11,8 @@ classifier=
     'Programming Language :: Python :: 2',
     'Programming Language :: Python :: 2.7',
     'Programming Language :: Python :: 3',
-    'Programming Language :: Python :: 3.3',
-    'Programming Language :: Python :: 3.4',
-    'Programming Language :: Python :: 3.5',
-    'Programming Language :: Python :: 3.6'
+    'Programming Language :: Python :: 3.8',
+    'Programming Language :: Python :: 3.11'
 
 [pbr]
 skip_authors=1


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to