activemodel 0.14.1__tar.gz → 0.15.0__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 (78) hide show
  1. {activemodel-0.14.1 → activemodel-0.15.0}/CHANGELOG.md +7 -0
  2. {activemodel-0.14.1 → activemodel-0.15.0}/Justfile +15 -1
  3. {activemodel-0.14.1 → activemodel-0.15.0}/PKG-INFO +2 -2
  4. {activemodel-0.14.1 → activemodel-0.15.0}/activemodel/patches/get_column_from_field_patch.py +18 -16
  5. {activemodel-0.14.1 → activemodel-0.15.0}/pyproject.toml +2 -2
  6. {activemodel-0.14.1 → activemodel-0.15.0}/uv.lock +5 -5
  7. {activemodel-0.14.1 → activemodel-0.15.0}/.envrc +0 -0
  8. {activemodel-0.14.1 → activemodel-0.15.0}/.github/dependabot.yml +0 -0
  9. {activemodel-0.14.1 → activemodel-0.15.0}/.github/workflows/build_and_publish.yml +0 -0
  10. {activemodel-0.14.1 → activemodel-0.15.0}/.github/workflows/repo-sync.yml +0 -0
  11. {activemodel-0.14.1 → activemodel-0.15.0}/.gitignore +0 -0
  12. {activemodel-0.14.1 → activemodel-0.15.0}/.tool-versions +0 -0
  13. {activemodel-0.14.1 → activemodel-0.15.0}/.vscode/settings.json +0 -0
  14. {activemodel-0.14.1 → activemodel-0.15.0}/LICENSE +0 -0
  15. {activemodel-0.14.1 → activemodel-0.15.0}/Makefile +0 -0
  16. {activemodel-0.14.1 → activemodel-0.15.0}/README.md +0 -0
  17. {activemodel-0.14.1 → activemodel-0.15.0}/TODO +0 -0
  18. {activemodel-0.14.1 → activemodel-0.15.0}/activemodel/__init__.py +0 -0
  19. {activemodel-0.14.1 → activemodel-0.15.0}/activemodel/base_model.py +0 -0
  20. {activemodel-0.14.1 → activemodel-0.15.0}/activemodel/celery.py +0 -0
  21. {activemodel-0.14.1 → activemodel-0.15.0}/activemodel/cli/__init__.py +0 -0
  22. {activemodel-0.14.1 → activemodel-0.15.0}/activemodel/errors.py +0 -0
  23. {activemodel-0.14.1 → activemodel-0.15.0}/activemodel/logger.py +0 -0
  24. {activemodel-0.14.1 → activemodel-0.15.0}/activemodel/mixins/__init__.py +0 -0
  25. {activemodel-0.14.1 → activemodel-0.15.0}/activemodel/mixins/pydantic_json.py +0 -0
  26. {activemodel-0.14.1 → activemodel-0.15.0}/activemodel/mixins/soft_delete.py +0 -0
  27. {activemodel-0.14.1 → activemodel-0.15.0}/activemodel/mixins/timestamps.py +0 -0
  28. {activemodel-0.14.1 → activemodel-0.15.0}/activemodel/mixins/typeid.py +0 -0
  29. {activemodel-0.14.1 → activemodel-0.15.0}/activemodel/patches/__init__.py +0 -0
  30. {activemodel-0.14.1 → activemodel-0.15.0}/activemodel/pytest/__init__.py +0 -0
  31. {activemodel-0.14.1 → activemodel-0.15.0}/activemodel/pytest/factories.py +0 -0
  32. {activemodel-0.14.1 → activemodel-0.15.0}/activemodel/pytest/plugin.py +0 -0
  33. {activemodel-0.14.1 → activemodel-0.15.0}/activemodel/pytest/transaction.py +0 -0
  34. {activemodel-0.14.1 → activemodel-0.15.0}/activemodel/pytest/truncate.py +0 -0
  35. {activemodel-0.14.1 → activemodel-0.15.0}/activemodel/query_wrapper.py +0 -0
  36. {activemodel-0.14.1 → activemodel-0.15.0}/activemodel/session_manager.py +0 -0
  37. {activemodel-0.14.1 → activemodel-0.15.0}/activemodel/types/__init__.py +0 -0
  38. {activemodel-0.14.1 → activemodel-0.15.0}/activemodel/types/sqlalchemy_protocol.py +0 -0
  39. {activemodel-0.14.1 → activemodel-0.15.0}/activemodel/types/sqlalchemy_protocol.pyi +0 -0
  40. {activemodel-0.14.1 → activemodel-0.15.0}/activemodel/types/typeid.py +0 -0
  41. {activemodel-0.14.1 → activemodel-0.15.0}/activemodel/types/typeid_patch.py +0 -0
  42. {activemodel-0.14.1 → activemodel-0.15.0}/activemodel/utils.py +0 -0
  43. {activemodel-0.14.1 → activemodel-0.15.0}/docker-compose.yml +0 -0
  44. {activemodel-0.14.1 → activemodel-0.15.0}/playground/alternative_typeid_mixin.py +0 -0
  45. {activemodel-0.14.1 → activemodel-0.15.0}/playground/comments.py +0 -0
  46. {activemodel-0.14.1 → activemodel-0.15.0}/playground/env-with-model.patch +0 -0
  47. {activemodel-0.14.1 → activemodel-0.15.0}/playground/extract_comments.py +0 -0
  48. {activemodel-0.14.1 → activemodel-0.15.0}/playground/field.py +0 -0
  49. {activemodel-0.14.1 → activemodel-0.15.0}/playground/middleware.py +0 -0
  50. {activemodel-0.14.1 → activemodel-0.15.0}/playground/old_session_manager.py +0 -0
  51. {activemodel-0.14.1 → activemodel-0.15.0}/playground/pydantic_validation.py +0 -0
  52. {activemodel-0.14.1 → activemodel-0.15.0}/playground.py +0 -0
  53. {activemodel-0.14.1 → activemodel-0.15.0}/test/__init__.py +0 -0
  54. {activemodel-0.14.1 → activemodel-0.15.0}/test/comments_test.py +0 -0
  55. {activemodel-0.14.1 → activemodel-0.15.0}/test/conftest.py +0 -0
  56. {activemodel-0.14.1 → activemodel-0.15.0}/test/delete_test.py +0 -0
  57. {activemodel-0.14.1 → activemodel-0.15.0}/test/factory_test.py +0 -0
  58. {activemodel-0.14.1 → activemodel-0.15.0}/test/fastapi_test.py +0 -0
  59. {activemodel-0.14.1 → activemodel-0.15.0}/test/import_test.py +0 -0
  60. {activemodel-0.14.1 → activemodel-0.15.0}/test/lifecycle_test.py +0 -0
  61. {activemodel-0.14.1 → activemodel-0.15.0}/test/migrations/README +0 -0
  62. {activemodel-0.14.1 → activemodel-0.15.0}/test/migrations/alembic.ini +0 -0
  63. {activemodel-0.14.1 → activemodel-0.15.0}/test/migrations/env.py +0 -0
  64. {activemodel-0.14.1 → activemodel-0.15.0}/test/migrations/script.py.mako +0 -0
  65. {activemodel-0.14.1 → activemodel-0.15.0}/test/migrations_test.py +0 -0
  66. {activemodel-0.14.1 → activemodel-0.15.0}/test/models.py +0 -0
  67. {activemodel-0.14.1 → activemodel-0.15.0}/test/mutation_test.py +0 -0
  68. {activemodel-0.14.1 → activemodel-0.15.0}/test/nested_pydantic_json_test.py +0 -0
  69. {activemodel-0.14.1 → activemodel-0.15.0}/test/orm/test_upsert.py +0 -0
  70. {activemodel-0.14.1 → activemodel-0.15.0}/test/orm_test.py +0 -0
  71. {activemodel-0.14.1 → activemodel-0.15.0}/test/pytest/pytest_test.py +0 -0
  72. {activemodel-0.14.1 → activemodel-0.15.0}/test/session_manager_test.py +0 -0
  73. {activemodel-0.14.1 → activemodel-0.15.0}/test/table_name_test.py +0 -0
  74. {activemodel-0.14.1 → activemodel-0.15.0}/test/test_query_wrapper.py +0 -0
  75. {activemodel-0.14.1 → activemodel-0.15.0}/test/types/typeid_mixin_test.py +0 -0
  76. {activemodel-0.14.1 → activemodel-0.15.0}/test/types/typeid_pydantic_test.py +0 -0
  77. {activemodel-0.14.1 → activemodel-0.15.0}/test/types/typeid_sqlmodel_test.py +0 -0
  78. {activemodel-0.14.1 → activemodel-0.15.0}/test/utils.py +0 -0
@@ -1,5 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.15.0](https://github.com/iloveitaly/activemodel/compare/v0.14.1...v0.15.0) (2026-02-04)
4
+
5
+
6
+ ### Features
7
+
8
+ * sqlmodel 0.0.32 support ([#33](https://github.com/iloveitaly/activemodel/issues/33)) ([e2a104a](https://github.com/iloveitaly/activemodel/commit/e2a104a11cd1f530e52aa0d6b2e951752ef2bb92))
9
+
3
10
  ## [0.14.1](https://github.com/iloveitaly/activemodel/compare/v0.14.0...v0.14.1) (2026-01-14)
4
11
 
5
12
 
@@ -88,4 +88,18 @@ github_ruleset_protect_master_delete:
88
88
 
89
89
  # adds github ruleset to prevent --force and other destructive actions on the github main branch
90
90
  github_ruleset_protect_master_create: github_ruleset_protect_master_delete
91
- gh api --method POST repos/$(just _github_repo)/rulesets --input - <<< '{{GITHUB_PROTECT_MASTER_RULESET}}'
91
+ gh api --method POST repos/$(just _github_repo)/rulesets --input - <<< '{{GITHUB_PROTECT_MASTER_RULESET}}'
92
+
93
+ INVESTIGATE_PATCHES_PROMPT := '''
94
+ Take a look at this patched function from an external package. The assertion that is in place is breaking because the upstream package was mutated.
95
+
96
+ I want you to investigate the changes in that function between The current version of that package that is used in this project and the most recent version. Take a look at our patch and:
97
+
98
+ 1. Check the latest version of the package in pypi and update the version reference in pyproject.toml and `uv sync`
99
+ 2. Update the patch if necessary to be compatible with the latest logic in the upstream package.
100
+ 3. Provide a summary of the changes made in the latest version of that function.
101
+ '''
102
+
103
+ # Output the investigate patches prompt
104
+ investigate-patches-prompt:
105
+ @echo '{{INVESTIGATE_PATCHES_PROMPT}}'
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: activemodel
3
- Version: 0.14.1
3
+ Version: 0.15.0
4
4
  Summary: Make SQLModel more like an a real ORM
5
5
  Project-URL: Repository, https://github.com/iloveitaly/activemodel
6
6
  Author-email: Michael Bianco <iloveitaly@gmail.com>
@@ -8,7 +8,7 @@ License-File: LICENSE
8
8
  Keywords: activemodel,activerecord,orm,sqlalchemy,sqlmodel
9
9
  Requires-Python: >=3.12
10
10
  Requires-Dist: python-decouple-typed>=3.11.0
11
- Requires-Dist: sqlmodel>=0.0.27
11
+ Requires-Dist: sqlmodel==0.0.32
12
12
  Requires-Dist: textcase>=0.4.0
13
13
  Requires-Dist: typeid-python==0.3.3
14
14
  Description-Content-Type: text/markdown
@@ -29,7 +29,7 @@ from sqlmodel._compat import ( # type: ignore[attr-defined]
29
29
  UndefinedType,
30
30
  is_field_noneable,
31
31
  )
32
- from sqlmodel.main import get_sqlalchemy_type
32
+ from sqlmodel.main import get_sqlalchemy_type, _get_sqlmodel_field_value
33
33
 
34
34
  from activemodel.utils import hash_function_code
35
35
 
@@ -43,7 +43,7 @@ if TYPE_CHECKING:
43
43
  # https://github.com/fastapi/sqlmodel/blob/5c2dbe419edc2d15200eee5269c9508987944ed8/sqlmodel/main.py#L691
44
44
  assert (
45
45
  hash_function_code(sqlmodel.main.get_column_from_field)
46
- == "ab3cdd5d20079358911b6aef76b3916ba3890b20eb07e970a0f35bd63e1713d9"
46
+ == "c64e50f8ca8a345ad2543690849a284d5436515835e41c56638cfaba251bc406"
47
47
  ), (
48
48
  f"get_column_from_field has changed, please verify the patch is still valid: {hash_function_code(sqlmodel.main.get_column_from_field)}"
49
49
  )
@@ -51,7 +51,7 @@ assert (
51
51
 
52
52
  def get_column_from_field(field: Any) -> Column: # type: ignore
53
53
  field_info = field
54
- sa_column = getattr(field_info, "sa_column", Undefined)
54
+ sa_column = _get_sqlmodel_field_value(field_info, "sa_column", Undefined)
55
55
  if isinstance(sa_column, Column):
56
56
  # <Change>
57
57
  if not sa_column.comment and (field_comment := field_info.description):
@@ -59,35 +59,35 @@ def get_column_from_field(field: Any) -> Column: # type: ignore
59
59
  # </Change>
60
60
  return sa_column
61
61
  sa_type = get_sqlalchemy_type(field)
62
- primary_key = getattr(field_info, "primary_key", Undefined)
62
+ primary_key = _get_sqlmodel_field_value(field_info, "primary_key", Undefined)
63
63
  if primary_key is Undefined:
64
64
  primary_key = False
65
- index = getattr(field_info, "index", Undefined)
65
+ index = _get_sqlmodel_field_value(field_info, "index", Undefined)
66
66
  if index is Undefined:
67
67
  index = False
68
68
  nullable = not primary_key and is_field_noneable(field)
69
69
  # Override derived nullability if the nullable property is set explicitly
70
70
  # on the field
71
- field_nullable = getattr(field_info, "nullable", Undefined) # noqa: B009
71
+ field_nullable = _get_sqlmodel_field_value(field_info, "nullable", Undefined) # noqa: B009
72
72
  if field_nullable is not Undefined:
73
73
  assert not isinstance(field_nullable, UndefinedType)
74
74
  nullable = field_nullable
75
75
  args = []
76
- foreign_key = getattr(field_info, "foreign_key", Undefined)
76
+ foreign_key = _get_sqlmodel_field_value(field_info, "foreign_key", Undefined)
77
77
  if foreign_key is Undefined:
78
78
  foreign_key = None
79
- unique = getattr(field_info, "unique", Undefined)
79
+ unique = _get_sqlmodel_field_value(field_info, "unique", Undefined)
80
80
  if unique is Undefined:
81
81
  unique = False
82
82
  if foreign_key:
83
- if field_info.ondelete == "SET NULL" and not nullable:
83
+ ondelete_value = _get_sqlmodel_field_value(field_info, "ondelete", Undefined)
84
+ if ondelete_value is Undefined:
85
+ ondelete_value = None
86
+ if ondelete_value == "SET NULL" and not nullable:
84
87
  raise RuntimeError('ondelete="SET NULL" requires nullable=True')
85
88
  assert isinstance(foreign_key, str)
86
- ondelete = getattr(field_info, "ondelete", Undefined)
87
- if ondelete is Undefined:
88
- ondelete = None
89
- assert isinstance(ondelete, (str, type(None))) # for typing
90
- args.append(ForeignKey(foreign_key, ondelete=ondelete))
89
+ assert isinstance(ondelete_value, (str, type(None))) # for typing
90
+ args.append(ForeignKey(foreign_key, ondelete=ondelete_value))
91
91
  kwargs = {
92
92
  "primary_key": primary_key,
93
93
  "nullable": nullable,
@@ -101,10 +101,12 @@ def get_column_from_field(field: Any) -> Column: # type: ignore
101
101
  sa_default = field_info.default
102
102
  if sa_default is not Undefined:
103
103
  kwargs["default"] = sa_default
104
- sa_column_args = getattr(field_info, "sa_column_args", Undefined)
104
+ sa_column_args = _get_sqlmodel_field_value(field_info, "sa_column_args", Undefined)
105
105
  if sa_column_args is not Undefined:
106
106
  args.extend(list(cast(Sequence[Any], sa_column_args)))
107
- sa_column_kwargs = getattr(field_info, "sa_column_kwargs", Undefined)
107
+ sa_column_kwargs = _get_sqlmodel_field_value(
108
+ field_info, "sa_column_kwargs", Undefined
109
+ )
108
110
 
109
111
  # <Change>
110
112
  if field_info.description:
@@ -1,12 +1,12 @@
1
1
  [project]
2
2
  name = "activemodel"
3
- version = "0.14.1"
3
+ version = "0.15.0"
4
4
  description = "Make SQLModel more like an a real ORM"
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.12"
7
7
  dependencies = [
8
8
  "python-decouple-typed>=3.11.0",
9
- "sqlmodel>=0.0.27",
9
+ "sqlmodel==0.0.32",
10
10
  "textcase>=0.4.0",
11
11
  "typeid-python==0.3.3",
12
12
  ]
@@ -4,7 +4,7 @@ requires-python = ">=3.12"
4
4
 
5
5
  [[package]]
6
6
  name = "activemodel"
7
- version = "0.14.1"
7
+ version = "0.15.0"
8
8
  source = { editable = "." }
9
9
  dependencies = [
10
10
  { name = "python-decouple-typed" },
@@ -32,7 +32,7 @@ dev = [
32
32
  [package.metadata]
33
33
  requires-dist = [
34
34
  { name = "python-decouple-typed", specifier = ">=3.11.0" },
35
- { name = "sqlmodel", specifier = ">=0.0.27" },
35
+ { name = "sqlmodel", specifier = "==0.0.32" },
36
36
  { name = "textcase", specifier = ">=0.4.0" },
37
37
  { name = "typeid-python", specifier = "==0.3.3" },
38
38
  ]
@@ -1208,15 +1208,15 @@ wheels = [
1208
1208
 
1209
1209
  [[package]]
1210
1210
  name = "sqlmodel"
1211
- version = "0.0.31"
1211
+ version = "0.0.32"
1212
1212
  source = { registry = "https://pypi.org/simple" }
1213
1213
  dependencies = [
1214
1214
  { name = "pydantic" },
1215
1215
  { name = "sqlalchemy" },
1216
1216
  ]
1217
- sdist = { url = "https://files.pythonhosted.org/packages/56/b8/e7cd6def4a773f25d6e29ffce63ccbfd6cf9488b804ab6fb9b80d334b39d/sqlmodel-0.0.31.tar.gz", hash = "sha256:2d41a8a9ee05e40736e2f9db8ea28cbfe9b5d4e5a18dd139e80605025e0c516c", size = 94952, upload-time = "2025-12-28T12:35:01.436Z" }
1217
+ sdist = { url = "https://files.pythonhosted.org/packages/d1/89/67f8964f3b2ed073fa4e95201e708291935d00e3600f36f09c1be3e279fe/sqlmodel-0.0.32.tar.gz", hash = "sha256:48e8fe4c8c3d7d8bf8468db17fa92ca680421e86cfec8b352217ef40736767be", size = 94140, upload-time = "2026-02-01T18:19:14.752Z" }
1218
1218
  wheels = [
1219
- { url = "https://files.pythonhosted.org/packages/6c/72/5aa5be921800f6418a949a73c9bb7054890881143e6bc604a93d228a95a3/sqlmodel-0.0.31-py3-none-any.whl", hash = "sha256:6d946d56cac4c2db296ba1541357cee2e795d68174e2043cd138b916794b1513", size = 27093, upload-time = "2025-12-28T12:35:00.108Z" },
1219
+ { url = "https://files.pythonhosted.org/packages/ed/de/d9b40ed2c570fd612c2abd57e4d9084a9d8eb1797447e2ce897b77b1c4b2/sqlmodel-0.0.32-py3-none-any.whl", hash = "sha256:d62f0702599592046c1a136d3512feab3d5a80e2988642ef0ed2c89b9b8b297b", size = 27416, upload-time = "2026-02-01T18:19:15.992Z" },
1220
1220
  ]
1221
1221
 
1222
1222
  [[package]]
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes