TypeDAL 3.0.0b1__py3-none-any.whl → 3.0.0b3__py3-none-any.whl
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/__about__.py +1 -1
- typedal/cli.py +7 -4
- typedal/config.py +4 -10
- {typedal-3.0.0b1.dist-info → typedal-3.0.0b3.dist-info}/METADATA +2 -2
- {typedal-3.0.0b1.dist-info → typedal-3.0.0b3.dist-info}/RECORD +7 -7
- {typedal-3.0.0b1.dist-info → typedal-3.0.0b3.dist-info}/WHEEL +0 -0
- {typedal-3.0.0b1.dist-info → typedal-3.0.0b3.dist-info}/entry_points.txt +0 -0
typedal/__about__.py
CHANGED
typedal/cli.py
CHANGED
|
@@ -156,10 +156,6 @@ def setup(
|
|
|
156
156
|
# tomli has native Python types, tomlkit doesn't but preserves comments
|
|
157
157
|
toml_obj: AnyDict = tomli.loads(toml_contents)
|
|
158
158
|
|
|
159
|
-
if "[tool.typedal]" in toml_contents:
|
|
160
|
-
section = toml_obj["tool"]["typedal"]
|
|
161
|
-
config.update(**section, _overwrite=True)
|
|
162
|
-
|
|
163
159
|
if "[tool.pydal2sql]" in toml_contents:
|
|
164
160
|
mapping = {"": ""} # <- placeholder
|
|
165
161
|
|
|
@@ -176,6 +172,10 @@ def setup(
|
|
|
176
172
|
|
|
177
173
|
config.update(**extra_config)
|
|
178
174
|
|
|
175
|
+
if "[tool.typedal]" in toml_contents:
|
|
176
|
+
section = toml_obj["tool"]["typedal"]
|
|
177
|
+
config.update(**section, _overwrite=True)
|
|
178
|
+
|
|
179
179
|
data = asdict(config, with_top_level_key=False)
|
|
180
180
|
data["migrate"] = None # determined based on existence of input/output file.
|
|
181
181
|
|
|
@@ -257,6 +257,7 @@ def generate_migrations(
|
|
|
257
257
|
format=output_format,
|
|
258
258
|
input=filename_before,
|
|
259
259
|
output=output_file,
|
|
260
|
+
_skip_none=True,
|
|
260
261
|
)
|
|
261
262
|
|
|
262
263
|
if pydal2sql_config.output and Path(pydal2sql_config.output).exists():
|
|
@@ -334,6 +335,7 @@ def run_migrations(
|
|
|
334
335
|
create_flag_location=create_flag_location,
|
|
335
336
|
db_folder=db_folder,
|
|
336
337
|
migrations_file=migrations_file,
|
|
338
|
+
_skip_none=True,
|
|
337
339
|
)
|
|
338
340
|
|
|
339
341
|
if dry_run:
|
|
@@ -386,6 +388,7 @@ def fake_migrations(
|
|
|
386
388
|
migrate_table=migrate_table,
|
|
387
389
|
db_folder=db_folder,
|
|
388
390
|
migrations_file=migrations_file,
|
|
391
|
+
_skip_none=True,
|
|
389
392
|
)
|
|
390
393
|
|
|
391
394
|
migrations = edwh_migrate.list_migrations(migrate_config)
|
typedal/config.py
CHANGED
|
@@ -10,9 +10,9 @@ from collections import defaultdict
|
|
|
10
10
|
from pathlib import Path
|
|
11
11
|
from typing import Any, Optional
|
|
12
12
|
|
|
13
|
-
import black.files
|
|
14
13
|
import tomli
|
|
15
14
|
from configuraptor import TypedConfig, alias
|
|
15
|
+
from configuraptor.helpers import find_pyproject_toml
|
|
16
16
|
from dotenv import dotenv_values, find_dotenv
|
|
17
17
|
|
|
18
18
|
from .types import AnyDict
|
|
@@ -122,12 +122,6 @@ class TypeDALConfig(TypedConfig):
|
|
|
122
122
|
)
|
|
123
123
|
|
|
124
124
|
|
|
125
|
-
def find_pyproject_toml(directory: str | None = None) -> typing.Optional[str]:
|
|
126
|
-
"""
|
|
127
|
-
Find the project's config toml, looks up until it finds the project root (black's logic).
|
|
128
|
-
"""
|
|
129
|
-
return black.files.find_pyproject_toml((directory or os.getcwd(),))
|
|
130
|
-
|
|
131
125
|
|
|
132
126
|
def _load_toml(path: str | bool | None = True) -> tuple[str, AnyDict]:
|
|
133
127
|
"""
|
|
@@ -145,7 +139,7 @@ def _load_toml(path: str | bool | None = True) -> tuple[str, AnyDict]:
|
|
|
145
139
|
elif Path(str(path)).is_file():
|
|
146
140
|
toml_path = str(path)
|
|
147
141
|
else:
|
|
148
|
-
toml_path = find_pyproject_toml(
|
|
142
|
+
toml_path = find_pyproject_toml(path)
|
|
149
143
|
|
|
150
144
|
if not toml_path:
|
|
151
145
|
# nothing to load
|
|
@@ -155,10 +149,10 @@ def _load_toml(path: str | bool | None = True) -> tuple[str, AnyDict]:
|
|
|
155
149
|
with open(toml_path, "rb") as f:
|
|
156
150
|
data = tomli.load(f)
|
|
157
151
|
|
|
158
|
-
return toml_path or "", typing.cast(AnyDict, data["tool"]["typedal"])
|
|
152
|
+
return str(toml_path) or "", typing.cast(AnyDict, data["tool"]["typedal"])
|
|
159
153
|
except Exception as e:
|
|
160
154
|
warnings.warn(f"Could not load typedal config toml: {e}", source=e)
|
|
161
|
-
return toml_path or "", {}
|
|
155
|
+
return str(toml_path) or "", {}
|
|
162
156
|
|
|
163
157
|
|
|
164
158
|
def _load_dotenv(path: str | bool | None = True) -> tuple[str, AnyDict]:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: TypeDAL
|
|
3
|
-
Version: 3.0.
|
|
3
|
+
Version: 3.0.0b3
|
|
4
4
|
Summary: Typing support for PyDAL
|
|
5
5
|
Project-URL: Documentation, https://typedal.readthedocs.io/
|
|
6
6
|
Project-URL: Issues, https://github.com/trialandsuccess/TypeDAL/issues
|
|
@@ -16,7 +16,7 @@ Classifier: Programming Language :: Python :: Implementation :: CPython
|
|
|
16
16
|
Classifier: Programming Language :: Python :: Implementation :: PyPy
|
|
17
17
|
Requires-Python: >=3.10
|
|
18
18
|
Requires-Dist: configurable-json
|
|
19
|
-
Requires-Dist: configuraptor>=1.26.
|
|
19
|
+
Requires-Dist: configuraptor>=1.26.2
|
|
20
20
|
Requires-Dist: dill
|
|
21
21
|
Requires-Dist: pydal
|
|
22
22
|
Provides-Extra: all
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
typedal/__about__.py,sha256=
|
|
1
|
+
typedal/__about__.py,sha256=z4iEUmnb42f1UnaPUUgxVmozlPXkE5cI1pU9_rHHpqw,213
|
|
2
2
|
typedal/__init__.py,sha256=QQpLiVl9w9hm2LBxey49Y_tCF_VB2bScVaS_mCjYy54,366
|
|
3
3
|
typedal/caching.py,sha256=8UABVAhOlBpL96ykmqhxLaFYOe-XeAh7JoGh57OkxP8,11818
|
|
4
|
-
typedal/cli.py,sha256=
|
|
5
|
-
typedal/config.py,sha256=
|
|
4
|
+
typedal/cli.py,sha256=5-2U_pQOZNKHmhefiYtkd7g6B0DAXzjf4A1Jh7D37io,18427
|
|
5
|
+
typedal/config.py,sha256=KDJXRsIQuFpSZy5XpSJiC_9WGLlmaOexACW0sWdCw54,11626
|
|
6
6
|
typedal/core.py,sha256=qgJPvlcQYCujsjiiD6SOhWbIr1lxoUDpZUkMnK-mcDQ,95038
|
|
7
7
|
typedal/fields.py,sha256=z2PD9vLWqBR_zXtiY0DthqTG4AeF3yxKoeuVfGXnSdg,5197
|
|
8
8
|
typedal/for_py4web.py,sha256=d07b8hL_PvNDUS26Z5fDH2OxWb-IETBuAFPSzrRwm04,1285
|
|
@@ -12,7 +12,7 @@ typedal/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
|
12
12
|
typedal/types.py,sha256=1kGkNX6vfGg6ln84AG558C4Zx5ACRz-emrUTnuy-rRY,3410
|
|
13
13
|
typedal/web2py_py4web_shared.py,sha256=cEbjkK0WOS9Q0nTyZuQaJWffeP4bjrL79Bx0xGy_UOs,1504
|
|
14
14
|
typedal/serializers/as_json.py,sha256=ffo152W-sARYXym4BzwX709rrO2-QwKk2KunWY8RNl4,2229
|
|
15
|
-
typedal-3.0.
|
|
16
|
-
typedal-3.0.
|
|
17
|
-
typedal-3.0.
|
|
18
|
-
typedal-3.0.
|
|
15
|
+
typedal-3.0.0b3.dist-info/METADATA,sha256=iGCNeR9M9shZ95huWQwV1tepKZyEB2ryoljRoJSahMg,7761
|
|
16
|
+
typedal-3.0.0b3.dist-info/WHEEL,sha256=KGYbc1zXlYddvwxnNty23BeaKzh7YuoSIvIMO4jEhvw,87
|
|
17
|
+
typedal-3.0.0b3.dist-info/entry_points.txt,sha256=m1wqcc_10rHWPdlQ71zEkmJDADUAnZtn7Jac_6mbyUc,44
|
|
18
|
+
typedal-3.0.0b3.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|