From b6c28878f23b00121f688f6506398574a2da9b8e Mon Sep 17 00:00:00 2001 From: Jair Henrique Date: Wed, 22 Oct 2025 13:50:42 -0300 Subject: [PATCH 1/2] Include Python 3.13 and 3.14 to test matrix --- .github/workflows/python-ci.yml | 220 +++++++++++++++++--------------- setup.py | 2 + 2 files changed, 118 insertions(+), 104 deletions(-) diff --git a/.github/workflows/python-ci.yml b/.github/workflows/python-ci.yml index 856acad..207899c 100644 --- a/.github/workflows/python-ci.yml +++ b/.github/workflows/python-ci.yml @@ -1,104 +1,116 @@ -name: Python CI - -on: - schedule: - - cron: '0 0 * * *' - push: - branches: [ master ] - paths-ignore: - - '**.md' - pull_request: - branches: [ master ] - - workflow_dispatch: - -jobs: - test: - runs-on: ${{ matrix.os }} - strategy: - matrix: - python-version: ["3.5", "3.6", "3.7", "3.8", "3.9", "3.10", "3.11", "3.12"] - os: [ windows-latest, macos-latest, ubuntu-latest ] - exclude: # Python < v3.8 does not support Apple Silicon ARM64. - - python-version: "3.5" - os: macos-latest - - python-version: "3.6" - os: macos-latest - - python-version: "3.7" - os: macos-latest - include: # So run those legacy versions on Intel CPUs. - - python-version: "3.5" - os: macos-13 - - python-version: "3.6" - os: macos-13 - - python-version: "3.7" - os: macos-13 - - steps: - - uses: actions/checkout@v4 - - - name: Run tests in Docker for legacy Python - if: matrix.os == 'ubuntu-latest' && contains(fromJSON('["3.5","3.6","3.7"]'), matrix.python-version) - run: | - docker run --rm -v ${{ github.workspace }}:/app -w /app python:${{ matrix.python-version }} bash -c " - pip install --upgrade pip && - pip install pytest pytest-cov parameterized mock flake8 && - pip install -r requirements.txt && - flake8 configcatclient --count --show-source --statistics && - pytest configcatclienttests - " - - - name: Set up Python ${{ matrix.python-version }} - if: ${{ !(matrix.os == 'ubuntu-latest' && contains(fromJSON('["3.5","3.6","3.7"]'), matrix.python-version)) }} - uses: actions/setup-python@v5 - with: - python-version: ${{ matrix.python-version }} - env: - # Needed on Ubuntu for Python 3.5 build. - PIP_TRUSTED_HOST: "pypi.python.org pypi.org files.pythonhosted.org" - - - name: Install dependencies - if: ${{ !(matrix.os == 'ubuntu-latest' && contains(fromJSON('["3.5","3.6","3.7"]'), matrix.python-version)) }} - run: | - python -m pip install --upgrade pip - pip install pytest pytest-cov parameterized mock flake8 - pip install -r requirements.txt - - - name: Lint with flake8 - if: ${{ !(matrix.os == 'ubuntu-latest' && contains(fromJSON('["3.5","3.6","3.7"]'), matrix.python-version)) }} - run: | - # Statical analysis - flake8 configcatclient --count --show-source --statistics - - - name: Test - if: ${{ !(matrix.os == 'ubuntu-latest' && contains(fromJSON('["3.5","3.6","3.7"]'), matrix.python-version)) }} - run: pytest configcatclienttests - - - coverage: - needs: [ test ] - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - - name: Set up Python - uses: actions/setup-python@v5 - with: - python-version: "3.11" - - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install pytest pytest-cov parameterized mock flake8 - pip install -r requirements.txt - - - name: Lint with flake8 - run: | - # Statical analysis - flake8 configcatclient --count --show-source --statistics - - - name: Run coverage - run: pytest --cov=configcatclient configcatclienttests - - - name: Upload coverage report - uses: codecov/codecov-action@v3 +name: Python CI + +on: + schedule: + - cron: "0 0 * * *" + push: + branches: [master] + paths-ignore: + - "**.md" + pull_request: + branches: [master] + + workflow_dispatch: + +jobs: + test: + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + python-version: + [ + "3.5", + "3.6", + "3.7", + "3.8", + "3.9", + "3.10", + "3.11", + "3.12", + "3.13", + "3.14", + ] + os: [windows-latest, macos-latest, ubuntu-latest] + exclude: # Python < v3.8 does not support Apple Silicon ARM64. + - python-version: "3.5" + os: macos-latest + - python-version: "3.6" + os: macos-latest + - python-version: "3.7" + os: macos-latest + include: # So run those legacy versions on Intel CPUs. + - python-version: "3.5" + os: macos-13 + - python-version: "3.6" + os: macos-13 + - python-version: "3.7" + os: macos-13 + + steps: + - uses: actions/checkout@v4 + + - name: Run tests in Docker for legacy Python + if: matrix.os == 'ubuntu-latest' && contains(fromJSON('["3.5","3.6","3.7"]'), matrix.python-version) + run: | + docker run --rm -v ${{ github.workspace }}:/app -w /app python:${{ matrix.python-version }} bash -c " + pip install --upgrade pip && + pip install pytest pytest-cov parameterized mock flake8 && + pip install -r requirements.txt && + flake8 configcatclient --count --show-source --statistics && + pytest configcatclienttests + " + + - name: Set up Python ${{ matrix.python-version }} + if: ${{ !(matrix.os == 'ubuntu-latest' && contains(fromJSON('["3.5","3.6","3.7"]'), matrix.python-version)) }} + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + env: + # Needed on Ubuntu for Python 3.5 build. + PIP_TRUSTED_HOST: "pypi.python.org pypi.org files.pythonhosted.org" + + - name: Install dependencies + if: ${{ !(matrix.os == 'ubuntu-latest' && contains(fromJSON('["3.5","3.6","3.7"]'), matrix.python-version)) }} + run: | + python -m pip install --upgrade pip + pip install pytest pytest-cov parameterized mock flake8 + pip install -r requirements.txt + + - name: Lint with flake8 + if: ${{ !(matrix.os == 'ubuntu-latest' && contains(fromJSON('["3.5","3.6","3.7"]'), matrix.python-version)) }} + run: | + # Statical analysis + flake8 configcatclient --count --show-source --statistics + + - name: Test + if: ${{ !(matrix.os == 'ubuntu-latest' && contains(fromJSON('["3.5","3.6","3.7"]'), matrix.python-version)) }} + run: pytest configcatclienttests + + coverage: + needs: [test] + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: "3.11" + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install pytest pytest-cov parameterized mock flake8 + pip install -r requirements.txt + + - name: Lint with flake8 + run: | + # Statical analysis + flake8 configcatclient --count --show-source --statistics + + - name: Run coverage + run: pytest --cov=configcatclient configcatclienttests + + - name: Upload coverage report + uses: codecov/codecov-action@v3 diff --git a/setup.py b/setup.py index fa74798..50566fe 100644 --- a/setup.py +++ b/setup.py @@ -38,6 +38,8 @@ def parse_requirements(filename): 'Programming Language :: Python :: 3.10', 'Programming Language :: Python :: 3.11', 'Programming Language :: Python :: 3.12', + 'Programming Language :: Python :: 3.13', + 'Programming Language :: Python :: 3.14', 'Topic :: Software Development', 'Topic :: Software Development :: Libraries', ], From bc1c66c4fed623d736b265e4852a0cf9baf5c0b0 Mon Sep 17 00:00:00 2001 From: Jair Henrique Date: Wed, 22 Oct 2025 17:12:30 -0300 Subject: [PATCH 2/2] Update gh actions --- .github/workflows/publish.yml | 10 +++++----- .github/workflows/python-ci.yml | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 9c1ce7d..070aaa9 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -2,8 +2,8 @@ name: Python SDK Publish on: push: - branches: [ master ] - tags: [ 'v[0-9]+.[0-9]+.[0-9]+' ] + branches: [master] + tags: ["v[0-9]+.[0-9]+.[0-9]+"] workflow_dispatch: @@ -13,11 +13,11 @@ jobs: if: startsWith(github.ref, 'refs/tags') steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 - name: Set up Python - uses: actions/setup-python@v5 + uses: actions/setup-python@v6 with: - python-version: '3.x' + python-version: "3.x" - name: Install dependencies run: | diff --git a/.github/workflows/python-ci.yml b/.github/workflows/python-ci.yml index 207899c..37d9c09 100644 --- a/.github/workflows/python-ci.yml +++ b/.github/workflows/python-ci.yml @@ -48,7 +48,7 @@ jobs: os: macos-13 steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 - name: Run tests in Docker for legacy Python if: matrix.os == 'ubuntu-latest' && contains(fromJSON('["3.5","3.6","3.7"]'), matrix.python-version) @@ -63,7 +63,7 @@ jobs: - name: Set up Python ${{ matrix.python-version }} if: ${{ !(matrix.os == 'ubuntu-latest' && contains(fromJSON('["3.5","3.6","3.7"]'), matrix.python-version)) }} - uses: actions/setup-python@v5 + uses: actions/setup-python@v6 with: python-version: ${{ matrix.python-version }} env: @@ -91,10 +91,10 @@ jobs: needs: [test] runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 - name: Set up Python - uses: actions/setup-python@v5 + uses: actions/setup-python@v6 with: python-version: "3.11" @@ -113,4 +113,4 @@ jobs: run: pytest --cov=configcatclient configcatclienttests - name: Upload coverage report - uses: codecov/codecov-action@v3 + uses: codecov/codecov-action@5a1091511ad55cbe89839c7260b706298ca349f7 # v5.5.1