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.
- {activemodel-0.14.1 → activemodel-0.15.0}/CHANGELOG.md +7 -0
- {activemodel-0.14.1 → activemodel-0.15.0}/Justfile +15 -1
- {activemodel-0.14.1 → activemodel-0.15.0}/PKG-INFO +2 -2
- {activemodel-0.14.1 → activemodel-0.15.0}/activemodel/patches/get_column_from_field_patch.py +18 -16
- {activemodel-0.14.1 → activemodel-0.15.0}/pyproject.toml +2 -2
- {activemodel-0.14.1 → activemodel-0.15.0}/uv.lock +5 -5
- {activemodel-0.14.1 → activemodel-0.15.0}/.envrc +0 -0
- {activemodel-0.14.1 → activemodel-0.15.0}/.github/dependabot.yml +0 -0
- {activemodel-0.14.1 → activemodel-0.15.0}/.github/workflows/build_and_publish.yml +0 -0
- {activemodel-0.14.1 → activemodel-0.15.0}/.github/workflows/repo-sync.yml +0 -0
- {activemodel-0.14.1 → activemodel-0.15.0}/.gitignore +0 -0
- {activemodel-0.14.1 → activemodel-0.15.0}/.tool-versions +0 -0
- {activemodel-0.14.1 → activemodel-0.15.0}/.vscode/settings.json +0 -0
- {activemodel-0.14.1 → activemodel-0.15.0}/LICENSE +0 -0
- {activemodel-0.14.1 → activemodel-0.15.0}/Makefile +0 -0
- {activemodel-0.14.1 → activemodel-0.15.0}/README.md +0 -0
- {activemodel-0.14.1 → activemodel-0.15.0}/TODO +0 -0
- {activemodel-0.14.1 → activemodel-0.15.0}/activemodel/__init__.py +0 -0
- {activemodel-0.14.1 → activemodel-0.15.0}/activemodel/base_model.py +0 -0
- {activemodel-0.14.1 → activemodel-0.15.0}/activemodel/celery.py +0 -0
- {activemodel-0.14.1 → activemodel-0.15.0}/activemodel/cli/__init__.py +0 -0
- {activemodel-0.14.1 → activemodel-0.15.0}/activemodel/errors.py +0 -0
- {activemodel-0.14.1 → activemodel-0.15.0}/activemodel/logger.py +0 -0
- {activemodel-0.14.1 → activemodel-0.15.0}/activemodel/mixins/__init__.py +0 -0
- {activemodel-0.14.1 → activemodel-0.15.0}/activemodel/mixins/pydantic_json.py +0 -0
- {activemodel-0.14.1 → activemodel-0.15.0}/activemodel/mixins/soft_delete.py +0 -0
- {activemodel-0.14.1 → activemodel-0.15.0}/activemodel/mixins/timestamps.py +0 -0
- {activemodel-0.14.1 → activemodel-0.15.0}/activemodel/mixins/typeid.py +0 -0
- {activemodel-0.14.1 → activemodel-0.15.0}/activemodel/patches/__init__.py +0 -0
- {activemodel-0.14.1 → activemodel-0.15.0}/activemodel/pytest/__init__.py +0 -0
- {activemodel-0.14.1 → activemodel-0.15.0}/activemodel/pytest/factories.py +0 -0
- {activemodel-0.14.1 → activemodel-0.15.0}/activemodel/pytest/plugin.py +0 -0
- {activemodel-0.14.1 → activemodel-0.15.0}/activemodel/pytest/transaction.py +0 -0
- {activemodel-0.14.1 → activemodel-0.15.0}/activemodel/pytest/truncate.py +0 -0
- {activemodel-0.14.1 → activemodel-0.15.0}/activemodel/query_wrapper.py +0 -0
- {activemodel-0.14.1 → activemodel-0.15.0}/activemodel/session_manager.py +0 -0
- {activemodel-0.14.1 → activemodel-0.15.0}/activemodel/types/__init__.py +0 -0
- {activemodel-0.14.1 → activemodel-0.15.0}/activemodel/types/sqlalchemy_protocol.py +0 -0
- {activemodel-0.14.1 → activemodel-0.15.0}/activemodel/types/sqlalchemy_protocol.pyi +0 -0
- {activemodel-0.14.1 → activemodel-0.15.0}/activemodel/types/typeid.py +0 -0
- {activemodel-0.14.1 → activemodel-0.15.0}/activemodel/types/typeid_patch.py +0 -0
- {activemodel-0.14.1 → activemodel-0.15.0}/activemodel/utils.py +0 -0
- {activemodel-0.14.1 → activemodel-0.15.0}/docker-compose.yml +0 -0
- {activemodel-0.14.1 → activemodel-0.15.0}/playground/alternative_typeid_mixin.py +0 -0
- {activemodel-0.14.1 → activemodel-0.15.0}/playground/comments.py +0 -0
- {activemodel-0.14.1 → activemodel-0.15.0}/playground/env-with-model.patch +0 -0
- {activemodel-0.14.1 → activemodel-0.15.0}/playground/extract_comments.py +0 -0
- {activemodel-0.14.1 → activemodel-0.15.0}/playground/field.py +0 -0
- {activemodel-0.14.1 → activemodel-0.15.0}/playground/middleware.py +0 -0
- {activemodel-0.14.1 → activemodel-0.15.0}/playground/old_session_manager.py +0 -0
- {activemodel-0.14.1 → activemodel-0.15.0}/playground/pydantic_validation.py +0 -0
- {activemodel-0.14.1 → activemodel-0.15.0}/playground.py +0 -0
- {activemodel-0.14.1 → activemodel-0.15.0}/test/__init__.py +0 -0
- {activemodel-0.14.1 → activemodel-0.15.0}/test/comments_test.py +0 -0
- {activemodel-0.14.1 → activemodel-0.15.0}/test/conftest.py +0 -0
- {activemodel-0.14.1 → activemodel-0.15.0}/test/delete_test.py +0 -0
- {activemodel-0.14.1 → activemodel-0.15.0}/test/factory_test.py +0 -0
- {activemodel-0.14.1 → activemodel-0.15.0}/test/fastapi_test.py +0 -0
- {activemodel-0.14.1 → activemodel-0.15.0}/test/import_test.py +0 -0
- {activemodel-0.14.1 → activemodel-0.15.0}/test/lifecycle_test.py +0 -0
- {activemodel-0.14.1 → activemodel-0.15.0}/test/migrations/README +0 -0
- {activemodel-0.14.1 → activemodel-0.15.0}/test/migrations/alembic.ini +0 -0
- {activemodel-0.14.1 → activemodel-0.15.0}/test/migrations/env.py +0 -0
- {activemodel-0.14.1 → activemodel-0.15.0}/test/migrations/script.py.mako +0 -0
- {activemodel-0.14.1 → activemodel-0.15.0}/test/migrations_test.py +0 -0
- {activemodel-0.14.1 → activemodel-0.15.0}/test/models.py +0 -0
- {activemodel-0.14.1 → activemodel-0.15.0}/test/mutation_test.py +0 -0
- {activemodel-0.14.1 → activemodel-0.15.0}/test/nested_pydantic_json_test.py +0 -0
- {activemodel-0.14.1 → activemodel-0.15.0}/test/orm/test_upsert.py +0 -0
- {activemodel-0.14.1 → activemodel-0.15.0}/test/orm_test.py +0 -0
- {activemodel-0.14.1 → activemodel-0.15.0}/test/pytest/pytest_test.py +0 -0
- {activemodel-0.14.1 → activemodel-0.15.0}/test/session_manager_test.py +0 -0
- {activemodel-0.14.1 → activemodel-0.15.0}/test/table_name_test.py +0 -0
- {activemodel-0.14.1 → activemodel-0.15.0}/test/test_query_wrapper.py +0 -0
- {activemodel-0.14.1 → activemodel-0.15.0}/test/types/typeid_mixin_test.py +0 -0
- {activemodel-0.14.1 → activemodel-0.15.0}/test/types/typeid_pydantic_test.py +0 -0
- {activemodel-0.14.1 → activemodel-0.15.0}/test/types/typeid_sqlmodel_test.py +0 -0
- {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.
|
|
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
|
|
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
|
{activemodel-0.14.1 → activemodel-0.15.0}/activemodel/patches/get_column_from_field_patch.py
RENAMED
|
@@ -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
|
-
== "
|
|
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 =
|
|
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 =
|
|
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 =
|
|
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 =
|
|
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 =
|
|
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 =
|
|
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
|
-
|
|
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
|
-
|
|
87
|
-
|
|
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 =
|
|
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 =
|
|
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.
|
|
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
|
|
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.
|
|
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 = "
|
|
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.
|
|
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/
|
|
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/
|
|
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
|
|
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
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|