Skip to content

Commit

Permalink
fix: Python 3.9 support (#209)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
ndxmrb authored Aug 20, 2024
1 parent 705b1e9 commit a0e3be0
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/testing.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: [ "3.11", "3.12" ]
python-version: [ "3.9", "3.10", "3.11", "3.12" ]
fastapi-version: [ "0.103.2", "0.111.1"]
steps:
- name: Check out repository
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
*.pyc
.idea/*
.vscode
env/
demo_project/.env
.DS_Store
Expand Down
2 changes: 2 additions & 0 deletions fastapi_azure_auth/exceptions.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

from fastapi import HTTPException, WebSocketException, status
from starlette.requests import HTTPConnection

Expand Down
2 changes: 1 addition & 1 deletion tests/test_user.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def test_guest_user(claims: Dict[str, str], expected: bool):


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


Expand Down

0 comments on commit a0e3be0

Please sign in to comment.