Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -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
21 changes: 21 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -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"
}
11 changes: 11 additions & 0 deletions .devcontainer/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
version: '3.9'

services:

switcherpy-sdk:
build:
context: .
dockerfile: Dockerfile
volumes:
- ..:/workspace:cached
command: sleep infinity
40 changes: 32 additions & 8 deletions .github/workflows/master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,21 @@ 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
uses: actions/checkout@v4
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
Expand All @@ -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 }}
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
4 changes: 1 addition & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion sonar-project.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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
6 changes: 3 additions & 3 deletions tests/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
pytest==8.3.3
pytest-cov==5.0.0
responses==0.25.6
pytest==8.3.5
pytest-cov==6.1.1
responses==0.25.7