half-orm-dev 1.0.0a9__tar.gz → 1.0.0a10__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.0a9/half_orm_dev.egg-info → half_orm_dev-1.0.0a10}/PKG-INFO +1 -1
- {half_orm_dev-1.0.0a9 → half_orm_dev-1.0.0a10}/half_orm_dev/modules.py +37 -1
- half_orm_dev-1.0.0a10/half_orm_dev/version.txt +1 -0
- {half_orm_dev-1.0.0a9 → half_orm_dev-1.0.0a10/half_orm_dev.egg-info}/PKG-INFO +1 -1
- half_orm_dev-1.0.0a9/half_orm_dev/version.txt +0 -1
- {half_orm_dev-1.0.0a9 → half_orm_dev-1.0.0a10}/AUTHORS +0 -0
- {half_orm_dev-1.0.0a9 → half_orm_dev-1.0.0a10}/LICENSE +0 -0
- {half_orm_dev-1.0.0a9 → half_orm_dev-1.0.0a10}/README.md +0 -0
- {half_orm_dev-1.0.0a9 → half_orm_dev-1.0.0a10}/half_orm_dev/__init__.py +0 -0
- {half_orm_dev-1.0.0a9 → half_orm_dev-1.0.0a10}/half_orm_dev/bootstrap_manager.py +0 -0
- {half_orm_dev-1.0.0a9 → half_orm_dev-1.0.0a10}/half_orm_dev/cli/__init__.py +0 -0
- {half_orm_dev-1.0.0a9 → half_orm_dev-1.0.0a10}/half_orm_dev/cli/commands/__init__.py +0 -0
- {half_orm_dev-1.0.0a9 → half_orm_dev-1.0.0a10}/half_orm_dev/cli/commands/apply.py +0 -0
- {half_orm_dev-1.0.0a9 → half_orm_dev-1.0.0a10}/half_orm_dev/cli/commands/bootstrap.py +0 -0
- {half_orm_dev-1.0.0a9 → half_orm_dev-1.0.0a10}/half_orm_dev/cli/commands/check.py +0 -0
- {half_orm_dev-1.0.0a9 → half_orm_dev-1.0.0a10}/half_orm_dev/cli/commands/clone.py +0 -0
- {half_orm_dev-1.0.0a9 → half_orm_dev-1.0.0a10}/half_orm_dev/cli/commands/init.py +0 -0
- {half_orm_dev-1.0.0a9 → half_orm_dev-1.0.0a10}/half_orm_dev/cli/commands/migrate.py +0 -0
- {half_orm_dev-1.0.0a9 → half_orm_dev-1.0.0a10}/half_orm_dev/cli/commands/patch.py +0 -0
- {half_orm_dev-1.0.0a9 → half_orm_dev-1.0.0a10}/half_orm_dev/cli/commands/release.py +0 -0
- {half_orm_dev-1.0.0a9 → half_orm_dev-1.0.0a10}/half_orm_dev/cli/commands/restore.py +0 -0
- {half_orm_dev-1.0.0a9 → half_orm_dev-1.0.0a10}/half_orm_dev/cli/commands/revert_migration.py +0 -0
- {half_orm_dev-1.0.0a9 → half_orm_dev-1.0.0a10}/half_orm_dev/cli/commands/set_git_origin.py +0 -0
- {half_orm_dev-1.0.0a9 → half_orm_dev-1.0.0a10}/half_orm_dev/cli/commands/sync.py +0 -0
- {half_orm_dev-1.0.0a9 → half_orm_dev-1.0.0a10}/half_orm_dev/cli/commands/todo.py +0 -0
- {half_orm_dev-1.0.0a9 → half_orm_dev-1.0.0a10}/half_orm_dev/cli/commands/undo.py +0 -0
- {half_orm_dev-1.0.0a9 → half_orm_dev-1.0.0a10}/half_orm_dev/cli/commands/update.py +0 -0
- {half_orm_dev-1.0.0a9 → half_orm_dev-1.0.0a10}/half_orm_dev/cli/commands/upgrade.py +0 -0
- {half_orm_dev-1.0.0a9 → half_orm_dev-1.0.0a10}/half_orm_dev/cli/main.py +0 -0
- {half_orm_dev-1.0.0a9 → half_orm_dev-1.0.0a10}/half_orm_dev/cli_extension.py +0 -0
- {half_orm_dev-1.0.0a9 → half_orm_dev-1.0.0a10}/half_orm_dev/database.py +0 -0
- {half_orm_dev-1.0.0a9 → half_orm_dev-1.0.0a10}/half_orm_dev/decorators.py +0 -0
- {half_orm_dev-1.0.0a9 → half_orm_dev-1.0.0a10}/half_orm_dev/file_executor.py +0 -0
- {half_orm_dev-1.0.0a9 → half_orm_dev-1.0.0a10}/half_orm_dev/hgit.py +0 -0
- {half_orm_dev-1.0.0a9 → half_orm_dev-1.0.0a10}/half_orm_dev/migration_manager.py +0 -0
- {half_orm_dev-1.0.0a9 → half_orm_dev-1.0.0a10}/half_orm_dev/migrations/0/17/1/00_move_to_hop.py +0 -0
- {half_orm_dev-1.0.0a9 → half_orm_dev-1.0.0a10}/half_orm_dev/migrations/0/17/1/01_txt_to_toml.py +0 -0
- {half_orm_dev-1.0.0a9 → half_orm_dev-1.0.0a10}/half_orm_dev/migrations/0/17/4/00_toml_dict_format.py +0 -0
- {half_orm_dev-1.0.0a9 → half_orm_dev-1.0.0a10}/half_orm_dev/migrations/0/17/4/01_add_bootstrap_table.py +0 -0
- {half_orm_dev-1.0.0a9 → half_orm_dev-1.0.0a10}/half_orm_dev/migrations/0/17/4/02_move_patches_to_subdirs.py +0 -0
- {half_orm_dev-1.0.0a9 → half_orm_dev-1.0.0a10}/half_orm_dev/migrations/0/17/5/01_update_pyproject_dependency.py +0 -0
- {half_orm_dev-1.0.0a9 → half_orm_dev-1.0.0a10}/half_orm_dev/migrations/0/18/0/00_add_async_support.py +0 -0
- {half_orm_dev-1.0.0a9 → half_orm_dev-1.0.0a10}/half_orm_dev/migrations/0/18/0/01_update_default_tests.py +0 -0
- {half_orm_dev-1.0.0a9 → half_orm_dev-1.0.0a10}/half_orm_dev/migrations/hop/BREAKING_CHANGES-1.0.0.md +0 -0
- {half_orm_dev-1.0.0a9 → half_orm_dev-1.0.0a10}/half_orm_dev/patch_manager.py +0 -0
- {half_orm_dev-1.0.0a9 → half_orm_dev-1.0.0a10}/half_orm_dev/patch_validator.py +0 -0
- {half_orm_dev-1.0.0a9 → half_orm_dev-1.0.0a10}/half_orm_dev/patches/0/1/0/00_half_orm_meta.database.sql +0 -0
- {half_orm_dev-1.0.0a9 → half_orm_dev-1.0.0a10}/half_orm_dev/patches/0/1/0/01_alter_half_orm_meta.hop_release.sql +0 -0
- {half_orm_dev-1.0.0a9 → half_orm_dev-1.0.0a10}/half_orm_dev/patches/0/1/0/02_half_orm_meta.view.hop_penultimate_release.sql +0 -0
- {half_orm_dev-1.0.0a9 → half_orm_dev-1.0.0a10}/half_orm_dev/patches/log +0 -0
- {half_orm_dev-1.0.0a9 → half_orm_dev-1.0.0a10}/half_orm_dev/patches/sql/half_orm_meta.sql +0 -0
- {half_orm_dev-1.0.0a9 → half_orm_dev-1.0.0a10}/half_orm_dev/release_file.py +0 -0
- {half_orm_dev-1.0.0a9 → half_orm_dev-1.0.0a10}/half_orm_dev/release_manager.py +0 -0
- {half_orm_dev-1.0.0a9 → half_orm_dev-1.0.0a10}/half_orm_dev/repo.py +0 -0
- {half_orm_dev-1.0.0a9 → half_orm_dev-1.0.0a10}/half_orm_dev/scripts/repair-metadata.py +0 -0
- {half_orm_dev-1.0.0a9 → half_orm_dev-1.0.0a10}/half_orm_dev/templates/.gitignore +0 -0
- {half_orm_dev-1.0.0a9 → half_orm_dev-1.0.0a10}/half_orm_dev/templates/MANIFEST.in +0 -0
- {half_orm_dev-1.0.0a9 → half_orm_dev-1.0.0a10}/half_orm_dev/templates/README +0 -0
- {half_orm_dev-1.0.0a9 → half_orm_dev-1.0.0a10}/half_orm_dev/templates/conftest_template +0 -0
- {half_orm_dev-1.0.0a9 → half_orm_dev-1.0.0a10}/half_orm_dev/templates/git-hooks/pre-commit +0 -0
- {half_orm_dev-1.0.0a9 → half_orm_dev-1.0.0a10}/half_orm_dev/templates/git-hooks/prepare-commit-msg +0 -0
- {half_orm_dev-1.0.0a9 → half_orm_dev-1.0.0a10}/half_orm_dev/templates/init_module_template +0 -0
- {half_orm_dev-1.0.0a9 → half_orm_dev-1.0.0a10}/half_orm_dev/templates/module_stub_template +0 -0
- {half_orm_dev-1.0.0a9 → half_orm_dev-1.0.0a10}/half_orm_dev/templates/module_template_1 +0 -0
- {half_orm_dev-1.0.0a9 → half_orm_dev-1.0.0a10}/half_orm_dev/templates/module_template_2 +0 -0
- {half_orm_dev-1.0.0a9 → half_orm_dev-1.0.0a10}/half_orm_dev/templates/module_template_3 +0 -0
- {half_orm_dev-1.0.0a9 → half_orm_dev-1.0.0a10}/half_orm_dev/templates/pyproject.toml +0 -0
- {half_orm_dev-1.0.0a9 → half_orm_dev-1.0.0a10}/half_orm_dev/templates/relation_test +0 -0
- {half_orm_dev-1.0.0a9 → half_orm_dev-1.0.0a10}/half_orm_dev/templates/sql_adapter +0 -0
- {half_orm_dev-1.0.0a9 → half_orm_dev-1.0.0a10}/half_orm_dev/templates/warning +0 -0
- {half_orm_dev-1.0.0a9 → half_orm_dev-1.0.0a10}/half_orm_dev/utils.py +0 -0
- {half_orm_dev-1.0.0a9 → half_orm_dev-1.0.0a10}/half_orm_dev.egg-info/SOURCES.txt +0 -0
- {half_orm_dev-1.0.0a9 → half_orm_dev-1.0.0a10}/half_orm_dev.egg-info/dependency_links.txt +0 -0
- {half_orm_dev-1.0.0a9 → half_orm_dev-1.0.0a10}/half_orm_dev.egg-info/entry_points.txt +0 -0
- {half_orm_dev-1.0.0a9 → half_orm_dev-1.0.0a10}/half_orm_dev.egg-info/requires.txt +0 -0
- {half_orm_dev-1.0.0a9 → half_orm_dev-1.0.0a10}/half_orm_dev.egg-info/top_level.txt +0 -0
- {half_orm_dev-1.0.0a9 → half_orm_dev-1.0.0a10}/pyproject.toml +0 -0
- {half_orm_dev-1.0.0a9 → half_orm_dev-1.0.0a10}/setup.cfg +0 -0
- {half_orm_dev-1.0.0a9 → half_orm_dev-1.0.0a10}/setup.py +0 -0
|
@@ -435,6 +435,41 @@ def __get_fkeys(repo, class_name, module_path):
|
|
|
435
435
|
return {}
|
|
436
436
|
|
|
437
437
|
|
|
438
|
+
def __apply_fkey_aliases_to_doc(documentation: str, rel, existing_fkeys: dict) -> str:
|
|
439
|
+
"""Replace the Fkeys block in the docstring using the developer's aliases.
|
|
440
|
+
|
|
441
|
+
For each constraint already aliased in existing_fkeys the alias is preserved.
|
|
442
|
+
New constraints (not yet aliased) fall back to the default rfk_/fk_ name.
|
|
443
|
+
This prevents spurious diffs when generate() runs automatically on branches
|
|
444
|
+
where the developer has already defined aliases.
|
|
445
|
+
"""
|
|
446
|
+
import re
|
|
447
|
+
if not rel._ho_fkeys:
|
|
448
|
+
return documentation
|
|
449
|
+
|
|
450
|
+
# Invert existing_fkeys: constraint_name → alias (skip empty aliases)
|
|
451
|
+
aliases = {constraint: alias for alias, constraint in existing_fkeys.items() if alias}
|
|
452
|
+
|
|
453
|
+
lines = [" Fkeys = {"]
|
|
454
|
+
for constraint_name in rel._ho_fkeys:
|
|
455
|
+
if constraint_name in aliases:
|
|
456
|
+
key = aliases[constraint_name]
|
|
457
|
+
elif constraint_name.startswith('_reverse_fkey_'):
|
|
458
|
+
key = 'rfk_' + constraint_name[len('_reverse_fkey_'):]
|
|
459
|
+
else:
|
|
460
|
+
key = 'fk_' + constraint_name
|
|
461
|
+
lines.append(f" '{key}': '{constraint_name}',")
|
|
462
|
+
lines.append(" }")
|
|
463
|
+
new_block = '\n'.join(lines)
|
|
464
|
+
|
|
465
|
+
return re.sub(
|
|
466
|
+
r' Fkeys = \{[^}]*\}',
|
|
467
|
+
new_block,
|
|
468
|
+
documentation,
|
|
469
|
+
flags=re.DOTALL,
|
|
470
|
+
)
|
|
471
|
+
|
|
472
|
+
|
|
438
473
|
def __assemble_module_template(module_path):
|
|
439
474
|
"""Construct the module after slicing it if it already exists."""
|
|
440
475
|
ALT_BEGIN_CODE = "#>>> PLACE YOUR CODE BELLOW THIS LINE. DO NOT REMOVE THIS LINE!\n"
|
|
@@ -506,7 +541,7 @@ def __update_this_module(
|
|
|
506
541
|
if not os.path.exists(path_1):
|
|
507
542
|
os.makedirs(path_1)
|
|
508
543
|
|
|
509
|
-
# Read user-defined Fkeys aliases (for dataclass generation
|
|
544
|
+
# Read user-defined Fkeys aliases (for docstring and dataclass generation).
|
|
510
545
|
existing_fkeys = __get_fkeys(repo, class_name, module_path)
|
|
511
546
|
|
|
512
547
|
module_template = __assemble_module_template(module_path)
|
|
@@ -519,6 +554,7 @@ def __update_this_module(
|
|
|
519
554
|
# Generate Python module
|
|
520
555
|
with open(module_path, 'w', encoding='utf-8') as file_:
|
|
521
556
|
documentation = "\n".join([line and f" {line}" or "" for line in str(rel).split("\n")[1:]])
|
|
557
|
+
documentation = __apply_fkey_aliases_to_doc(documentation, rel, existing_fkeys)
|
|
522
558
|
file_.write(
|
|
523
559
|
module_template.format(
|
|
524
560
|
hop_release = hop_version(),
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
1.0.0-a10
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
1.0.0-a9
|
|
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.0a9 → half_orm_dev-1.0.0a10}/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.0a9 → half_orm_dev-1.0.0a10}/half_orm_dev/migrations/0/17/1/00_move_to_hop.py
RENAMED
|
File without changes
|
{half_orm_dev-1.0.0a9 → half_orm_dev-1.0.0a10}/half_orm_dev/migrations/0/17/1/01_txt_to_toml.py
RENAMED
|
File without changes
|
{half_orm_dev-1.0.0a9 → half_orm_dev-1.0.0a10}/half_orm_dev/migrations/0/17/4/00_toml_dict_format.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{half_orm_dev-1.0.0a9 → half_orm_dev-1.0.0a10}/half_orm_dev/migrations/hop/BREAKING_CHANGES-1.0.0.md
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
|
{half_orm_dev-1.0.0a9 → half_orm_dev-1.0.0a10}/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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|