lint the py sdk

This commit is contained in:
Kenneth Bingham 2025-03-04 21:25:13 -05:00
parent 5ea81c4959
commit 626ebb1e2d
No known key found for this signature in database
GPG Key ID: 31709281860130B6
2 changed files with 20 additions and 24 deletions

View File

@ -1,5 +1,5 @@
[flake8] [flake8]
max-line-length = 120 max-line-length = 120
exclude = exclude =
./build/** sdk/python/src/zrok_api/*
sdk/python/src/test/*

View File

@ -61,19 +61,6 @@ jobs:
shell: bash shell: bash
run: go test -v ./... 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 - name: solve GOBIN
id: solve_go_bin id: solve_go_bin
shell: bash shell: bash
@ -89,14 +76,14 @@ jobs:
if-no-files-found: error if-no-files-found: error
pytest: pytest:
name: Test the Python SDK
runs-on: ubuntu-24.04 runs-on: ubuntu-24.04
defaults:
run:
working-directory: sdk/python/src
strategy: strategy:
matrix: matrix:
python-version: ["3.10", "3.11", "3.12", "3.13"] python-version: ["3.10", "3.11", "3.12", "3.13"]
defaults:
run:
working-directory: sdk/python
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
@ -114,10 +101,10 @@ jobs:
set -o xtrace set -o xtrace
python -m pip install --upgrade pip python -m pip install --upgrade pip
pip install -r requirements.txt pip install -r src/requirements.txt
pip install -r test-requirements.txt pip install -r src/test-requirements.txt
pip install -r build-requirements.txt pip install -r src/build-requirements.txt
pip install -e "$PWD" pip install -e src/
- name: Test with pytest - name: Test with pytest
shell: bash shell: bash
@ -126,7 +113,16 @@ jobs:
set -o pipefail set -o pipefail
set -o xtrace 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*" # build a release candidate container image for branches named "main" or like "v*"
rc-container-build: rc-container-build: