From 42504a27156d046f9e471d89e36510a1c94122ba Mon Sep 17 00:00:00 2001 From: Davide Vacca Date: Wed, 23 Oct 2024 12:54:41 +0200 Subject: [PATCH] Add python version 3.12 in place of 3.7 in CI + patch regexp to avoid github warning --- .github/workflows/python.yml | 4 ++-- onfido/api_client.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml index c31ffa1..a092710 100644 --- a/.github/workflows/python.yml +++ b/.github/workflows/python.yml @@ -24,7 +24,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"] + python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] env: POETRY_CACHE_DIR: ~/.cache/pypoetry-${{ matrix.python-version }} @@ -55,7 +55,7 @@ jobs: # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide poetry run flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics --exclude onfido - name: Test with pytest - if: ${{ matrix.python-version == '3.11' && + if: ${{ matrix.python-version == '3.12' && github.repository_owner == 'onfido' }} run: | poetry run pytest --show-capture=no diff --git a/onfido/api_client.py b/onfido/api_client.py index 80d838f..194956c 100644 --- a/onfido/api_client.py +++ b/onfido/api_client.py @@ -404,7 +404,7 @@ def deserialize(self, response_text: str, response_type: str, content_type: Opti data = json.loads(response_text) except ValueError: data = response_text - elif re.match(r'^application/(json|[\w!#$&.+-^_]+\+json)\s*(;|$)', content_type, re.IGNORECASE): + elif re.match(r'^application/(json|[\w!#$&.+-^]+\+json)\s*(;|$)', content_type, re.IGNORECASE): if response_text == "": data = "" else: