Skip to content

Commit 4c8f34a

Browse files
committed
Remove py3.7 from matrix testing, set default on optional model field and use pydantic-settings (pydantic v2)
1 parent 523fcda commit 4c8f34a

File tree

5 files changed

+8
-7
lines changed

5 files changed

+8
-7
lines changed

.github/workflows/package.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
runs-on: ubuntu-latest
1515
strategy:
1616
matrix:
17-
python-version: [3.7, 3.8, 3.9, '3.10', '3.11']
17+
python-version: [3.8, 3.9, '3.10', '3.11']
1818
steps:
1919
- uses: actions/checkout@v2
2020
- name: Set up Python ${{ matrix.python-version }}
@@ -24,7 +24,7 @@ jobs:
2424
- name: Install dependencies
2525
run: |
2626
python -m pip install --upgrade pip
27-
python -m pip install flake8 mypy pytest fastapi>=0.60.0 python-jose>=3.2.0 httpx requests types-requests
27+
python -m pip install flake8 mypy pytest fastapi>=0.60.0 python-jose>=3.2.0 pydantic-settings httpx requests types-requests
2828
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
2929
- name: Lint with flake8
3030
run: |

.github/workflows/pull_request.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
runs-on: ubuntu-latest
1010
strategy:
1111
matrix:
12-
python-version: [3.7, 3.8, 3.9, '3.10', '3.11']
12+
python-version: [3.8, 3.9, '3.10', '3.11']
1313
steps:
1414
- uses: actions/checkout@v2
1515
- name: Set up Python ${{ matrix.python-version }}
@@ -19,7 +19,7 @@ jobs:
1919
- name: Install dependencies
2020
run: |
2121
python -m pip install --upgrade pip
22-
python -m pip install flake8 mypy pytest fastapi>=0.60.0 python-jose>=3.2.0 httpx requests types-requests
22+
python -m pip install flake8 mypy pytest fastapi>=0.60.0 python-jose>=3.2.0 pydantic-settings httpx requests types-requests
2323
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
2424
- name: Lint with flake8
2525
run: |

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
setuptools.setup(
88
name='fastapi-auth0',
9-
version='0.4.0',
9+
version='0.5.0',
1010
description='Easy auth0.com integration for FastAPI',
1111
long_description=readme,
1212
long_description_content_type='text/markdown',

src/fastapi_auth0/auth.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ class HTTPAuth0Error(BaseModel):
3939

4040
class Auth0User(BaseModel):
4141
id: str = Field(..., alias='sub')
42-
permissions: Optional[List[str]]
42+
permissions: Optional[List[str]] = None
4343
email: Optional[str] = Field(None, alias=f'{auth0_rule_namespace}/email') # type: ignore [literal-required]
4444

4545

tests/test_auth.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
import requests
88
from fastapi import FastAPI, Depends, Security
99
from fastapi.testclient import TestClient
10-
from pydantic import Field, BaseSettings
10+
from pydantic import Field
11+
from pydantic_settings import BaseSettings
1112

1213
#from fastapi_auth0 import Auth0, Auth0User, security_responses
1314
from src.fastapi_auth0 import Auth0, Auth0User, security_responses

0 commit comments

Comments
 (0)