-
-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Drop Python 3.8 support and upgrade tooling
- Loading branch information
1 parent
f0078b0
commit 00c21ee
Showing
9 changed files
with
64 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -104,9 +104,6 @@ ENV/ | |
# mypy | ||
.mypy_cache/ | ||
|
||
# .vscode | ||
.vscode/ | ||
|
||
# OS files | ||
.DS_Store | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
"python.analysis.typeCheckingMode": "basic", | ||
"python.analysis.autoImportCompletions": true, | ||
"python.terminal.activateEnvironment": true, | ||
"python.terminal.activateEnvInCurrentTerminal": true, | ||
"python.testing.unittestEnabled": false, | ||
"python.testing.pytestEnabled": true, | ||
"editor.rulers": [88], | ||
"python.defaultInterpreterPath": "${workspaceFolder}/.hatch/fastapi-users-db-sqlalchemy/bin/python", | ||
"python.testing.pytestPath": "${workspaceFolder}/.hatch/fastapi-users-db-sqlalchemy/bin/pytest", | ||
"python.testing.cwd": "${workspaceFolder}", | ||
"python.testing.pytestArgs": ["--no-cov"], | ||
"[python]": { | ||
"editor.formatOnSave": true, | ||
"editor.codeActionsOnSave": { | ||
"source.fixAll": "explicit", | ||
"source.organizeImports": "explicit" | ||
}, | ||
"editor.defaultFormatter": "charliermarsh.ruff" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,8 @@ | ||
from typing import Any, AsyncGenerator, Dict, List | ||
from collections.abc import AsyncGenerator | ||
from typing import Any | ||
|
||
import pytest | ||
import pytest_asyncio | ||
from sqlalchemy import String, exc | ||
from sqlalchemy.ext.asyncio import ( | ||
AsyncEngine, | ||
|
@@ -45,12 +47,12 @@ class OAuthAccount(SQLAlchemyBaseOAuthAccountTableUUID, OAuthBase): | |
|
||
class UserOAuth(SQLAlchemyBaseUserTableUUID, OAuthBase): | ||
first_name: Mapped[str] = mapped_column(String(255), nullable=True) | ||
oauth_accounts: Mapped[List[OAuthAccount]] = relationship( | ||
oauth_accounts: Mapped[list[OAuthAccount]] = relationship( | ||
"OAuthAccount", lazy="joined" | ||
) | ||
|
||
|
||
@pytest.fixture | ||
@pytest_asyncio.fixture | ||
async def sqlalchemy_user_db() -> AsyncGenerator[SQLAlchemyUserDatabase, None]: | ||
engine = create_async_engine(DATABASE_URL) | ||
sessionmaker = create_async_session_maker(engine) | ||
|
@@ -65,7 +67,7 @@ async def sqlalchemy_user_db() -> AsyncGenerator[SQLAlchemyUserDatabase, None]: | |
await connection.run_sync(Base.metadata.drop_all) | ||
|
||
|
||
@pytest.fixture | ||
@pytest_asyncio.fixture | ||
async def sqlalchemy_user_db_oauth() -> AsyncGenerator[SQLAlchemyUserDatabase, None]: | ||
engine = create_async_engine(DATABASE_URL) | ||
sessionmaker = create_async_session_maker(engine) | ||
|
@@ -168,8 +170,8 @@ async def test_queries_custom_fields( | |
@pytest.mark.asyncio | ||
async def test_queries_oauth( | ||
sqlalchemy_user_db_oauth: SQLAlchemyUserDatabase[UserOAuth, UUID_ID], | ||
oauth_account1: Dict[str, Any], | ||
oauth_account2: Dict[str, Any], | ||
oauth_account1: dict[str, Any], | ||
oauth_account2: dict[str, Any], | ||
): | ||
user_create = { | ||
"email": "[email protected]", | ||
|