Skip to content

Commit e3f934d

Browse files
fix: import error while generating migrations (#630)
Co-authored-by: Jianguo Ren <renjianguo666@gmail.com>
1 parent 0a82f51 commit e3f934d

2 files changed

Lines changed: 4 additions & 6 deletions

File tree

advanced_alchemy/types/password_hash/passlib.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,10 @@
22

33
from typing import TYPE_CHECKING, Any, Union
44

5-
from passlib.context import CryptContext # pyright: ignore
6-
75
from advanced_alchemy.types.password_hash.base import HashingBackend
86

97
if TYPE_CHECKING:
8+
from passlib.context import CryptContext
109
from sqlalchemy import BinaryExpression, ColumnElement
1110

1211
__all__ = ("PasslibHasher",)
@@ -19,7 +18,7 @@ class PasslibHasher(HashingBackend):
1918
Install with `pip install passlib` or `uv pip install passlib`.
2019
"""
2120

22-
def __init__(self, context: CryptContext) -> None:
21+
def __init__(self, context: "CryptContext") -> None:
2322
"""Initialize PasslibBackend.
2423
2524
Args:

advanced_alchemy/types/password_hash/pwdlib.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,16 @@
55
from advanced_alchemy.types.password_hash.base import HashingBackend
66

77
if TYPE_CHECKING:
8+
from pwdlib.hashers.base import HasherProtocol
89
from sqlalchemy import BinaryExpression, ColumnElement
910

10-
from pwdlib.hashers.base import HasherProtocol
11-
1211
__all__ = ("PwdlibHasher",)
1312

1413

1514
class PwdlibHasher(HashingBackend):
1615
"""Hashing backend using Pwdlib."""
1716

18-
def __init__(self, hasher: HasherProtocol) -> None:
17+
def __init__(self, hasher: "HasherProtocol") -> None:
1918
"""Initialize PwdlibBackend.
2019
2120
Args:

0 commit comments

Comments
 (0)