TypeDAL 5.0.0__tar.gz → 5.0.2__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.
- {typedal-5.0.0 → typedal-5.0.2}/PKG-INFO +58 -54
- typedal-5.0.2/pyproject.toml +271 -0
- typedal-5.0.0/pyproject.toml → typedal-5.0.2/pyproject.toml.orig +3 -8
- {typedal-5.0.0 → typedal-5.0.2}/src/typedal/caching.py +1 -1
- {typedal-5.0.0 → typedal-5.0.2}/src/typedal/cli.py +1 -1
- {typedal-5.0.0 → typedal-5.0.2}/src/typedal/query_builder.py +19 -3
- {typedal-5.0.0 → typedal-5.0.2}/src/typedal/tables.py +43 -3
- typedal-5.0.0/.crush/.gitignore +0 -1
- typedal-5.0.0/.crush/init +0 -0
- typedal-5.0.0/.crush/logs/crush.log +0 -54
- typedal-5.0.0/.github/workflows/su6.yml +0 -34
- typedal-5.0.0/.gitignore +0 -15
- typedal-5.0.0/.readthedocs.yml +0 -13
- typedal-5.0.0/CHANGELOG.md +0 -1103
- typedal-5.0.0/coverage.svg +0 -1
- typedal-5.0.0/docs/10_advanced_apis.md +0 -134
- typedal-5.0.0/docs/11_async.md +0 -218
- typedal-5.0.0/docs/1_getting_started.md +0 -85
- typedal-5.0.0/docs/2_defining_tables.md +0 -172
- typedal-5.0.0/docs/3_building_queries.md +0 -337
- typedal-5.0.0/docs/4_relationships.md +0 -234
- typedal-5.0.0/docs/5_py4web.md +0 -65
- typedal-5.0.0/docs/6_migrations.md +0 -102
- typedal-5.0.0/docs/7_configuration.md +0 -230
- typedal-5.0.0/docs/8_mixins.md +0 -188
- typedal-5.0.0/docs/9_memoization.md +0 -158
- typedal-5.0.0/docs/css/code_blocks.css +0 -7
- typedal-5.0.0/docs/index.md +0 -13
- typedal-5.0.0/docs/requirements.txt +0 -1
- typedal-5.0.0/example_new.py +0 -270
- typedal-5.0.0/example_old.py +0 -91
- typedal-5.0.0/mkdocs.yml +0 -45
- typedal-5.0.0/tasks.py +0 -54
- typedal-5.0.0/tests/__init__.py +0 -0
- typedal-5.0.0/tests/configs/simple.toml +0 -6
- typedal-5.0.0/tests/configs/valid.env +0 -8
- typedal-5.0.0/tests/configs/valid.toml +0 -19
- typedal-5.0.0/tests/conftest.py +0 -43
- typedal-5.0.0/tests/py314_tests.py +0 -156
- typedal-5.0.0/tests/test_async.py +0 -1890
- typedal-5.0.0/tests/test_cli.py +0 -131
- typedal-5.0.0/tests/test_config.py +0 -430
- typedal-5.0.0/tests/test_docs_examples.py +0 -115
- typedal-5.0.0/tests/test_helpers.py +0 -281
- typedal-5.0.0/tests/test_json.py +0 -55
- typedal-5.0.0/tests/test_main.py +0 -878
- typedal-5.0.0/tests/test_mixins.py +0 -531
- typedal-5.0.0/tests/test_mypy.py +0 -189
- typedal-5.0.0/tests/test_orm.py +0 -105
- typedal-5.0.0/tests/test_py4web.py +0 -91
- typedal-5.0.0/tests/test_query_builder.py +0 -1046
- typedal-5.0.0/tests/test_relationships.py +0 -1146
- typedal-5.0.0/tests/test_row.py +0 -334
- typedal-5.0.0/tests/test_stats.py +0 -48
- typedal-5.0.0/tests/test_table.py +0 -258
- typedal-5.0.0/tests/test_typescript.py +0 -190
- typedal-5.0.0/tests/test_typing_mypy.md +0 -268
- typedal-5.0.0/tests/test_typing_pyright.md +0 -243
- typedal-5.0.0/tests/test_web2py.py +0 -21
- typedal-5.0.0/tests/test_xx_others.py +0 -24
- typedal-5.0.0/tests/timings.py +0 -160
- typedal-5.0.0/uv.lock +0 -3067
- {typedal-5.0.0 → typedal-5.0.2}/README.md +0 -0
- {typedal-5.0.0 → typedal-5.0.2}/src/typedal/__about__.py +0 -0
- {typedal-5.0.0 → typedal-5.0.2}/src/typedal/__init__.py +0 -0
- {typedal-5.0.0 → typedal-5.0.2}/src/typedal/asynchronous.py +0 -0
- {typedal-5.0.0 → typedal-5.0.2}/src/typedal/config.py +0 -0
- {typedal-5.0.0 → typedal-5.0.2}/src/typedal/constants.py +0 -0
- {typedal-5.0.0 → typedal-5.0.2}/src/typedal/core.py +0 -0
- {typedal-5.0.0 → typedal-5.0.2}/src/typedal/define.py +0 -0
- {typedal-5.0.0 → typedal-5.0.2}/src/typedal/enum_helpers.py +0 -0
- {typedal-5.0.0 → typedal-5.0.2}/src/typedal/fields.py +0 -0
- {typedal-5.0.0 → typedal-5.0.2}/src/typedal/for_py4web.py +0 -0
- {typedal-5.0.0 → typedal-5.0.2}/src/typedal/for_web2py.py +0 -0
- {typedal-5.0.0 → typedal-5.0.2}/src/typedal/helpers.py +0 -0
- {typedal-5.0.0 → typedal-5.0.2}/src/typedal/mixins.py +0 -0
- {typedal-5.0.0 → typedal-5.0.2}/src/typedal/py.typed +0 -0
- {typedal-5.0.0 → typedal-5.0.2}/src/typedal/relationships.py +0 -0
- {typedal-5.0.0 → typedal-5.0.2}/src/typedal/rows.py +0 -0
- {typedal-5.0.0 → typedal-5.0.2}/src/typedal/serializers/as_json.py +0 -0
- {typedal-5.0.0 → typedal-5.0.2}/src/typedal/serializers/typescript.py +0 -0
- {typedal-5.0.0 → typedal-5.0.2}/src/typedal/types.py +0 -0
- {typedal-5.0.0 → typedal-5.0.2}/src/typedal/web2py_py4web_shared.py +0 -0
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.3
|
|
2
2
|
Name: TypeDAL
|
|
3
|
-
Version: 5.0.
|
|
3
|
+
Version: 5.0.2
|
|
4
4
|
Summary: Typing support for PyDAL
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
Project-URL: Source, https://github.com/trialandsuccess/TypeDAL
|
|
5
|
+
Keywords:
|
|
6
|
+
Author: Robin van der Noord
|
|
8
7
|
Author-email: Robin van der Noord <contact@trialandsuccess.nl>
|
|
9
8
|
Classifier: Development Status :: 4 - Beta
|
|
10
9
|
Classifier: Programming Language :: Python
|
|
@@ -13,63 +12,68 @@ Classifier: Programming Language :: Python :: 3.13
|
|
|
13
12
|
Classifier: Programming Language :: Python :: 3.14
|
|
14
13
|
Classifier: Programming Language :: Python :: Implementation :: CPython
|
|
15
14
|
Classifier: Programming Language :: Python :: Implementation :: PyPy
|
|
16
|
-
Requires-Python: >=3.12
|
|
17
|
-
Requires-Dist: configurable-json<2
|
|
18
|
-
Requires-Dist: configuraptor<3,>=2.1.0
|
|
19
|
-
Requires-Dist: dill<1
|
|
20
|
-
Requires-Dist: legacy-cgi; python_version >= '3.13'
|
|
21
15
|
Requires-Dist: pydal>=20251012.3
|
|
22
|
-
Requires-Dist:
|
|
16
|
+
Requires-Dist: dill<1
|
|
17
|
+
Requires-Dist: configuraptor>=2.1.0,<3
|
|
18
|
+
Requires-Dist: configurable-json<2
|
|
23
19
|
Requires-Dist: python-slugify<9
|
|
20
|
+
Requires-Dist: legacy-cgi ; python_full_version >= '3.13'
|
|
21
|
+
Requires-Dist: python-dateutil<3
|
|
22
|
+
Requires-Dist: py4web ; extra == 'all'
|
|
23
|
+
Requires-Dist: typtyp<1 ; extra == 'all'
|
|
24
|
+
Requires-Dist: tabulate ; extra == 'all'
|
|
25
|
+
Requires-Dist: edwh-migrate[full]>=0.8.0 ; extra == 'all'
|
|
26
|
+
Requires-Dist: pydantic<3 ; extra == 'all'
|
|
27
|
+
Requires-Dist: typer>=0.18,<0.19 ; extra == 'all'
|
|
28
|
+
Requires-Dist: tabulate ; extra == 'all'
|
|
29
|
+
Requires-Dist: questionary ; extra == 'all'
|
|
30
|
+
Requires-Dist: tomlkit ; extra == 'all'
|
|
31
|
+
Requires-Dist: pydal2sql[all]>=1.3.5 ; extra == 'all'
|
|
32
|
+
Requires-Dist: typer>=0.18,<0.19 ; extra == 'cli'
|
|
33
|
+
Requires-Dist: tabulate ; extra == 'cli'
|
|
34
|
+
Requires-Dist: questionary ; extra == 'cli'
|
|
35
|
+
Requires-Dist: tomlkit ; extra == 'cli'
|
|
36
|
+
Requires-Dist: pydal2sql>=1.3.5 ; extra == 'cli'
|
|
37
|
+
Requires-Dist: ewok ; extra == 'dev'
|
|
38
|
+
Requires-Dist: su6[all]>=1.9.0 ; extra == 'dev'
|
|
39
|
+
Requires-Dist: pytest-typing ; extra == 'dev'
|
|
40
|
+
Requires-Dist: pytest-asyncio ; extra == 'dev'
|
|
41
|
+
Requires-Dist: pyright<1.1.400 ; extra == 'dev'
|
|
42
|
+
Requires-Dist: contextlib-chdir ; extra == 'dev'
|
|
43
|
+
Requires-Dist: testcontainers ; extra == 'dev'
|
|
44
|
+
Requires-Dist: pydantic<3 ; extra == 'dev'
|
|
45
|
+
Requires-Dist: psycopg2-binary ; extra == 'dev'
|
|
46
|
+
Requires-Dist: requests<2.32 ; extra == 'dev'
|
|
47
|
+
Requires-Dist: types-tabulate ; extra == 'dev'
|
|
48
|
+
Requires-Dist: types-pyyaml ; extra == 'dev'
|
|
49
|
+
Requires-Dist: types-requests ; extra == 'dev'
|
|
50
|
+
Requires-Dist: mkdocs ; extra == 'dev'
|
|
51
|
+
Requires-Dist: mkdocs-dracula-theme ; extra == 'dev'
|
|
52
|
+
Requires-Dist: tabulate ; extra == 'migrations'
|
|
53
|
+
Requires-Dist: pydal2sql>=1.3.5 ; extra == 'migrations'
|
|
54
|
+
Requires-Dist: edwh-migrate>=0.8.0 ; extra == 'migrations'
|
|
55
|
+
Requires-Dist: typer>=0.18,<0.19 ; extra == 'migrations'
|
|
56
|
+
Requires-Dist: tabulate ; extra == 'migrations'
|
|
57
|
+
Requires-Dist: questionary ; extra == 'migrations'
|
|
58
|
+
Requires-Dist: tomlkit ; extra == 'migrations'
|
|
59
|
+
Requires-Dist: pydal2sql>=1.3.5 ; extra == 'migrations'
|
|
60
|
+
Requires-Dist: py4web ; extra == 'py4web'
|
|
61
|
+
Requires-Dist: typtyp<1 ; extra == 'typescript'
|
|
62
|
+
Requires-Dist: typer>=0.18,<0.19 ; extra == 'typescript'
|
|
63
|
+
Requires-Dist: tabulate ; extra == 'typescript'
|
|
64
|
+
Requires-Dist: questionary ; extra == 'typescript'
|
|
65
|
+
Requires-Dist: tomlkit ; extra == 'typescript'
|
|
66
|
+
Requires-Dist: pydal2sql>=1.3.5 ; extra == 'typescript'
|
|
67
|
+
Requires-Python: >=3.12
|
|
68
|
+
Project-URL: Documentation, https://typedal.readthedocs.io/
|
|
69
|
+
Project-URL: Issues, https://github.com/trialandsuccess/TypeDAL/issues
|
|
70
|
+
Project-URL: Source, https://github.com/trialandsuccess/TypeDAL
|
|
24
71
|
Provides-Extra: all
|
|
25
|
-
Requires-Dist: edwh-migrate[full]>=0.8.0; extra == 'all'
|
|
26
|
-
Requires-Dist: py4web; extra == 'all'
|
|
27
|
-
Requires-Dist: pydal2sql[all]>=1.3.5; extra == 'all'
|
|
28
|
-
Requires-Dist: pydantic<3; extra == 'all'
|
|
29
|
-
Requires-Dist: questionary; extra == 'all'
|
|
30
|
-
Requires-Dist: tabulate; extra == 'all'
|
|
31
|
-
Requires-Dist: tomlkit; extra == 'all'
|
|
32
|
-
Requires-Dist: typer<0.19,>=0.18; extra == 'all'
|
|
33
|
-
Requires-Dist: typtyp<1; extra == 'all'
|
|
34
72
|
Provides-Extra: cli
|
|
35
|
-
Requires-Dist: pydal2sql>=1.3.5; extra == 'cli'
|
|
36
|
-
Requires-Dist: questionary; extra == 'cli'
|
|
37
|
-
Requires-Dist: tabulate; extra == 'cli'
|
|
38
|
-
Requires-Dist: tomlkit; extra == 'cli'
|
|
39
|
-
Requires-Dist: typer<0.19,>=0.18; extra == 'cli'
|
|
40
73
|
Provides-Extra: dev
|
|
41
|
-
Requires-Dist: contextlib-chdir; extra == 'dev'
|
|
42
|
-
Requires-Dist: ewok; extra == 'dev'
|
|
43
|
-
Requires-Dist: hatch; extra == 'dev'
|
|
44
|
-
Requires-Dist: mkdocs; extra == 'dev'
|
|
45
|
-
Requires-Dist: mkdocs-dracula-theme; extra == 'dev'
|
|
46
|
-
Requires-Dist: psycopg2-binary; extra == 'dev'
|
|
47
|
-
Requires-Dist: pydantic<3; extra == 'dev'
|
|
48
|
-
Requires-Dist: pyright<1.1.400; extra == 'dev'
|
|
49
|
-
Requires-Dist: pytest-asyncio; extra == 'dev'
|
|
50
|
-
Requires-Dist: pytest-typing; extra == 'dev'
|
|
51
|
-
Requires-Dist: requests<2.32; extra == 'dev'
|
|
52
|
-
Requires-Dist: su6[all]>=1.9.0; extra == 'dev'
|
|
53
|
-
Requires-Dist: testcontainers; extra == 'dev'
|
|
54
|
-
Requires-Dist: types-pyyaml; extra == 'dev'
|
|
55
|
-
Requires-Dist: types-requests; extra == 'dev'
|
|
56
|
-
Requires-Dist: types-tabulate; extra == 'dev'
|
|
57
74
|
Provides-Extra: migrations
|
|
58
|
-
Requires-Dist: edwh-migrate>=0.8.0; extra == 'migrations'
|
|
59
|
-
Requires-Dist: pydal2sql>=1.3.5; extra == 'migrations'
|
|
60
|
-
Requires-Dist: questionary; extra == 'migrations'
|
|
61
|
-
Requires-Dist: tabulate; extra == 'migrations'
|
|
62
|
-
Requires-Dist: tomlkit; extra == 'migrations'
|
|
63
|
-
Requires-Dist: typer<0.19,>=0.18; extra == 'migrations'
|
|
64
75
|
Provides-Extra: py4web
|
|
65
|
-
Requires-Dist: py4web; extra == 'py4web'
|
|
66
76
|
Provides-Extra: typescript
|
|
67
|
-
Requires-Dist: pydal2sql>=1.3.5; extra == 'typescript'
|
|
68
|
-
Requires-Dist: questionary; extra == 'typescript'
|
|
69
|
-
Requires-Dist: tabulate; extra == 'typescript'
|
|
70
|
-
Requires-Dist: tomlkit; extra == 'typescript'
|
|
71
|
-
Requires-Dist: typer<0.19,>=0.18; extra == 'typescript'
|
|
72
|
-
Requires-Dist: typtyp<1; extra == 'typescript'
|
|
73
77
|
Description-Content-Type: text/markdown
|
|
74
78
|
|
|
75
79
|
# TypeDAL
|
|
@@ -0,0 +1,271 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["uv_build>=0.12.4,<0.13"]
|
|
3
|
+
build-backend = "uv_build"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "TypeDAL"
|
|
7
|
+
description = "Typing support for PyDAL"
|
|
8
|
+
readme = "README.md"
|
|
9
|
+
version = "5.0.2"
|
|
10
|
+
requires-python = ">=3.12"
|
|
11
|
+
license-expression = "MIT"
|
|
12
|
+
keywords = []
|
|
13
|
+
classifiers = [
|
|
14
|
+
"Development Status :: 4 - Beta",
|
|
15
|
+
"Programming Language :: Python",
|
|
16
|
+
"Programming Language :: Python :: 3.12",
|
|
17
|
+
"Programming Language :: Python :: 3.13",
|
|
18
|
+
"Programming Language :: Python :: 3.14",
|
|
19
|
+
"Programming Language :: Python :: Implementation :: CPython",
|
|
20
|
+
"Programming Language :: Python :: Implementation :: PyPy",
|
|
21
|
+
]
|
|
22
|
+
dependencies = [
|
|
23
|
+
"pydal >= 20251012.3",
|
|
24
|
+
"dill < 1",
|
|
25
|
+
"configuraptor >= 2.1.0, < 3",
|
|
26
|
+
"Configurable-JSON < 2",
|
|
27
|
+
"python-slugify < 9",
|
|
28
|
+
"legacy-cgi; python_version >= '3.13'",
|
|
29
|
+
"python-dateutil < 3",
|
|
30
|
+
]
|
|
31
|
+
|
|
32
|
+
[[project.authors]]
|
|
33
|
+
name = "Robin van der Noord"
|
|
34
|
+
email = "contact@trialandsuccess.nl"
|
|
35
|
+
|
|
36
|
+
[project.optional-dependencies]
|
|
37
|
+
py4web = ["py4web"]
|
|
38
|
+
cli = [
|
|
39
|
+
"typer >=0.18, <0.19",
|
|
40
|
+
"tabulate",
|
|
41
|
+
"questionary",
|
|
42
|
+
"tomlkit",
|
|
43
|
+
"pydal2sql>=1.3.5",
|
|
44
|
+
]
|
|
45
|
+
migrations = [
|
|
46
|
+
"tabulate",
|
|
47
|
+
"pydal2sql>=1.3.5",
|
|
48
|
+
"edwh-migrate>=0.8.0",
|
|
49
|
+
"typer >=0.18, <0.19",
|
|
50
|
+
"tabulate",
|
|
51
|
+
"questionary",
|
|
52
|
+
"tomlkit",
|
|
53
|
+
"pydal2sql>=1.3.5",
|
|
54
|
+
]
|
|
55
|
+
typescript = [
|
|
56
|
+
"typtyp < 1",
|
|
57
|
+
"typer >=0.18, <0.19",
|
|
58
|
+
"tabulate",
|
|
59
|
+
"questionary",
|
|
60
|
+
"tomlkit",
|
|
61
|
+
"pydal2sql>=1.3.5",
|
|
62
|
+
]
|
|
63
|
+
all = [
|
|
64
|
+
"py4web",
|
|
65
|
+
"typtyp < 1",
|
|
66
|
+
"tabulate",
|
|
67
|
+
"edwh-migrate[full]>=0.8.0",
|
|
68
|
+
"pydantic < 3",
|
|
69
|
+
"typer >=0.18, <0.19",
|
|
70
|
+
"tabulate",
|
|
71
|
+
"questionary",
|
|
72
|
+
"tomlkit",
|
|
73
|
+
"pydal2sql[all]>=1.3.5",
|
|
74
|
+
]
|
|
75
|
+
dev = [
|
|
76
|
+
"ewok",
|
|
77
|
+
"su6[all]>=1.9.0",
|
|
78
|
+
"pytest-typing",
|
|
79
|
+
"pytest-asyncio",
|
|
80
|
+
"pyright < 1.1.400",
|
|
81
|
+
"contextlib-chdir",
|
|
82
|
+
"testcontainers",
|
|
83
|
+
"pydantic < 3",
|
|
84
|
+
"psycopg2-binary",
|
|
85
|
+
"requests<2.32",
|
|
86
|
+
"types-tabulate",
|
|
87
|
+
"types-PyYAML",
|
|
88
|
+
"types-requests",
|
|
89
|
+
"mkdocs",
|
|
90
|
+
"mkdocs-dracula-theme",
|
|
91
|
+
]
|
|
92
|
+
|
|
93
|
+
[project.scripts]
|
|
94
|
+
typedal = "typedal.cli:app"
|
|
95
|
+
|
|
96
|
+
[project.urls]
|
|
97
|
+
Documentation = "https://typedal.readthedocs.io/"
|
|
98
|
+
Issues = "https://github.com/trialandsuccess/TypeDAL/issues"
|
|
99
|
+
Source = "https://github.com/trialandsuccess/TypeDAL"
|
|
100
|
+
|
|
101
|
+
[template.plugins.default]
|
|
102
|
+
src-layout = true
|
|
103
|
+
|
|
104
|
+
[tool.setuptools.package-data]
|
|
105
|
+
typedal = ["py.typed"]
|
|
106
|
+
|
|
107
|
+
[tool.vommit]
|
|
108
|
+
allow_breaking_bang = true
|
|
109
|
+
allow_breaking_footer = true
|
|
110
|
+
prerelease_token = "beta"
|
|
111
|
+
confirm = true
|
|
112
|
+
|
|
113
|
+
[tool.vommit.git]
|
|
114
|
+
enabled = true
|
|
115
|
+
origin = "origin"
|
|
116
|
+
branch = "master"
|
|
117
|
+
on_wrong_branch = "error"
|
|
118
|
+
tag_format = "v{version}"
|
|
119
|
+
commit_format = "{version}"
|
|
120
|
+
|
|
121
|
+
[tool.vommit.changelog]
|
|
122
|
+
enabled = true
|
|
123
|
+
file = "CHANGELOG.md"
|
|
124
|
+
include_prereleases = false
|
|
125
|
+
placeholder = "<!--next-version-placeholder-->"
|
|
126
|
+
placeholder_regex = '^<!\-\-next\-version\-placeholder\-\->$'
|
|
127
|
+
entry_title_format = "## v{version} ({date:%Y-%m-%d})"
|
|
128
|
+
|
|
129
|
+
[tool.vommit.changelog.levels]
|
|
130
|
+
feat = "Feature{s}"
|
|
131
|
+
fix = "Fix{es}"
|
|
132
|
+
break = "Breaking Change{s}"
|
|
133
|
+
docs = "Documentation"
|
|
134
|
+
perf = "Performance"
|
|
135
|
+
|
|
136
|
+
[tool.vommit.pypi]
|
|
137
|
+
enabled = true
|
|
138
|
+
use_keyring = true
|
|
139
|
+
|
|
140
|
+
[tool.vommit.commands]
|
|
141
|
+
clean = "rm -rf ./dist"
|
|
142
|
+
build = "uv build"
|
|
143
|
+
publish = "uv publish"
|
|
144
|
+
post_publish = "rm -rf ./dist"
|
|
145
|
+
|
|
146
|
+
[tool.vommit.version_bump_map]
|
|
147
|
+
break = "major"
|
|
148
|
+
feat = "minor"
|
|
149
|
+
fix = "patch"
|
|
150
|
+
perf = "patch"
|
|
151
|
+
|
|
152
|
+
[tool.edwh.test]
|
|
153
|
+
directory = "src"
|
|
154
|
+
|
|
155
|
+
[tool.su6]
|
|
156
|
+
directory = "src"
|
|
157
|
+
stop-after-first-failure = true
|
|
158
|
+
include = []
|
|
159
|
+
exclude = []
|
|
160
|
+
coverage = 100
|
|
161
|
+
badge = true
|
|
162
|
+
|
|
163
|
+
[tool.su6.default-flags]
|
|
164
|
+
mypy = "--disable-error-code misc"
|
|
165
|
+
|
|
166
|
+
[tool.black]
|
|
167
|
+
target-version = ["py314"]
|
|
168
|
+
line-length = 120
|
|
169
|
+
extend-exclude = '''
|
|
170
|
+
# A regex preceded with ^/ will apply only to files and directories
|
|
171
|
+
# in the root of the project.
|
|
172
|
+
(
|
|
173
|
+
^.*\.bak\/.+ # ignore every .bak directory
|
|
174
|
+
^.*venv.+\/.+ # ignore every venv directory
|
|
175
|
+
venv.+|.+\.bak # idk why it suddenly works, let's not touch it
|
|
176
|
+
)
|
|
177
|
+
'''
|
|
178
|
+
|
|
179
|
+
[tool.coverage.run]
|
|
180
|
+
source = ["src"]
|
|
181
|
+
|
|
182
|
+
[tool.coverage.report]
|
|
183
|
+
exclude_also = [
|
|
184
|
+
"if TYPE_CHECKING:",
|
|
185
|
+
"if t.TYPE_CHECKING:",
|
|
186
|
+
"if typing.TYPE_CHECKING:",
|
|
187
|
+
"except ImportError as e:",
|
|
188
|
+
"except ImportError:",
|
|
189
|
+
]
|
|
190
|
+
|
|
191
|
+
[tool.mypy]
|
|
192
|
+
python_version = "3.13"
|
|
193
|
+
no_implicit_optional = false
|
|
194
|
+
ignore_missing_imports = true
|
|
195
|
+
strict = true
|
|
196
|
+
exclude = [
|
|
197
|
+
"venv",
|
|
198
|
+
".bak",
|
|
199
|
+
]
|
|
200
|
+
|
|
201
|
+
[tool.ruff]
|
|
202
|
+
target-version = "py314"
|
|
203
|
+
line-length = 120
|
|
204
|
+
extend-exclude = [
|
|
205
|
+
"*.bak/",
|
|
206
|
+
"venv*/",
|
|
207
|
+
"tests/",
|
|
208
|
+
"example_*.py",
|
|
209
|
+
]
|
|
210
|
+
|
|
211
|
+
[tool.ruff.lint]
|
|
212
|
+
select = [
|
|
213
|
+
"F",
|
|
214
|
+
"E",
|
|
215
|
+
"W",
|
|
216
|
+
"Q",
|
|
217
|
+
"A",
|
|
218
|
+
"SIM",
|
|
219
|
+
"ARG",
|
|
220
|
+
"RUF",
|
|
221
|
+
]
|
|
222
|
+
unfixable = ["F401"]
|
|
223
|
+
extend-ignore = [
|
|
224
|
+
"E711",
|
|
225
|
+
"D200",
|
|
226
|
+
"D212",
|
|
227
|
+
"D418",
|
|
228
|
+
]
|
|
229
|
+
ignore = ["RUF013"]
|
|
230
|
+
|
|
231
|
+
[tool.ruff.lint.pydocstyle]
|
|
232
|
+
convention = "google"
|
|
233
|
+
|
|
234
|
+
[tool.ty.src]
|
|
235
|
+
include = ["src"]
|
|
236
|
+
|
|
237
|
+
[tool.ty.environment]
|
|
238
|
+
python-version = "3.14"
|
|
239
|
+
|
|
240
|
+
[tool.bandit]
|
|
241
|
+
exclude_dirs = [
|
|
242
|
+
".bak",
|
|
243
|
+
"venv",
|
|
244
|
+
]
|
|
245
|
+
skips = ["B108"]
|
|
246
|
+
|
|
247
|
+
[tool.isort]
|
|
248
|
+
profile = "black"
|
|
249
|
+
extend_skip_glob = ["*.bak/*"]
|
|
250
|
+
|
|
251
|
+
[tool.pydocstyle]
|
|
252
|
+
convention = "google"
|
|
253
|
+
match-dir = '(?!venv)[^\.].*'
|
|
254
|
+
add_select = [
|
|
255
|
+
"D213",
|
|
256
|
+
"D416",
|
|
257
|
+
"D417",
|
|
258
|
+
]
|
|
259
|
+
add_ignore = [
|
|
260
|
+
"D200",
|
|
261
|
+
"D212",
|
|
262
|
+
]
|
|
263
|
+
|
|
264
|
+
[tool.pytest]
|
|
265
|
+
pythonpath = ["src"]
|
|
266
|
+
typing_checkers = [
|
|
267
|
+
"mypy",
|
|
268
|
+
"pyright",
|
|
269
|
+
]
|
|
270
|
+
|
|
271
|
+
[tool.typedal]
|
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
[build-system]
|
|
2
|
-
requires = ["
|
|
3
|
-
build-backend = "
|
|
4
|
-
|
|
5
|
-
[tool.hatch.metadata]
|
|
6
|
-
allow-direct-references = true
|
|
2
|
+
requires = ["uv_build>=0.12.4,<0.13"]
|
|
3
|
+
build-backend = "uv_build"
|
|
7
4
|
|
|
8
5
|
[project]
|
|
9
6
|
name = "TypeDAL"
|
|
10
7
|
description = 'Typing support for PyDAL'
|
|
11
8
|
readme = "README.md"
|
|
9
|
+
version = "5.0.2"
|
|
12
10
|
requires-python = ">=3.12"
|
|
13
11
|
license-expression = "MIT"
|
|
14
12
|
keywords = []
|
|
@@ -33,7 +31,6 @@ dependencies = [
|
|
|
33
31
|
"legacy-cgi; python_version >= '3.13'",
|
|
34
32
|
"python-dateutil < 3",
|
|
35
33
|
]
|
|
36
|
-
version = "5.0.0"
|
|
37
34
|
|
|
38
35
|
[project.optional-dependencies]
|
|
39
36
|
py4web = [
|
|
@@ -86,7 +83,6 @@ all = [
|
|
|
86
83
|
|
|
87
84
|
dev = [
|
|
88
85
|
# build:
|
|
89
|
-
"hatch",
|
|
90
86
|
"ewok",
|
|
91
87
|
# test:
|
|
92
88
|
"su6[all]>=1.9.0",
|
|
@@ -242,7 +238,6 @@ extend-exclude = ["*.bak/", "venv*/", "tests/", "example_*.py"]
|
|
|
242
238
|
include = ["src"]
|
|
243
239
|
|
|
244
240
|
[tool.ty.environment]
|
|
245
|
-
python = "./venv"
|
|
246
241
|
python-version = "3.14"
|
|
247
242
|
|
|
248
243
|
[tool.ruff.lint]
|
|
@@ -578,7 +578,7 @@ def memoize[T: t.Any](
|
|
|
578
578
|
for row in arg:
|
|
579
579
|
deps.add((str(row._table), row.id))
|
|
580
580
|
elif isinstance(arg, TypedTable):
|
|
581
|
-
deps.add((str(arg._table),
|
|
581
|
+
deps.add((str(arg._table), arg.id))
|
|
582
582
|
|
|
583
583
|
# Generate cache key
|
|
584
584
|
_, hashed_key = create_and_hash_cache_key(key, *[getattr(arg, "id", None) for arg in args], kwargs)
|
|
@@ -226,7 +226,7 @@ def setup(
|
|
|
226
226
|
data.pop("connection", None)
|
|
227
227
|
|
|
228
228
|
# ignore any None:
|
|
229
|
-
old_contents["tool"]["typedal"] = {k: v for k, v in data.items() if v is not None}
|
|
229
|
+
old_contents["tool"]["typedal"] = {k: v for k, v in data.items() if v is not None} # type: ignore
|
|
230
230
|
|
|
231
231
|
with toml_path.open("w") as f:
|
|
232
232
|
tomlkit.dump(old_contents, f)
|
|
@@ -873,7 +873,9 @@ class QueryBuilder[T_MetaInstance: _TypedTable](pydal.objects.Select):
|
|
|
873
873
|
def _select_distinct_ids_with_orderby_fields(self, query: Query, select_kwargs: SelectKwargs) -> str:
|
|
874
874
|
db = self._get_db()
|
|
875
875
|
model = self.model
|
|
876
|
-
|
|
876
|
+
id_field = t.cast(TypedField[int], model.id)
|
|
877
|
+
|
|
878
|
+
select_args: list[OrderBy] = [id_field]
|
|
877
879
|
seen = {str(model.id)}
|
|
878
880
|
|
|
879
881
|
for field in self._selectable_orderby_fields(select_kwargs.get("orderby")):
|
|
@@ -883,7 +885,7 @@ class QueryBuilder[T_MetaInstance: _TypedTable](pydal.objects.Select):
|
|
|
883
885
|
seen.add(key)
|
|
884
886
|
|
|
885
887
|
ids = db(query)._select(*select_args, **select_kwargs).rstrip(";")
|
|
886
|
-
id_column = getattr(model.id, "_raw_rname",
|
|
888
|
+
id_column = getattr(model.id, "_raw_rname", id_field.name)
|
|
887
889
|
return f'SELECT "{id_column}" FROM ({ids}) AS typedal_paginate_ids' # nosec:
|
|
888
890
|
# id_column originates from code
|
|
889
891
|
# ids is a safe subquery, originating from code
|
|
@@ -914,7 +916,9 @@ class QueryBuilder[T_MetaInstance: _TypedTable](pydal.objects.Select):
|
|
|
914
916
|
else:
|
|
915
917
|
ids = db(query)._select(model.id, **kwargs)
|
|
916
918
|
|
|
917
|
-
|
|
919
|
+
id_field = t.cast(TypedField[int], model.id)
|
|
920
|
+
|
|
921
|
+
query = id_field.belongs(ids)
|
|
918
922
|
metadata["ids"] = ids
|
|
919
923
|
|
|
920
924
|
return query
|
|
@@ -1455,6 +1459,18 @@ class QueryBuilder[T_MetaInstance: _TypedTable](pydal.objects.Select):
|
|
|
1455
1459
|
"""
|
|
1456
1460
|
return await self.collect_async() or throw(exception or ValueError("Nothing found!"))
|
|
1457
1461
|
|
|
1462
|
+
@t.overload
|
|
1463
|
+
async def column_async[T: t.Any](self, field: TypedField[T], **options: t.Unpack[SelectKwargs]) -> list[T]:
|
|
1464
|
+
"""
|
|
1465
|
+
Get all values in a typed field asynchronously.
|
|
1466
|
+
"""
|
|
1467
|
+
|
|
1468
|
+
@t.overload
|
|
1469
|
+
async def column_async[T: t.Any](self, field: T, **options: t.Unpack[SelectKwargs]) -> list[T]:
|
|
1470
|
+
"""
|
|
1471
|
+
Get all values in an untyped field asynchronously.
|
|
1472
|
+
"""
|
|
1473
|
+
|
|
1458
1474
|
async def column_async[T: t.Any](self, field: TypedField[T] | T, **options: t.Unpack[SelectKwargs]) -> list[T]:
|
|
1459
1475
|
"""
|
|
1460
1476
|
Async twin of `column()`.
|
|
@@ -96,6 +96,8 @@ class TableMeta(type):
|
|
|
96
96
|
|
|
97
97
|
"""
|
|
98
98
|
|
|
99
|
+
id: "TypedField[int]" # class access; instance access is declared on _TypedTable
|
|
100
|
+
|
|
99
101
|
# set up by db.define:
|
|
100
102
|
# _db: TypeDAL | None = None
|
|
101
103
|
# _table: Table | None = None
|
|
@@ -334,6 +336,26 @@ class TableMeta(type):
|
|
|
334
336
|
"""
|
|
335
337
|
return QueryBuilder(self).select(*a, **kw)
|
|
336
338
|
|
|
339
|
+
@t.overload
|
|
340
|
+
def column[T: t.Any, T_MetaInstance: _TypedTable](
|
|
341
|
+
self: t.Type[T_MetaInstance],
|
|
342
|
+
field: TypedField[T],
|
|
343
|
+
**options: t.Unpack[SelectKwargs],
|
|
344
|
+
) -> list[T]:
|
|
345
|
+
"""
|
|
346
|
+
Get all values in a typed field.
|
|
347
|
+
"""
|
|
348
|
+
|
|
349
|
+
@t.overload
|
|
350
|
+
def column[T: t.Any, T_MetaInstance: _TypedTable](
|
|
351
|
+
self: t.Type[T_MetaInstance],
|
|
352
|
+
field: T,
|
|
353
|
+
**options: t.Unpack[SelectKwargs],
|
|
354
|
+
) -> list[T]:
|
|
355
|
+
"""
|
|
356
|
+
Get all values in an untyped field.
|
|
357
|
+
"""
|
|
358
|
+
|
|
337
359
|
def column[T: t.Any, T_MetaInstance: _TypedTable](
|
|
338
360
|
self: t.Type[T_MetaInstance],
|
|
339
361
|
field: T | TypedField[T],
|
|
@@ -529,6 +551,26 @@ class TableMeta(type):
|
|
|
529
551
|
**fields,
|
|
530
552
|
)
|
|
531
553
|
|
|
554
|
+
@t.overload
|
|
555
|
+
async def column_async[T: t.Any, T_MetaInstance: _TypedTable](
|
|
556
|
+
self: t.Type[T_MetaInstance],
|
|
557
|
+
field: TypedField[T],
|
|
558
|
+
**options: t.Unpack[SelectKwargs],
|
|
559
|
+
) -> list[T]:
|
|
560
|
+
"""
|
|
561
|
+
Get all values in a typed field asynchronously.
|
|
562
|
+
"""
|
|
563
|
+
|
|
564
|
+
@t.overload
|
|
565
|
+
async def column_async[T: t.Any, T_MetaInstance: _TypedTable](
|
|
566
|
+
self: t.Type[T_MetaInstance],
|
|
567
|
+
field: T,
|
|
568
|
+
**options: t.Unpack[SelectKwargs],
|
|
569
|
+
) -> list[T]:
|
|
570
|
+
"""
|
|
571
|
+
Get all values in an untyped field asynchronously.
|
|
572
|
+
"""
|
|
573
|
+
|
|
532
574
|
async def column_async[T: t.Any, T_MetaInstance: _TypedTable](
|
|
533
575
|
self: t.Type[T_MetaInstance],
|
|
534
576
|
field: T | TypedField[T],
|
|
@@ -877,7 +919,7 @@ class _TypedTable(metaclass=TableMeta):
|
|
|
877
919
|
# This class contains weird typing glue to dodge MRO headaches without losing editor/mypy table methods
|
|
878
920
|
# you can safely ignore it when changing runtime behavior; touch it only for typing/mypy issues
|
|
879
921
|
|
|
880
|
-
id:
|
|
922
|
+
id: int # instance access; class access comes from TableMeta
|
|
881
923
|
|
|
882
924
|
_before_insert: list[t.Callable[[t.Self], t.Optional[bool]] | t.Callable[[OpRow], t.Optional[bool]]]
|
|
883
925
|
_after_insert: list[
|
|
@@ -1062,8 +1104,6 @@ class TypedTable(_TypedTable, metaclass=TableMeta):
|
|
|
1062
1104
|
_row: Row | None = None
|
|
1063
1105
|
_rows: tuple[Row, ...] = ()
|
|
1064
1106
|
|
|
1065
|
-
id: "TypedField[int]"
|
|
1066
|
-
|
|
1067
1107
|
_with: list[str]
|
|
1068
1108
|
|
|
1069
1109
|
@classproperty
|
typedal-5.0.0/.crush/.gitignore
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
*
|
typedal-5.0.0/.crush/init
DELETED
|
File without changes
|