sqlakit 0.10.7__tar.gz → 0.10.9__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (30) hide show
  1. {sqlakit-0.10.7 → sqlakit-0.10.9}/PKG-INFO +1 -1
  2. {sqlakit-0.10.7 → sqlakit-0.10.9}/pyproject.toml +1 -1
  3. {sqlakit-0.10.7 → sqlakit-0.10.9}/pyproject.toml.orig +1 -1
  4. {sqlakit-0.10.7 → sqlakit-0.10.9}/sqlakit/_base.py +6 -1
  5. {sqlakit-0.10.7 → sqlakit-0.10.9}/sqlakit/pytest_plugin.py +3 -1
  6. {sqlakit-0.10.7 → sqlakit-0.10.9}/LICENSE +0 -0
  7. {sqlakit-0.10.7 → sqlakit-0.10.9}/README.md +0 -0
  8. {sqlakit-0.10.7 → sqlakit-0.10.9}/sqlakit/__init__.py +0 -0
  9. {sqlakit-0.10.7 → sqlakit-0.10.9}/sqlakit/_cli.py +0 -0
  10. {sqlakit-0.10.7 → sqlakit-0.10.9}/sqlakit/_db.py +0 -0
  11. {sqlakit-0.10.7 → sqlakit-0.10.9}/sqlakit/_debugserver.py +0 -0
  12. {sqlakit-0.10.7 → sqlakit-0.10.9}/sqlakit/_discovery.py +0 -0
  13. {sqlakit-0.10.7 → sqlakit-0.10.9}/sqlakit/_model.py +0 -0
  14. {sqlakit-0.10.7 → sqlakit-0.10.9}/sqlakit/_query.py +0 -0
  15. {sqlakit-0.10.7 → sqlakit-0.10.9}/sqlakit/_recording.py +0 -0
  16. {sqlakit-0.10.7 → sqlakit-0.10.9}/sqlakit/_registry.py +0 -0
  17. {sqlakit-0.10.7 → sqlakit-0.10.9}/sqlakit/_routing.py +0 -0
  18. {sqlakit-0.10.7 → sqlakit-0.10.9}/sqlakit/_sql.py +0 -0
  19. {sqlakit-0.10.7 → sqlakit-0.10.9}/sqlakit/asyncio/__init__.py +0 -0
  20. {sqlakit-0.10.7 → sqlakit-0.10.9}/sqlakit/asyncio/_db.py +0 -0
  21. {sqlakit-0.10.7 → sqlakit-0.10.9}/sqlakit/asyncio/_registry.py +0 -0
  22. {sqlakit-0.10.7 → sqlakit-0.10.9}/sqlakit/asyncio/orm.py +0 -0
  23. {sqlakit-0.10.7 → sqlakit-0.10.9}/sqlakit/asyncio/sql.py +0 -0
  24. {sqlakit-0.10.7 → sqlakit-0.10.9}/sqlakit/debugserver.html +0 -0
  25. {sqlakit-0.10.7 → sqlakit-0.10.9}/sqlakit/exceptions.py +0 -0
  26. {sqlakit-0.10.7 → sqlakit-0.10.9}/sqlakit/orm.py +0 -0
  27. {sqlakit-0.10.7 → sqlakit-0.10.9}/sqlakit/py.typed +0 -0
  28. {sqlakit-0.10.7 → sqlakit-0.10.9}/sqlakit/sql.py +0 -0
  29. {sqlakit-0.10.7 → sqlakit-0.10.9}/sqlakit/testing.py +0 -0
  30. {sqlakit-0.10.7 → sqlakit-0.10.9}/sqlakit/types.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: sqlakit
3
- Version: 0.10.7
3
+ Version: 0.10.9
4
4
  Summary: A toolkit for SQLAlchemy applications.
5
5
  Keywords: sqlalchemy,database,orm,sql,asyncio
6
6
  Author: Anton Ruhlov
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "sqlakit"
3
- version = "0.10.7"
3
+ version = "0.10.9"
4
4
  description = "A toolkit for SQLAlchemy applications."
5
5
  readme = "README.md"
6
6
  license = "MIT"
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "sqlakit"
3
- version = "0.10.7"
3
+ version = "0.10.9"
4
4
  description = "A toolkit for SQLAlchemy applications."
5
5
  readme = "README.md"
6
6
  license = "MIT"
@@ -1061,10 +1061,15 @@ class _DatabaseRegistryMixin(BaseDatabase[Any, Any], Generic[DatabaseT]):
1061
1061
  # fails, as it does on a registry with no database of its own, from
1062
1062
  # the outside and from its own methods.
1063
1063
  def __getattr__(self, name: str) -> object:
1064
+ # A dunder is the machinery asking, and a container that patched
1065
+ # `__getattribute__` bounces back here until it is answered.
1066
+ if name.startswith("__") and name.endswith("__"):
1067
+ raise AttributeError(name)
1064
1068
  # Only the database half is worth explaining. Anything else is a
1065
1069
  # name that does not exist, and saying so lets `hasattr`,
1066
1070
  # `copy` and every library that introspects work.
1067
- state = self.__dict__
1071
+ # Through `object`, so a patched `__getattribute__` cannot loop.
1072
+ state = object.__getattribute__(self, "__dict__")
1068
1073
  if "url" in state:
1069
1074
  raise AttributeError(name)
1070
1075
  asked_as_a_database = name in DATABASE_STATE or (
@@ -393,9 +393,11 @@ def _rolled_back(db: Any, using: tuple[Any, ...]) -> list[Any]: # noqa: ANN401
393
393
  a connection to each in the tests that read one.
394
394
  """
395
395
  if not using:
396
+ # A registry goes through `transactions`, one alias or many: with one
397
+ # it has a database of its own only when `configure` built it.
396
398
  return [
397
399
  db.transactions(rollback=True)
398
- if len(getattr(db, "aliases", ()) or ()) > 1
400
+ if hasattr(db, "aliases")
399
401
  else db.transaction(rollback=True)
400
402
  ]
401
403
  return [
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes