diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile new file mode 100644 index 0000000..999e4d8 --- /dev/null +++ b/.devcontainer/Dockerfile @@ -0,0 +1,8 @@ +FROM python:3.13-alpine + +# Update pip and install dependencies and tools +RUN pip install --upgrade pip \ + && apk update && \ + apk add --no-cache \ + make \ + git \ No newline at end of file diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 0000000..0643b4b --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,21 @@ +{ + "name": "Switcher Python SDK Dev Container", + "dockerComposeFile": [ + "docker-compose.yml" + ], + "service": "switcherpy-sdk", + "workspaceFolder": "/workspace", + "customizations":{ + "vscode": { + "extensions": [ + "ms-python.debugpy", + "ms-python.python", + "ms-python.vscode-pylance" + ], + "settings": { + "terminal.integrated.shell.linux": "/bin/bash" + } + } + }, + "postCreateCommand": "python3 -m venv /workspace/.venv" +} \ No newline at end of file diff --git a/.devcontainer/docker-compose.yml b/.devcontainer/docker-compose.yml new file mode 100644 index 0000000..31f526e --- /dev/null +++ b/.devcontainer/docker-compose.yml @@ -0,0 +1,11 @@ +version: '3.9' + +services: + + switcherpy-sdk: + build: + context: . + dockerfile: Dockerfile + volumes: + - ..:/workspace:cached + command: sleep infinity \ No newline at end of file diff --git a/.github/workflows/master.yml b/.github/workflows/master.yml index a3ed0d6..1be0c4e 100644 --- a/.github/workflows/master.yml +++ b/.github/workflows/master.yml @@ -7,11 +7,10 @@ on: branches: [ master ] jobs: - build-test: - name: Build & Test - runs-on: ubuntu-latest + build-scan: + name: SonarCloud Scan if: "! contains(toJSON(github.event.commits.*.message), '[skip ci]')" - concurrency: ci-${{ github.ref }} + runs-on: ubuntu-latest steps: - name: Git checkout @@ -19,10 +18,10 @@ jobs: with: fetch-depth: 0 - - name: Set up Python 3.11 + - name: Set up Python 3.13 uses: actions/setup-python@v5 with: - python-version: "3.11" + python-version: "3.13" - name: Install dependencies run: pip install -r tests/requirements.txt @@ -31,7 +30,32 @@ jobs: run: pytest -v --cov=./switcher_client --cov-report xml - name: SonarCloud Scan - uses: sonarsource/sonarqube-scan-action@v5.0.0 + uses: sonarsource/sonarqube-scan-action@v5.1.0 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} \ No newline at end of file + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + + build-test: + name: Build & Test - Python ${{ matrix.python-version }} on ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"] + os: [ ubuntu-latest, windows-latest ] + runs-on: ${{ matrix.os }} + if: "! contains(toJSON(github.event.commits.*.message), '[skip ci]')" + + steps: + - name: Git checkout + uses: actions/checkout@v4 + + - 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 tests/requirements.txt + + - name: Test + run: pytest -v \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index fb4a885..8384762 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -9,13 +9,11 @@ authors = [{name='Roger Floriano (petruki)', email='switcher.project@gmail.com'} description = "Switcher Client SDK for Python" license = { text = "MIT" } classifiers = [ - "Programming Language :: Python :: 3.6", - "Programming Language :: Python :: 3.7", - "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", "Programming Language :: Python :: Implementation :: CPython", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", diff --git a/sonar-project.properties b/sonar-project.properties index fc2cd4b..32710bd 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -7,5 +7,5 @@ sonar.links.homepage=https://github.com/switcherapi/switcher-client-py sonar.sources=switcher_client sonar.tests=tests sonar.python.coverage.reportPaths=coverage.xml -sonar.python.version=3.11 +sonar.python.version=3.13 sonar.exclusions=**/tests/**, **/switcher_client/version.py \ No newline at end of file diff --git a/tests/requirements.txt b/tests/requirements.txt index 31e6500..b38fc26 100644 --- a/tests/requirements.txt +++ b/tests/requirements.txt @@ -1,3 +1,3 @@ -pytest==8.3.3 -pytest-cov==5.0.0 -responses==0.25.6 \ No newline at end of file +pytest==8.3.5 +pytest-cov==6.1.1 +responses==0.25.7 \ No newline at end of file