From 626ebb1e2de80deb5ea15e1047ea15543b1c6da2 Mon Sep 17 00:00:00 2001 From: Kenneth Bingham Date: Tue, 4 Mar 2025 21:25:13 -0500 Subject: [PATCH] lint the py sdk --- .flake8 | 4 ++-- .github/workflows/ci-build.yml | 40 +++++++++++++++------------------- 2 files changed, 20 insertions(+), 24 deletions(-) diff --git a/.flake8 b/.flake8 index 2ddf68b7..be4b41e7 100644 --- a/.flake8 +++ b/.flake8 @@ -1,5 +1,5 @@ [flake8] max-line-length = 120 exclude = - ./build/** - + sdk/python/src/zrok_api/* + sdk/python/src/test/* diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml index 7dfec9f8..62a75d2d 100644 --- a/.github/workflows/ci-build.yml +++ b/.github/workflows/ci-build.yml @@ -61,19 +61,6 @@ jobs: shell: bash run: go test -v ./... - - name: setup python - uses: actions/setup-python@v3 - with: - python-version: '3.13' - - - name: python deps - shell: bash - run: python -m pip install -U pip flake8 - - - name: python lint - shell: bash - run: flake8 sdk/python/src - - name: solve GOBIN id: solve_go_bin shell: bash @@ -89,14 +76,14 @@ jobs: if-no-files-found: error pytest: - + name: Test the Python SDK runs-on: ubuntu-24.04 - defaults: - run: - working-directory: sdk/python/src strategy: matrix: python-version: ["3.10", "3.11", "3.12", "3.13"] + defaults: + run: + working-directory: sdk/python steps: - uses: actions/checkout@v4 @@ -114,10 +101,10 @@ jobs: set -o xtrace python -m pip install --upgrade pip - pip install -r requirements.txt - pip install -r test-requirements.txt - pip install -r build-requirements.txt - pip install -e "$PWD" + pip install -r src/requirements.txt + pip install -r src/test-requirements.txt + pip install -r src/build-requirements.txt + pip install -e src/ - name: Test with pytest shell: bash @@ -126,7 +113,16 @@ jobs: set -o pipefail set -o xtrace - pytest --cov=zrok_api --verbose + pytest --cov=zrok_api --verbose src/ + + - name: Lint the Python SDK + shell: bash + run: | + + set -o pipefail + set -o xtrace + + flake8 . # build a release candidate container image for branches named "main" or like "v*" rc-container-build: