Skip to content

Commit

Permalink
Remove py3.7 from matrix testing, set default on optional model field…
Browse files Browse the repository at this point in the history
… and use pydantic-settings (pydantic v2)
  • Loading branch information
dorinclisu committed Sep 17, 2023
1 parent 523fcda commit 4c8f34a
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 7 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,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']
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
Expand All @@ -24,7 +24,7 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install flake8 mypy pytest fastapi>=0.60.0 python-jose>=3.2.0 httpx requests types-requests
python -m pip install flake8 mypy pytest fastapi>=0.60.0 python-jose>=3.2.0 pydantic-settings httpx requests types-requests
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Lint with flake8
run: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,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']
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
Expand All @@ -19,7 +19,7 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install flake8 mypy pytest fastapi>=0.60.0 python-jose>=3.2.0 httpx requests types-requests
python -m pip install flake8 mypy pytest fastapi>=0.60.0 python-jose>=3.2.0 pydantic-settings httpx requests types-requests
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Lint with flake8
run: |
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

setuptools.setup(
name='fastapi-auth0',
version='0.4.0',
version='0.5.0',
description='Easy auth0.com integration for FastAPI',
long_description=readme,
long_description_content_type='text/markdown',
Expand Down
2 changes: 1 addition & 1 deletion src/fastapi_auth0/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class HTTPAuth0Error(BaseModel):

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


Expand Down
3 changes: 2 additions & 1 deletion tests/test_auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
import requests
from fastapi import FastAPI, Depends, Security
from fastapi.testclient import TestClient
from pydantic import Field, BaseSettings
from pydantic import Field
from pydantic_settings import BaseSettings

#from fastapi_auth0 import Auth0, Auth0User, security_responses
from src.fastapi_auth0 import Auth0, Auth0User, security_responses
Expand Down

0 comments on commit 4c8f34a

Please sign in to comment.