statikk 0.1.23__tar.gz → 0.1.25__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 (43) hide show
  1. {statikk-0.1.23 → statikk-0.1.25}/PKG-INFO +1 -1
  2. {statikk-0.1.23 → statikk-0.1.25}/src/statikk/models.py +10 -2
  3. {statikk-0.1.23 → statikk-0.1.25}/src/statikk.egg-info/PKG-INFO +1 -1
  4. {statikk-0.1.23 → statikk-0.1.25}/.coveragerc +0 -0
  5. {statikk-0.1.23 → statikk-0.1.25}/.gitignore +0 -0
  6. {statikk-0.1.23 → statikk-0.1.25}/.readthedocs.yml +0 -0
  7. {statikk-0.1.23 → statikk-0.1.25}/AUTHORS.rst +0 -0
  8. {statikk-0.1.23 → statikk-0.1.25}/CHANGELOG.rst +0 -0
  9. {statikk-0.1.23 → statikk-0.1.25}/CONTRIBUTING.rst +0 -0
  10. {statikk-0.1.23 → statikk-0.1.25}/LICENSE.txt +0 -0
  11. {statikk-0.1.23 → statikk-0.1.25}/README.rst +0 -0
  12. {statikk-0.1.23 → statikk-0.1.25}/assets/favicon.png +0 -0
  13. {statikk-0.1.23 → statikk-0.1.25}/assets/logo.png +0 -0
  14. {statikk-0.1.23 → statikk-0.1.25}/docs/Makefile +0 -0
  15. {statikk-0.1.23 → statikk-0.1.25}/docs/_static/.gitignore +0 -0
  16. {statikk-0.1.23 → statikk-0.1.25}/docs/authors.rst +0 -0
  17. {statikk-0.1.23 → statikk-0.1.25}/docs/changelog.rst +0 -0
  18. {statikk-0.1.23 → statikk-0.1.25}/docs/conf.py +0 -0
  19. {statikk-0.1.23 → statikk-0.1.25}/docs/contributing.rst +0 -0
  20. {statikk-0.1.23 → statikk-0.1.25}/docs/index.rst +0 -0
  21. {statikk-0.1.23 → statikk-0.1.25}/docs/license.rst +0 -0
  22. {statikk-0.1.23 → statikk-0.1.25}/docs/readme.rst +0 -0
  23. {statikk-0.1.23 → statikk-0.1.25}/docs/requirements.txt +0 -0
  24. {statikk-0.1.23 → statikk-0.1.25}/docs/usage.rst +0 -0
  25. {statikk-0.1.23 → statikk-0.1.25}/pyproject.toml +0 -0
  26. {statikk-0.1.23 → statikk-0.1.25}/setup.cfg +0 -0
  27. {statikk-0.1.23 → statikk-0.1.25}/setup.py +0 -0
  28. {statikk-0.1.23 → statikk-0.1.25}/src/statikk/__init__.py +0 -0
  29. {statikk-0.1.23 → statikk-0.1.25}/src/statikk/conditions.py +0 -0
  30. {statikk-0.1.23 → statikk-0.1.25}/src/statikk/engine.py +0 -0
  31. {statikk-0.1.23 → statikk-0.1.25}/src/statikk/expressions.py +0 -0
  32. {statikk-0.1.23 → statikk-0.1.25}/src/statikk/fields.py +0 -0
  33. {statikk-0.1.23 → statikk-0.1.25}/src/statikk/typing.py +0 -0
  34. {statikk-0.1.23 → statikk-0.1.25}/src/statikk.egg-info/SOURCES.txt +0 -0
  35. {statikk-0.1.23 → statikk-0.1.25}/src/statikk.egg-info/dependency_links.txt +0 -0
  36. {statikk-0.1.23 → statikk-0.1.25}/src/statikk.egg-info/not-zip-safe +0 -0
  37. {statikk-0.1.23 → statikk-0.1.25}/src/statikk.egg-info/requires.txt +0 -0
  38. {statikk-0.1.23 → statikk-0.1.25}/src/statikk.egg-info/top_level.txt +0 -0
  39. {statikk-0.1.23 → statikk-0.1.25}/tests/conftest.py +0 -0
  40. {statikk-0.1.23 → statikk-0.1.25}/tests/test_engine.py +0 -0
  41. {statikk-0.1.23 → statikk-0.1.25}/tests/test_expressions.py +0 -0
  42. {statikk-0.1.23 → statikk-0.1.25}/tests/test_models.py +0 -0
  43. {statikk-0.1.23 → statikk-0.1.25}/tox.ini +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: statikk
3
- Version: 0.1.23
3
+ Version: 0.1.25
4
4
  Summary: statikk is a single table application (STA) library for DynamoDb.
5
5
  Home-page: https://github.com/terinia/statikk
6
6
  Author: Balint Biro
@@ -61,6 +61,11 @@ class TreeStructureChange(BaseModel):
61
61
  timestamp: datetime = Field(default_factory=datetime.now)
62
62
 
63
63
 
64
+ class ChangeTrackerMixin:
65
+ def custom_hash(self) -> int:
66
+ return 0
67
+
68
+
64
69
  class TrackingMixin:
65
70
  _original_hash: int = Field(exclude=True)
66
71
 
@@ -131,18 +136,21 @@ class TrackingMixin:
131
136
  def _make_hashable(self, value: Any) -> Any:
132
137
  if isinstance(value, (str, int, float, bool, type(None))):
133
138
  return value
134
- elif isinstance(value, list) or isinstance(value, set):
139
+ elif isinstance(value, (list, set, tuple)):
135
140
  return tuple(self._make_hashable(item) for item in value)
136
141
  elif isinstance(value, dict):
137
142
  return tuple((self._make_hashable(k), self._make_hashable(v)) for k, v in sorted(value.items()))
138
143
  elif isinstance(value, BaseModel) and hasattr(value, "_recursive_hash"):
139
144
  return value._recursive_hash()
145
+ elif isinstance(value, ChangeTrackerMixin):
146
+ return value.custom_hash()
140
147
  else:
141
148
  try:
142
149
  return hash(value)
143
150
  except TypeError:
151
+ origin = getattr(value, "__origin__", "unknown")
144
152
  logger.warning(
145
- f"{type(value)} is unhashable, tracking will not work. Consider implementing the TrackingMixin for this type."
153
+ f"{type(value)} is unhashable at origin {origin}, tracking will be ignored for this item. Consider implementing the ChangeTrackerMixin for this type. "
146
154
  )
147
155
  return None
148
156
  return value
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: statikk
3
- Version: 0.1.23
3
+ Version: 0.1.25
4
4
  Summary: statikk is a single table application (STA) library for DynamoDb.
5
5
  Home-page: https://github.com/terinia/statikk
6
6
  Author: Balint Biro
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
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