Closed edgarrmondragon closed 1 month ago
I think TypingOnly should be changed as follows:
diff --git a/lib/sqlalchemy/util/langhelpers.py b/lib/sqlalchemy/util/langhelpers.py
index fe3bd1684..87b3e486c 100644
--- a/lib/sqlalchemy/util/langhelpers.py
+++ b/lib/sqlalchemy/util/langhelpers.py
@@ -1967,13 +1967,7 @@ class TypingOnly:
def __init_subclass__(cls) -> None:
if TypingOnly in cls.__bases__:
remaining = set(cls.__dict__).difference(
- {
- "__module__",
- "__doc__",
- "__slots__",
- "__orig_bases__",
- "__annotations__",
- }
+ {name for name in cls.__dict__ if re.match("^__.+__$", name)}
)
if remaining:
raise AssertionError(
I see you have a PR, let's do it like that. I dont think we should be hardcoding all the dunders here.
Gotcha, that's better!
Edgar Ramírez-Mondragón has proposed a fix for this issue in the main branch:
Ignore all dunders when checking attributes in sqlalchemy.util.langhelpers.TypingOnly
https://gerrit.sqlalchemy.org/c/sqlalchemy/sqlalchemy/+/5287
Edgar Ramírez-Mondragón has proposed a fix for this issue in the main branch:
Ignore all dunders when checking attributes in sqlalchemy.util.langhelpers.TypingOnly
https://gerrit.sqlalchemy.org/c/sqlalchemy/sqlalchemy/+/5287
Edgar Ramírez-Mondragón has proposed a fix for this issue in the rel_2_0 branch:
Ignore all dunders when checking attributes in sqlalchemy.util.langhelpers.TypingOnly
https://gerrit.sqlalchemy.org/c/sqlalchemy/sqlalchemy/+/5273
Describe the bug
An exception is raised on Python 3.13:
Let me know if this is too premature, specially since greenlet (a current dependency, but I think it'll be dropped for 2.1?) does not currently build on Python 3.13. Otherwise I can submit a quick PR to fix this.
Optional link from https://docs.sqlalchemy.org which documents the behavior that is expected
No response
SQLAlchemy Version in Use
main
DBAPI (i.e. the database driver)
pysqlite
Database Vendor and Major Version
SQLite
Python Version
3.13
Operating system
Linux
To Reproduce
Error
Additional context