half-orm-dev 1.0.0a24__tar.gz → 1.0.0a25__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.
- {half_orm_dev-1.0.0a24/half_orm_dev.egg-info → half_orm_dev-1.0.0a25}/PKG-INFO +1 -1
- {half_orm_dev-1.0.0a24 → half_orm_dev-1.0.0a25}/half_orm_dev/cli/commands/release.py +4 -0
- {half_orm_dev-1.0.0a24 → half_orm_dev-1.0.0a25}/half_orm_dev/modules.py +32 -22
- half_orm_dev-1.0.0a25/half_orm_dev/py.typed +0 -0
- {half_orm_dev-1.0.0a24 → half_orm_dev-1.0.0a25}/half_orm_dev/templates/module_template_1 +2 -0
- half_orm_dev-1.0.0a25/half_orm_dev/version.txt +1 -0
- {half_orm_dev-1.0.0a24 → half_orm_dev-1.0.0a25/half_orm_dev.egg-info}/PKG-INFO +1 -1
- {half_orm_dev-1.0.0a24 → half_orm_dev-1.0.0a25}/half_orm_dev.egg-info/SOURCES.txt +1 -0
- {half_orm_dev-1.0.0a24 → half_orm_dev-1.0.0a25}/pyproject.toml +1 -0
- half_orm_dev-1.0.0a24/half_orm_dev/version.txt +0 -1
- {half_orm_dev-1.0.0a24 → half_orm_dev-1.0.0a25}/AUTHORS +0 -0
- {half_orm_dev-1.0.0a24 → half_orm_dev-1.0.0a25}/LICENSE +0 -0
- {half_orm_dev-1.0.0a24 → half_orm_dev-1.0.0a25}/README.md +0 -0
- {half_orm_dev-1.0.0a24 → half_orm_dev-1.0.0a25}/half_orm_dev/__init__.py +0 -0
- {half_orm_dev-1.0.0a24 → half_orm_dev-1.0.0a25}/half_orm_dev/bootstrap_manager.py +0 -0
- {half_orm_dev-1.0.0a24 → half_orm_dev-1.0.0a25}/half_orm_dev/cli/__init__.py +0 -0
- {half_orm_dev-1.0.0a24 → half_orm_dev-1.0.0a25}/half_orm_dev/cli/commands/__init__.py +0 -0
- {half_orm_dev-1.0.0a24 → half_orm_dev-1.0.0a25}/half_orm_dev/cli/commands/apply.py +0 -0
- {half_orm_dev-1.0.0a24 → half_orm_dev-1.0.0a25}/half_orm_dev/cli/commands/bootstrap.py +0 -0
- {half_orm_dev-1.0.0a24 → half_orm_dev-1.0.0a25}/half_orm_dev/cli/commands/check.py +0 -0
- {half_orm_dev-1.0.0a24 → half_orm_dev-1.0.0a25}/half_orm_dev/cli/commands/clone.py +0 -0
- {half_orm_dev-1.0.0a24 → half_orm_dev-1.0.0a25}/half_orm_dev/cli/commands/init.py +0 -0
- {half_orm_dev-1.0.0a24 → half_orm_dev-1.0.0a25}/half_orm_dev/cli/commands/migrate.py +0 -0
- {half_orm_dev-1.0.0a24 → half_orm_dev-1.0.0a25}/half_orm_dev/cli/commands/patch.py +0 -0
- {half_orm_dev-1.0.0a24 → half_orm_dev-1.0.0a25}/half_orm_dev/cli/commands/restore.py +0 -0
- {half_orm_dev-1.0.0a24 → half_orm_dev-1.0.0a25}/half_orm_dev/cli/commands/revert_migration.py +0 -0
- {half_orm_dev-1.0.0a24 → half_orm_dev-1.0.0a25}/half_orm_dev/cli/commands/set_git_origin.py +0 -0
- {half_orm_dev-1.0.0a24 → half_orm_dev-1.0.0a25}/half_orm_dev/cli/commands/sync.py +0 -0
- {half_orm_dev-1.0.0a24 → half_orm_dev-1.0.0a25}/half_orm_dev/cli/commands/todo.py +0 -0
- {half_orm_dev-1.0.0a24 → half_orm_dev-1.0.0a25}/half_orm_dev/cli/commands/undo.py +0 -0
- {half_orm_dev-1.0.0a24 → half_orm_dev-1.0.0a25}/half_orm_dev/cli/commands/update.py +0 -0
- {half_orm_dev-1.0.0a24 → half_orm_dev-1.0.0a25}/half_orm_dev/cli/commands/upgrade.py +0 -0
- {half_orm_dev-1.0.0a24 → half_orm_dev-1.0.0a25}/half_orm_dev/cli/main.py +0 -0
- {half_orm_dev-1.0.0a24 → half_orm_dev-1.0.0a25}/half_orm_dev/cli_extension.py +0 -0
- {half_orm_dev-1.0.0a24 → half_orm_dev-1.0.0a25}/half_orm_dev/database.py +0 -0
- {half_orm_dev-1.0.0a24 → half_orm_dev-1.0.0a25}/half_orm_dev/decorators.py +0 -0
- {half_orm_dev-1.0.0a24 → half_orm_dev-1.0.0a25}/half_orm_dev/file_executor.py +0 -0
- {half_orm_dev-1.0.0a24 → half_orm_dev-1.0.0a25}/half_orm_dev/hgit.py +0 -0
- {half_orm_dev-1.0.0a24 → half_orm_dev-1.0.0a25}/half_orm_dev/migration_manager.py +0 -0
- {half_orm_dev-1.0.0a24 → half_orm_dev-1.0.0a25}/half_orm_dev/migrations/0/17/1/00_move_to_hop.py +0 -0
- {half_orm_dev-1.0.0a24 → half_orm_dev-1.0.0a25}/half_orm_dev/migrations/0/17/1/01_txt_to_toml.py +0 -0
- {half_orm_dev-1.0.0a24 → half_orm_dev-1.0.0a25}/half_orm_dev/migrations/0/17/4/00_toml_dict_format.py +0 -0
- {half_orm_dev-1.0.0a24 → half_orm_dev-1.0.0a25}/half_orm_dev/migrations/0/17/4/01_add_bootstrap_table.py +0 -0
- {half_orm_dev-1.0.0a24 → half_orm_dev-1.0.0a25}/half_orm_dev/migrations/0/17/4/02_move_patches_to_subdirs.py +0 -0
- {half_orm_dev-1.0.0a24 → half_orm_dev-1.0.0a25}/half_orm_dev/migrations/0/17/5/01_update_pyproject_dependency.py +0 -0
- {half_orm_dev-1.0.0a24 → half_orm_dev-1.0.0a25}/half_orm_dev/migrations/0/18/0/00_add_async_support.py +0 -0
- {half_orm_dev-1.0.0a24 → half_orm_dev-1.0.0a25}/half_orm_dev/migrations/0/18/0/01_update_default_tests.py +0 -0
- {half_orm_dev-1.0.0a24 → half_orm_dev-1.0.0a25}/half_orm_dev/migrations/1/0/0/a20/01_update_gitignore.py +0 -0
- {half_orm_dev-1.0.0a24 → half_orm_dev-1.0.0a25}/half_orm_dev/migrations/hop/BREAKING_CHANGES-1.0.0.md +0 -0
- {half_orm_dev-1.0.0a24 → half_orm_dev-1.0.0a25}/half_orm_dev/patch_manager.py +0 -0
- {half_orm_dev-1.0.0a24 → half_orm_dev-1.0.0a25}/half_orm_dev/patch_validator.py +0 -0
- {half_orm_dev-1.0.0a24 → half_orm_dev-1.0.0a25}/half_orm_dev/patches/0/1/0/00_half_orm_meta.database.sql +0 -0
- {half_orm_dev-1.0.0a24 → half_orm_dev-1.0.0a25}/half_orm_dev/patches/0/1/0/01_alter_half_orm_meta.hop_release.sql +0 -0
- {half_orm_dev-1.0.0a24 → half_orm_dev-1.0.0a25}/half_orm_dev/patches/0/1/0/02_half_orm_meta.view.hop_penultimate_release.sql +0 -0
- {half_orm_dev-1.0.0a24 → half_orm_dev-1.0.0a25}/half_orm_dev/patches/log +0 -0
- {half_orm_dev-1.0.0a24 → half_orm_dev-1.0.0a25}/half_orm_dev/patches/sql/half_orm_meta.sql +0 -0
- {half_orm_dev-1.0.0a24 → half_orm_dev-1.0.0a25}/half_orm_dev/release_file.py +0 -0
- {half_orm_dev-1.0.0a24 → half_orm_dev-1.0.0a25}/half_orm_dev/release_manager.py +0 -0
- {half_orm_dev-1.0.0a24 → half_orm_dev-1.0.0a25}/half_orm_dev/repo.py +0 -0
- {half_orm_dev-1.0.0a24 → half_orm_dev-1.0.0a25}/half_orm_dev/scripts/repair-metadata.py +0 -0
- {half_orm_dev-1.0.0a24 → half_orm_dev-1.0.0a25}/half_orm_dev/templates/.gitignore +0 -0
- {half_orm_dev-1.0.0a24 → half_orm_dev-1.0.0a25}/half_orm_dev/templates/MANIFEST.in +0 -0
- {half_orm_dev-1.0.0a24 → half_orm_dev-1.0.0a25}/half_orm_dev/templates/README +0 -0
- {half_orm_dev-1.0.0a24 → half_orm_dev-1.0.0a25}/half_orm_dev/templates/conftest_template +0 -0
- {half_orm_dev-1.0.0a24 → half_orm_dev-1.0.0a25}/half_orm_dev/templates/git-hooks/pre-commit +0 -0
- {half_orm_dev-1.0.0a24 → half_orm_dev-1.0.0a25}/half_orm_dev/templates/git-hooks/pre-push +0 -0
- {half_orm_dev-1.0.0a24 → half_orm_dev-1.0.0a25}/half_orm_dev/templates/git-hooks/prepare-commit-msg +0 -0
- {half_orm_dev-1.0.0a24 → half_orm_dev-1.0.0a25}/half_orm_dev/templates/git-hooks/reference-transaction +0 -0
- {half_orm_dev-1.0.0a24 → half_orm_dev-1.0.0a25}/half_orm_dev/templates/init_module_template +0 -0
- {half_orm_dev-1.0.0a24 → half_orm_dev-1.0.0a25}/half_orm_dev/templates/module_template_2 +0 -0
- {half_orm_dev-1.0.0a24 → half_orm_dev-1.0.0a25}/half_orm_dev/templates/module_template_3 +0 -0
- {half_orm_dev-1.0.0a24 → half_orm_dev-1.0.0a25}/half_orm_dev/templates/pyproject.toml +0 -0
- {half_orm_dev-1.0.0a24 → half_orm_dev-1.0.0a25}/half_orm_dev/templates/relation_test +0 -0
- {half_orm_dev-1.0.0a24 → half_orm_dev-1.0.0a25}/half_orm_dev/templates/sql_adapter +0 -0
- {half_orm_dev-1.0.0a24 → half_orm_dev-1.0.0a25}/half_orm_dev/templates/warning +0 -0
- {half_orm_dev-1.0.0a24 → half_orm_dev-1.0.0a25}/half_orm_dev/utils.py +0 -0
- {half_orm_dev-1.0.0a24 → half_orm_dev-1.0.0a25}/half_orm_dev.egg-info/dependency_links.txt +0 -0
- {half_orm_dev-1.0.0a24 → half_orm_dev-1.0.0a25}/half_orm_dev.egg-info/entry_points.txt +0 -0
- {half_orm_dev-1.0.0a24 → half_orm_dev-1.0.0a25}/half_orm_dev.egg-info/requires.txt +0 -0
- {half_orm_dev-1.0.0a24 → half_orm_dev-1.0.0a25}/half_orm_dev.egg-info/top_level.txt +0 -0
- {half_orm_dev-1.0.0a24 → half_orm_dev-1.0.0a25}/setup.cfg +0 -0
- {half_orm_dev-1.0.0a24 → half_orm_dev-1.0.0a25}/setup.py +0 -0
|
@@ -526,6 +526,10 @@ def release_attach_patch(patch_id: str, force: bool) -> None:
|
|
|
526
526
|
|
|
527
527
|
version = current_branch.replace('ho-release/', '')
|
|
528
528
|
|
|
529
|
+
# Accept full branch name or short patch ID
|
|
530
|
+
if patch_id.startswith('ho-patch/'):
|
|
531
|
+
patch_id = patch_id[len('ho-patch/'):]
|
|
532
|
+
|
|
529
533
|
# Confirmation
|
|
530
534
|
if not force:
|
|
531
535
|
click.echo(f"Attaching patch '{patch_id}' to release {version}")
|
|
@@ -173,9 +173,11 @@ def __get_field_desc(field_name, field):
|
|
|
173
173
|
field_desc = f'{field_desc.__module__}.{ext}'
|
|
174
174
|
else:
|
|
175
175
|
field_desc = field_desc.__name__
|
|
176
|
-
value = 'dataclasses.field(default=None)'
|
|
177
176
|
if field._metadata['fieldtype'][0] == '_':
|
|
178
177
|
value = 'dataclasses.field(default_factory=list)'
|
|
178
|
+
else:
|
|
179
|
+
value = 'dataclasses.field(default=None)'
|
|
180
|
+
field_desc = f'Optional[{field_desc}]'
|
|
179
181
|
field_desc = f'{field_desc} = {value}'
|
|
180
182
|
field_desc = f" {field_name}: {field_desc}"
|
|
181
183
|
error = utils.check_attribute_name(field_name)
|
|
@@ -188,10 +190,10 @@ def __gen_dataclass(relation, fkeys):
|
|
|
188
190
|
rel = relation()
|
|
189
191
|
dc_name = relation._ho_dataclass_name()
|
|
190
192
|
fields = []
|
|
191
|
-
post_init = [' def __post_init__(self):']
|
|
193
|
+
post_init = [' def __post_init__(self) -> None:']
|
|
192
194
|
for field_name, field in rel._ho_fields.items():
|
|
193
195
|
fields.append(__get_field_desc(field_name, field))
|
|
194
|
-
post_init.append(f' self.{field_name}: Field = None')
|
|
196
|
+
post_init.append(f' self.{field_name}: Optional[Field] = None')
|
|
195
197
|
|
|
196
198
|
# Invert user-defined aliases: constraint_name → alias
|
|
197
199
|
aliases = {constraint: alias for alias, constraint in fkeys.items() if alias != ''}
|
|
@@ -518,15 +520,22 @@ def __update_this_module(
|
|
|
518
520
|
fields = []
|
|
519
521
|
kwargs = []
|
|
520
522
|
arg_names = []
|
|
523
|
+
type_import_modules: set = set()
|
|
521
524
|
for key, value in rel._ho_fields.items():
|
|
522
525
|
error = utils.check_attribute_name(key)
|
|
523
526
|
if not error:
|
|
524
527
|
fields.append(f"self.{key}: Field = None")
|
|
525
528
|
kwarg_type = 'typing.Any'
|
|
526
529
|
if hasattr(value.py_type, '__name__'):
|
|
527
|
-
|
|
528
|
-
|
|
530
|
+
mod = getattr(value.py_type, '__module__', 'builtins')
|
|
531
|
+
if mod and mod != 'builtins':
|
|
532
|
+
type_import_modules.add(mod)
|
|
533
|
+
kwarg_type = f'{mod}.{value.py_type.__name__}'
|
|
534
|
+
else:
|
|
535
|
+
kwarg_type = str(value.py_type.__name__)
|
|
536
|
+
kwargs.append(f"{key}: 'typing.Optional[{kwarg_type}]'=None")
|
|
529
537
|
arg_names.append(f'{key}={key}')
|
|
538
|
+
type_imports = '\n'.join(f'import {m}' for m in sorted(type_import_modules))
|
|
530
539
|
fields = "\n ".join(fields)
|
|
531
540
|
kwargs.append('**kwargs')
|
|
532
541
|
kwargs = ", ".join(kwargs)
|
|
@@ -575,6 +584,7 @@ def __update_this_module(
|
|
|
575
584
|
fqtn=fqtn,
|
|
576
585
|
kwargs=kwargs,
|
|
577
586
|
arg_names=arg_names,
|
|
587
|
+
type_imports=type_imports,
|
|
578
588
|
warning=WARNING_TEMPLATE.format(package_name=package_name)))
|
|
579
589
|
|
|
580
590
|
# Generate test file in tests/ directory structure
|
|
@@ -641,7 +651,7 @@ def __gen_dc_relation() -> tuple:
|
|
|
641
651
|
if is_classmethod:
|
|
642
652
|
block.append(' @classmethod')
|
|
643
653
|
prefix = ' async def' if is_async else ' def'
|
|
644
|
-
block.append(f'{prefix} {name}{sig_str}:')
|
|
654
|
+
block.append(f'{prefix} {name}{sig_str}: # type: ignore[empty-body]')
|
|
645
655
|
if doc:
|
|
646
656
|
block.append(_fmt_doc(doc))
|
|
647
657
|
block.append(' ...')
|
|
@@ -670,29 +680,29 @@ def __gen_baseclass(relation, fkeys) -> str:
|
|
|
670
680
|
|
|
671
681
|
lines = [
|
|
672
682
|
f"class {bc_name}(",
|
|
673
|
-
f" MODEL.get_relation_class('{fqtn}', fields_aliases=None),",
|
|
683
|
+
f" MODEL.get_relation_class('{fqtn}', fields_aliases=None), # type: ignore[misc]",
|
|
674
684
|
f" {dc_name}",
|
|
675
685
|
f"):",
|
|
676
686
|
f" def __iter__(self) -> Iterator[{d}]:",
|
|
677
|
-
f" return super().__iter__()",
|
|
687
|
+
f" return super().__iter__() # type: ignore[return-value]",
|
|
678
688
|
f"",
|
|
679
|
-
f" def ho_select(self, *args, distinct: bool = False, order_by: str = None, limit: int = None, offset: int = None, json_agg=None) -> Iterator[{d}]:",
|
|
680
|
-
f" return super().ho_select(*args, distinct=distinct, order_by=order_by, limit=limit, offset=offset, json_agg=json_agg)",
|
|
689
|
+
f" def ho_select(self, *args, distinct: bool = False, order_by: Optional[str] = None, limit: Optional[int] = None, offset: Optional[int] = None, json_agg=None) -> Iterator[{d}]:",
|
|
690
|
+
f" return super().ho_select(*args, distinct=distinct, order_by=order_by, limit=limit, offset=offset, json_agg=json_agg) # type: ignore[return-value]",
|
|
681
691
|
f"",
|
|
682
|
-
f" def ho_get(self, *args) -> {d}:",
|
|
683
|
-
f" return super().ho_get(*args)",
|
|
692
|
+
f" def ho_get(self, *args) -> {d}: # type: ignore[override]",
|
|
693
|
+
f" return super().ho_get(*args) # type: ignore[return-value]",
|
|
684
694
|
f"",
|
|
685
|
-
f" def ho_insert(self, *args, upsert: Optional[bool] = False) -> {d}:",
|
|
686
|
-
f" return super().ho_insert(*args, upsert=upsert)",
|
|
695
|
+
f" def ho_insert(self, *args, upsert: Optional[bool] = False) -> {d}: # type: ignore[override]",
|
|
696
|
+
f" return super().ho_insert(*args, upsert=upsert) # type: ignore[return-value]",
|
|
687
697
|
f"",
|
|
688
|
-
f" async def ho_aselect(self, *args, distinct: bool = False, order_by: str = None, limit: int = None, offset: int = None) -> List[{d}]:",
|
|
689
|
-
f" return await super().ho_aselect(*args, distinct=distinct, order_by=order_by, limit=limit, offset=offset)",
|
|
698
|
+
f" async def ho_aselect(self, *args, distinct: bool = False, order_by: Optional[str] = None, limit: Optional[int] = None, offset: Optional[int] = None) -> List[{d}]:",
|
|
699
|
+
f" return await super().ho_aselect(*args, distinct=distinct, order_by=order_by, limit=limit, offset=offset) # type: ignore[return-value]",
|
|
690
700
|
f"",
|
|
691
|
-
f" async def ho_aget(self, *args) -> {d}:",
|
|
692
|
-
f" return await super().ho_aget(*args)",
|
|
701
|
+
f" async def ho_aget(self, *args) -> {d}: # type: ignore[override]",
|
|
702
|
+
f" return await super().ho_aget(*args) # type: ignore[return-value]",
|
|
693
703
|
f"",
|
|
694
|
-
f" async def ho_ainsert(self, *args, upsert: bool = False) -> {d}:",
|
|
695
|
-
f" return await super().ho_ainsert(*args, upsert=upsert)",
|
|
704
|
+
f" async def ho_ainsert(self, *args, upsert: bool = False) -> {d}: # type: ignore[override]",
|
|
705
|
+
f" return await super().ho_ainsert(*args, upsert=upsert) # type: ignore[return-value]",
|
|
696
706
|
]
|
|
697
707
|
return '\n'.join(lines)
|
|
698
708
|
|
|
@@ -716,10 +726,10 @@ def __gen_baseclasses(package_dir, package_name):
|
|
|
716
726
|
typing_names = sorted(dc_typing | {'Iterator', 'List', 'Optional', 'TYPE_CHECKING'})
|
|
717
727
|
file_.write(f"from typing import {', '.join(typing_names)}\n")
|
|
718
728
|
file_.write("import dataclasses\n")
|
|
719
|
-
file_.write("from half_orm.field import Field\n")
|
|
729
|
+
file_.write("from half_orm.field import Field # type: ignore[import-not-found]\n")
|
|
720
730
|
for mod in sorted(HO_DATACLASSES_IMPORTS):
|
|
721
731
|
file_.write(f"import {mod}\n")
|
|
722
|
-
file_.write(f"from {package_name} import MODEL\n")
|
|
732
|
+
file_.write(f"from {package_name} import MODEL # type: ignore[import-not-found]\n")
|
|
723
733
|
if HO_BASECLASSES_DICT_NAMES:
|
|
724
734
|
file_.write("if TYPE_CHECKING:\n")
|
|
725
735
|
file_.write(f" from {package_name}.ho_typeddicts import (\n")
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
1.0.0-a25
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
1.0.0-a24
|
|
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
|
{half_orm_dev-1.0.0a24 → half_orm_dev-1.0.0a25}/half_orm_dev/cli/commands/revert_migration.py
RENAMED
|
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
|
{half_orm_dev-1.0.0a24 → half_orm_dev-1.0.0a25}/half_orm_dev/migrations/0/17/1/00_move_to_hop.py
RENAMED
|
File without changes
|
{half_orm_dev-1.0.0a24 → half_orm_dev-1.0.0a25}/half_orm_dev/migrations/0/17/1/01_txt_to_toml.py
RENAMED
|
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
|
{half_orm_dev-1.0.0a24 → half_orm_dev-1.0.0a25}/half_orm_dev/templates/git-hooks/prepare-commit-msg
RENAMED
|
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
|