Skip to content

Commit a0e3be0

Browse files
authored
fix: Python 3.9 support (#209)
* chore: ignore .vscode folder * fix: support PEP 604 annotation syntax in python 3.9 * tests: do not use datetime.UTC alias to support python 3.9 * style: linting * Revert "style: linting" This reverts commit 84c7214. * style: linting * ci: add 3.9 and 3.10 to test matrix
1 parent 705b1e9 commit a0e3be0

File tree

4 files changed

+5
-2
lines changed

4 files changed

+5
-2
lines changed

.github/workflows/testing.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
strategy:
1818
fail-fast: false
1919
matrix:
20-
python-version: [ "3.11", "3.12" ]
20+
python-version: [ "3.9", "3.10", "3.11", "3.12" ]
2121
fastapi-version: [ "0.103.2", "0.111.1"]
2222
steps:
2323
- name: Check out repository

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
*.pyc
22
.idea/*
3+
.vscode
34
env/
45
demo_project/.env
56
.DS_Store

fastapi_azure_auth/exceptions.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
from __future__ import annotations
2+
13
from fastapi import HTTPException, WebSocketException, status
24
from starlette.requests import HTTPConnection
35

tests/test_user.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ def test_guest_user(claims: Dict[str, str], expected: bool):
8585

8686

8787
def get_utc_now_as_unix_timestamp() -> int:
88-
date = datetime.datetime.now(datetime.UTC)
88+
date = datetime.datetime.now(datetime.timezone.utc)
8989
return calendar.timegm(date.utctimetuple())
9090

9191

0 commit comments

Comments
 (0)