half-orm-dev 1.0.0a27__tar.gz → 1.0.0a28__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.0a27/half_orm_dev.egg-info → half_orm_dev-1.0.0a28}/PKG-INFO +1 -1
- {half_orm_dev-1.0.0a27 → half_orm_dev-1.0.0a28}/half_orm_dev/bootstrap_manager.py +11 -19
- half_orm_dev-1.0.0a28/half_orm_dev/version.txt +1 -0
- {half_orm_dev-1.0.0a27 → half_orm_dev-1.0.0a28/half_orm_dev.egg-info}/PKG-INFO +1 -1
- half_orm_dev-1.0.0a27/half_orm_dev/version.txt +0 -1
- {half_orm_dev-1.0.0a27 → half_orm_dev-1.0.0a28}/AUTHORS +0 -0
- {half_orm_dev-1.0.0a27 → half_orm_dev-1.0.0a28}/LICENSE +0 -0
- {half_orm_dev-1.0.0a27 → half_orm_dev-1.0.0a28}/README.md +0 -0
- {half_orm_dev-1.0.0a27 → half_orm_dev-1.0.0a28}/half_orm_dev/__init__.py +0 -0
- {half_orm_dev-1.0.0a27 → half_orm_dev-1.0.0a28}/half_orm_dev/cli/__init__.py +0 -0
- {half_orm_dev-1.0.0a27 → half_orm_dev-1.0.0a28}/half_orm_dev/cli/commands/__init__.py +0 -0
- {half_orm_dev-1.0.0a27 → half_orm_dev-1.0.0a28}/half_orm_dev/cli/commands/apply.py +0 -0
- {half_orm_dev-1.0.0a27 → half_orm_dev-1.0.0a28}/half_orm_dev/cli/commands/bootstrap.py +0 -0
- {half_orm_dev-1.0.0a27 → half_orm_dev-1.0.0a28}/half_orm_dev/cli/commands/check.py +0 -0
- {half_orm_dev-1.0.0a27 → half_orm_dev-1.0.0a28}/half_orm_dev/cli/commands/clone.py +0 -0
- {half_orm_dev-1.0.0a27 → half_orm_dev-1.0.0a28}/half_orm_dev/cli/commands/init.py +0 -0
- {half_orm_dev-1.0.0a27 → half_orm_dev-1.0.0a28}/half_orm_dev/cli/commands/migrate.py +0 -0
- {half_orm_dev-1.0.0a27 → half_orm_dev-1.0.0a28}/half_orm_dev/cli/commands/patch.py +0 -0
- {half_orm_dev-1.0.0a27 → half_orm_dev-1.0.0a28}/half_orm_dev/cli/commands/release.py +0 -0
- {half_orm_dev-1.0.0a27 → half_orm_dev-1.0.0a28}/half_orm_dev/cli/commands/restore.py +0 -0
- {half_orm_dev-1.0.0a27 → half_orm_dev-1.0.0a28}/half_orm_dev/cli/commands/revert_migration.py +0 -0
- {half_orm_dev-1.0.0a27 → half_orm_dev-1.0.0a28}/half_orm_dev/cli/commands/set_git_origin.py +0 -0
- {half_orm_dev-1.0.0a27 → half_orm_dev-1.0.0a28}/half_orm_dev/cli/commands/sync.py +0 -0
- {half_orm_dev-1.0.0a27 → half_orm_dev-1.0.0a28}/half_orm_dev/cli/commands/todo.py +0 -0
- {half_orm_dev-1.0.0a27 → half_orm_dev-1.0.0a28}/half_orm_dev/cli/commands/undo.py +0 -0
- {half_orm_dev-1.0.0a27 → half_orm_dev-1.0.0a28}/half_orm_dev/cli/commands/update.py +0 -0
- {half_orm_dev-1.0.0a27 → half_orm_dev-1.0.0a28}/half_orm_dev/cli/commands/upgrade.py +0 -0
- {half_orm_dev-1.0.0a27 → half_orm_dev-1.0.0a28}/half_orm_dev/cli/main.py +0 -0
- {half_orm_dev-1.0.0a27 → half_orm_dev-1.0.0a28}/half_orm_dev/cli_extension.py +0 -0
- {half_orm_dev-1.0.0a27 → half_orm_dev-1.0.0a28}/half_orm_dev/database.py +0 -0
- {half_orm_dev-1.0.0a27 → half_orm_dev-1.0.0a28}/half_orm_dev/decorators.py +0 -0
- {half_orm_dev-1.0.0a27 → half_orm_dev-1.0.0a28}/half_orm_dev/file_executor.py +0 -0
- {half_orm_dev-1.0.0a27 → half_orm_dev-1.0.0a28}/half_orm_dev/hgit.py +0 -0
- {half_orm_dev-1.0.0a27 → half_orm_dev-1.0.0a28}/half_orm_dev/migration_manager.py +0 -0
- {half_orm_dev-1.0.0a27 → half_orm_dev-1.0.0a28}/half_orm_dev/migrations/0/17/1/00_move_to_hop.py +0 -0
- {half_orm_dev-1.0.0a27 → half_orm_dev-1.0.0a28}/half_orm_dev/migrations/0/17/1/01_txt_to_toml.py +0 -0
- {half_orm_dev-1.0.0a27 → half_orm_dev-1.0.0a28}/half_orm_dev/migrations/0/17/4/00_toml_dict_format.py +0 -0
- {half_orm_dev-1.0.0a27 → half_orm_dev-1.0.0a28}/half_orm_dev/migrations/0/17/4/01_add_bootstrap_table.py +0 -0
- {half_orm_dev-1.0.0a27 → half_orm_dev-1.0.0a28}/half_orm_dev/migrations/0/17/4/02_move_patches_to_subdirs.py +0 -0
- {half_orm_dev-1.0.0a27 → half_orm_dev-1.0.0a28}/half_orm_dev/migrations/0/17/5/01_update_pyproject_dependency.py +0 -0
- {half_orm_dev-1.0.0a27 → half_orm_dev-1.0.0a28}/half_orm_dev/migrations/0/18/0/00_add_async_support.py +0 -0
- {half_orm_dev-1.0.0a27 → half_orm_dev-1.0.0a28}/half_orm_dev/migrations/0/18/0/01_update_default_tests.py +0 -0
- {half_orm_dev-1.0.0a27 → half_orm_dev-1.0.0a28}/half_orm_dev/migrations/1/0/0/a20/01_update_gitignore.py +0 -0
- {half_orm_dev-1.0.0a27 → half_orm_dev-1.0.0a28}/half_orm_dev/migrations/hop/BREAKING_CHANGES-1.0.0.md +0 -0
- {half_orm_dev-1.0.0a27 → half_orm_dev-1.0.0a28}/half_orm_dev/modules.py +0 -0
- {half_orm_dev-1.0.0a27 → half_orm_dev-1.0.0a28}/half_orm_dev/patch_manager.py +0 -0
- {half_orm_dev-1.0.0a27 → half_orm_dev-1.0.0a28}/half_orm_dev/patch_validator.py +0 -0
- {half_orm_dev-1.0.0a27 → half_orm_dev-1.0.0a28}/half_orm_dev/patches/0/1/0/00_half_orm_meta.database.sql +0 -0
- {half_orm_dev-1.0.0a27 → half_orm_dev-1.0.0a28}/half_orm_dev/patches/0/1/0/01_alter_half_orm_meta.hop_release.sql +0 -0
- {half_orm_dev-1.0.0a27 → half_orm_dev-1.0.0a28}/half_orm_dev/patches/0/1/0/02_half_orm_meta.view.hop_penultimate_release.sql +0 -0
- {half_orm_dev-1.0.0a27 → half_orm_dev-1.0.0a28}/half_orm_dev/patches/log +0 -0
- {half_orm_dev-1.0.0a27 → half_orm_dev-1.0.0a28}/half_orm_dev/patches/sql/half_orm_meta.sql +0 -0
- {half_orm_dev-1.0.0a27 → half_orm_dev-1.0.0a28}/half_orm_dev/py.typed +0 -0
- {half_orm_dev-1.0.0a27 → half_orm_dev-1.0.0a28}/half_orm_dev/release_file.py +0 -0
- {half_orm_dev-1.0.0a27 → half_orm_dev-1.0.0a28}/half_orm_dev/release_manager.py +0 -0
- {half_orm_dev-1.0.0a27 → half_orm_dev-1.0.0a28}/half_orm_dev/repo.py +0 -0
- {half_orm_dev-1.0.0a27 → half_orm_dev-1.0.0a28}/half_orm_dev/scripts/repair-metadata.py +0 -0
- {half_orm_dev-1.0.0a27 → half_orm_dev-1.0.0a28}/half_orm_dev/templates/.gitignore +0 -0
- {half_orm_dev-1.0.0a27 → half_orm_dev-1.0.0a28}/half_orm_dev/templates/MANIFEST.in +0 -0
- {half_orm_dev-1.0.0a27 → half_orm_dev-1.0.0a28}/half_orm_dev/templates/README +0 -0
- {half_orm_dev-1.0.0a27 → half_orm_dev-1.0.0a28}/half_orm_dev/templates/conftest_template +0 -0
- {half_orm_dev-1.0.0a27 → half_orm_dev-1.0.0a28}/half_orm_dev/templates/git-hooks/pre-commit +0 -0
- {half_orm_dev-1.0.0a27 → half_orm_dev-1.0.0a28}/half_orm_dev/templates/git-hooks/pre-push +0 -0
- {half_orm_dev-1.0.0a27 → half_orm_dev-1.0.0a28}/half_orm_dev/templates/git-hooks/prepare-commit-msg +0 -0
- {half_orm_dev-1.0.0a27 → half_orm_dev-1.0.0a28}/half_orm_dev/templates/git-hooks/reference-transaction +0 -0
- {half_orm_dev-1.0.0a27 → half_orm_dev-1.0.0a28}/half_orm_dev/templates/init_module_template +0 -0
- {half_orm_dev-1.0.0a27 → half_orm_dev-1.0.0a28}/half_orm_dev/templates/module_template_1 +0 -0
- {half_orm_dev-1.0.0a27 → half_orm_dev-1.0.0a28}/half_orm_dev/templates/module_template_2 +0 -0
- {half_orm_dev-1.0.0a27 → half_orm_dev-1.0.0a28}/half_orm_dev/templates/module_template_3 +0 -0
- {half_orm_dev-1.0.0a27 → half_orm_dev-1.0.0a28}/half_orm_dev/templates/pyproject.toml +0 -0
- {half_orm_dev-1.0.0a27 → half_orm_dev-1.0.0a28}/half_orm_dev/templates/relation_test +0 -0
- {half_orm_dev-1.0.0a27 → half_orm_dev-1.0.0a28}/half_orm_dev/templates/sql_adapter +0 -0
- {half_orm_dev-1.0.0a27 → half_orm_dev-1.0.0a28}/half_orm_dev/templates/warning +0 -0
- {half_orm_dev-1.0.0a27 → half_orm_dev-1.0.0a28}/half_orm_dev/utils.py +0 -0
- {half_orm_dev-1.0.0a27 → half_orm_dev-1.0.0a28}/half_orm_dev.egg-info/SOURCES.txt +0 -0
- {half_orm_dev-1.0.0a27 → half_orm_dev-1.0.0a28}/half_orm_dev.egg-info/dependency_links.txt +0 -0
- {half_orm_dev-1.0.0a27 → half_orm_dev-1.0.0a28}/half_orm_dev.egg-info/entry_points.txt +0 -0
- {half_orm_dev-1.0.0a27 → half_orm_dev-1.0.0a28}/half_orm_dev.egg-info/requires.txt +0 -0
- {half_orm_dev-1.0.0a27 → half_orm_dev-1.0.0a28}/half_orm_dev.egg-info/top_level.txt +0 -0
- {half_orm_dev-1.0.0a27 → half_orm_dev-1.0.0a28}/pyproject.toml +0 -0
- {half_orm_dev-1.0.0a27 → half_orm_dev-1.0.0a28}/setup.cfg +0 -0
- {half_orm_dev-1.0.0a27 → half_orm_dev-1.0.0a28}/setup.py +0 -0
|
@@ -62,8 +62,8 @@ class BootstrapManager:
|
|
|
62
62
|
"""
|
|
63
63
|
Ensure half_orm_meta.bootstrap table exists.
|
|
64
64
|
|
|
65
|
-
Creates the table if it doesn't exist
|
|
66
|
-
|
|
65
|
+
Creates the table if it doesn't exist, then reloads the model so
|
|
66
|
+
get_relation_class('half_orm_meta.bootstrap') can find it.
|
|
67
67
|
"""
|
|
68
68
|
sql = """
|
|
69
69
|
CREATE TABLE IF NOT EXISTS half_orm_meta.bootstrap (
|
|
@@ -73,6 +73,7 @@ class BootstrapManager:
|
|
|
73
73
|
);
|
|
74
74
|
"""
|
|
75
75
|
self._repo.database.model.execute_query(sql)
|
|
76
|
+
self._repo.database.model.reconnect(reload=True)
|
|
76
77
|
|
|
77
78
|
def get_bootstrap_files(
|
|
78
79
|
self,
|
|
@@ -135,9 +136,6 @@ class BootstrapManager:
|
|
|
135
136
|
"""
|
|
136
137
|
Get set of already executed filenames from database.
|
|
137
138
|
|
|
138
|
-
Queries half_orm_meta.bootstrap table to get filenames
|
|
139
|
-
that have already been executed.
|
|
140
|
-
|
|
141
139
|
Returns:
|
|
142
140
|
Set of filename strings that have been executed
|
|
143
141
|
"""
|
|
@@ -145,10 +143,8 @@ class BootstrapManager:
|
|
|
145
143
|
# return empty set so all bootstrap files are treated as pending.
|
|
146
144
|
try:
|
|
147
145
|
self._ensure_bootstrap_table()
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
)
|
|
151
|
-
return {row[0] for row in result} if result else set()
|
|
146
|
+
HopBootstrap = self._repo.database.model.get_relation_class('half_orm_meta.bootstrap')
|
|
147
|
+
return {row.filename for row in HopBootstrap()}
|
|
152
148
|
except Exception:
|
|
153
149
|
return set()
|
|
154
150
|
|
|
@@ -198,22 +194,18 @@ class BootstrapManager:
|
|
|
198
194
|
except FileExecutionError as e:
|
|
199
195
|
raise BootstrapManagerError(str(e)) from e
|
|
200
196
|
|
|
201
|
-
def record_execution(self, filename: str, version: str) -> None:
|
|
197
|
+
def record_execution(self, filename: str, version: str, force: bool = False) -> None:
|
|
202
198
|
"""
|
|
203
199
|
Record execution in half_orm_meta.bootstrap table.
|
|
204
200
|
|
|
205
201
|
Args:
|
|
206
202
|
filename: Name of the executed file
|
|
207
203
|
version: Version extracted from filename
|
|
204
|
+
force: If True, upsert (update executed_at on re-run). If False,
|
|
205
|
+
plain insert — a duplicate raises an error revealing a guard bug.
|
|
208
206
|
"""
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
VALUES (%s, %s)
|
|
212
|
-
ON CONFLICT (filename) DO UPDATE SET
|
|
213
|
-
version = EXCLUDED.version,
|
|
214
|
-
executed_at = NOW()
|
|
215
|
-
"""
|
|
216
|
-
self._repo.database.model.execute_query(sql, (filename, version))
|
|
207
|
+
HopBootstrap = self._repo.database.model.get_relation_class('half_orm_meta.bootstrap')
|
|
208
|
+
HopBootstrap(filename=filename, version=version).ho_insert(upsert=force)
|
|
217
209
|
|
|
218
210
|
def run_bootstrap(
|
|
219
211
|
self,
|
|
@@ -285,7 +277,7 @@ class BootstrapManager:
|
|
|
285
277
|
try:
|
|
286
278
|
click.echo(f" • Executing {filename}...")
|
|
287
279
|
self.execute_file(file_path)
|
|
288
|
-
self.record_execution(filename, file_version)
|
|
280
|
+
self.record_execution(filename, file_version, force=force)
|
|
289
281
|
executed_set.add(filename)
|
|
290
282
|
result['executed'].append(filename)
|
|
291
283
|
except BootstrapManagerError as e:
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
1.0.0-a28
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
1.0.0-a27
|
|
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.0a27 → half_orm_dev-1.0.0a28}/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.0a27 → half_orm_dev-1.0.0a28}/half_orm_dev/migrations/0/17/1/00_move_to_hop.py
RENAMED
|
File without changes
|
{half_orm_dev-1.0.0a27 → half_orm_dev-1.0.0a28}/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
|
|
File without changes
|
|
File without changes
|
{half_orm_dev-1.0.0a27 → half_orm_dev-1.0.0a28}/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
|