half-orm-dev 0.17.2a8__tar.gz → 0.17.2a9__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-0.17.2a8/half_orm_dev.egg-info → half_orm_dev-0.17.2a9}/PKG-INFO +1 -1
- {half_orm_dev-0.17.2a8 → half_orm_dev-0.17.2a9}/half_orm_dev/cli/main.py +62 -7
- half_orm_dev-0.17.2a9/half_orm_dev/version.txt +1 -0
- {half_orm_dev-0.17.2a8 → half_orm_dev-0.17.2a9/half_orm_dev.egg-info}/PKG-INFO +1 -1
- half_orm_dev-0.17.2a8/half_orm_dev/version.txt +0 -1
- {half_orm_dev-0.17.2a8 → half_orm_dev-0.17.2a9}/AUTHORS +0 -0
- {half_orm_dev-0.17.2a8 → half_orm_dev-0.17.2a9}/LICENSE +0 -0
- {half_orm_dev-0.17.2a8 → half_orm_dev-0.17.2a9}/README.md +0 -0
- {half_orm_dev-0.17.2a8 → half_orm_dev-0.17.2a9}/half_orm_dev/__init__.py +0 -0
- {half_orm_dev-0.17.2a8 → half_orm_dev-0.17.2a9}/half_orm_dev/cli/__init__.py +0 -0
- {half_orm_dev-0.17.2a8 → half_orm_dev-0.17.2a9}/half_orm_dev/cli/commands/__init__.py +0 -0
- {half_orm_dev-0.17.2a8 → half_orm_dev-0.17.2a9}/half_orm_dev/cli/commands/apply.py +0 -0
- {half_orm_dev-0.17.2a8 → half_orm_dev-0.17.2a9}/half_orm_dev/cli/commands/check.py +0 -0
- {half_orm_dev-0.17.2a8 → half_orm_dev-0.17.2a9}/half_orm_dev/cli/commands/clone.py +0 -0
- {half_orm_dev-0.17.2a8 → half_orm_dev-0.17.2a9}/half_orm_dev/cli/commands/init.py +0 -0
- {half_orm_dev-0.17.2a8 → half_orm_dev-0.17.2a9}/half_orm_dev/cli/commands/migrate.py +0 -0
- {half_orm_dev-0.17.2a8 → half_orm_dev-0.17.2a9}/half_orm_dev/cli/commands/patch.py +0 -0
- {half_orm_dev-0.17.2a8 → half_orm_dev-0.17.2a9}/half_orm_dev/cli/commands/release.py +0 -0
- {half_orm_dev-0.17.2a8 → half_orm_dev-0.17.2a9}/half_orm_dev/cli/commands/restore.py +0 -0
- {half_orm_dev-0.17.2a8 → half_orm_dev-0.17.2a9}/half_orm_dev/cli/commands/sync.py +0 -0
- {half_orm_dev-0.17.2a8 → half_orm_dev-0.17.2a9}/half_orm_dev/cli/commands/todo.py +0 -0
- {half_orm_dev-0.17.2a8 → half_orm_dev-0.17.2a9}/half_orm_dev/cli/commands/undo.py +0 -0
- {half_orm_dev-0.17.2a8 → half_orm_dev-0.17.2a9}/half_orm_dev/cli/commands/update.py +0 -0
- {half_orm_dev-0.17.2a8 → half_orm_dev-0.17.2a9}/half_orm_dev/cli/commands/upgrade.py +0 -0
- {half_orm_dev-0.17.2a8 → half_orm_dev-0.17.2a9}/half_orm_dev/cli_extension.py +0 -0
- {half_orm_dev-0.17.2a8 → half_orm_dev-0.17.2a9}/half_orm_dev/database.py +0 -0
- {half_orm_dev-0.17.2a8 → half_orm_dev-0.17.2a9}/half_orm_dev/decorators.py +0 -0
- {half_orm_dev-0.17.2a8 → half_orm_dev-0.17.2a9}/half_orm_dev/hgit.py +0 -0
- {half_orm_dev-0.17.2a8 → half_orm_dev-0.17.2a9}/half_orm_dev/migration_manager.py +0 -0
- {half_orm_dev-0.17.2a8 → half_orm_dev-0.17.2a9}/half_orm_dev/migrations/0/17/1/00_move_to_hop.py +0 -0
- {half_orm_dev-0.17.2a8 → half_orm_dev-0.17.2a9}/half_orm_dev/migrations/0/17/1/01_txt_to_toml.py +0 -0
- {half_orm_dev-0.17.2a8 → half_orm_dev-0.17.2a9}/half_orm_dev/modules.py +0 -0
- {half_orm_dev-0.17.2a8 → half_orm_dev-0.17.2a9}/half_orm_dev/patch_manager.py +0 -0
- {half_orm_dev-0.17.2a8 → half_orm_dev-0.17.2a9}/half_orm_dev/patch_validator.py +0 -0
- {half_orm_dev-0.17.2a8 → half_orm_dev-0.17.2a9}/half_orm_dev/patches/0/1/0/00_half_orm_meta.database.sql +0 -0
- {half_orm_dev-0.17.2a8 → half_orm_dev-0.17.2a9}/half_orm_dev/patches/0/1/0/01_alter_half_orm_meta.hop_release.sql +0 -0
- {half_orm_dev-0.17.2a8 → half_orm_dev-0.17.2a9}/half_orm_dev/patches/0/1/0/02_half_orm_meta.view.hop_penultimate_release.sql +0 -0
- {half_orm_dev-0.17.2a8 → half_orm_dev-0.17.2a9}/half_orm_dev/patches/log +0 -0
- {half_orm_dev-0.17.2a8 → half_orm_dev-0.17.2a9}/half_orm_dev/patches/sql/half_orm_meta.sql +0 -0
- {half_orm_dev-0.17.2a8 → half_orm_dev-0.17.2a9}/half_orm_dev/release_file.py +0 -0
- {half_orm_dev-0.17.2a8 → half_orm_dev-0.17.2a9}/half_orm_dev/release_manager.py +0 -0
- {half_orm_dev-0.17.2a8 → half_orm_dev-0.17.2a9}/half_orm_dev/repo.py +0 -0
- {half_orm_dev-0.17.2a8 → half_orm_dev-0.17.2a9}/half_orm_dev/templates/.gitignore +0 -0
- {half_orm_dev-0.17.2a8 → half_orm_dev-0.17.2a9}/half_orm_dev/templates/MANIFEST.in +0 -0
- {half_orm_dev-0.17.2a8 → half_orm_dev-0.17.2a9}/half_orm_dev/templates/Pipfile +0 -0
- {half_orm_dev-0.17.2a8 → half_orm_dev-0.17.2a9}/half_orm_dev/templates/README +0 -0
- {half_orm_dev-0.17.2a8 → half_orm_dev-0.17.2a9}/half_orm_dev/templates/conftest_template +0 -0
- {half_orm_dev-0.17.2a8 → half_orm_dev-0.17.2a9}/half_orm_dev/templates/git-hooks/pre-commit +0 -0
- {half_orm_dev-0.17.2a8 → half_orm_dev-0.17.2a9}/half_orm_dev/templates/git-hooks/prepare-commit-msg +0 -0
- {half_orm_dev-0.17.2a8 → half_orm_dev-0.17.2a9}/half_orm_dev/templates/init_module_template +0 -0
- {half_orm_dev-0.17.2a8 → half_orm_dev-0.17.2a9}/half_orm_dev/templates/module_template_1 +0 -0
- {half_orm_dev-0.17.2a8 → half_orm_dev-0.17.2a9}/half_orm_dev/templates/module_template_2 +0 -0
- {half_orm_dev-0.17.2a8 → half_orm_dev-0.17.2a9}/half_orm_dev/templates/module_template_3 +0 -0
- {half_orm_dev-0.17.2a8 → half_orm_dev-0.17.2a9}/half_orm_dev/templates/pyproject.toml +0 -0
- {half_orm_dev-0.17.2a8 → half_orm_dev-0.17.2a9}/half_orm_dev/templates/relation_test +0 -0
- {half_orm_dev-0.17.2a8 → half_orm_dev-0.17.2a9}/half_orm_dev/templates/sql_adapter +0 -0
- {half_orm_dev-0.17.2a8 → half_orm_dev-0.17.2a9}/half_orm_dev/templates/warning +0 -0
- {half_orm_dev-0.17.2a8 → half_orm_dev-0.17.2a9}/half_orm_dev/utils.py +0 -0
- {half_orm_dev-0.17.2a8 → half_orm_dev-0.17.2a9}/half_orm_dev.egg-info/SOURCES.txt +0 -0
- {half_orm_dev-0.17.2a8 → half_orm_dev-0.17.2a9}/half_orm_dev.egg-info/dependency_links.txt +0 -0
- {half_orm_dev-0.17.2a8 → half_orm_dev-0.17.2a9}/half_orm_dev.egg-info/requires.txt +0 -0
- {half_orm_dev-0.17.2a8 → half_orm_dev-0.17.2a9}/half_orm_dev.egg-info/top_level.txt +0 -0
- {half_orm_dev-0.17.2a8 → half_orm_dev-0.17.2a9}/pyproject.toml +0 -0
- {half_orm_dev-0.17.2a8 → half_orm_dev-0.17.2a9}/setup.cfg +0 -0
- {half_orm_dev-0.17.2a8 → half_orm_dev-0.17.2a9}/setup.py +0 -0
|
@@ -142,22 +142,77 @@ def create_cli_group():
|
|
|
142
142
|
if hop.repo_checked:
|
|
143
143
|
# Check if migration is needed
|
|
144
144
|
if hop._Hop__repo.needs_migration():
|
|
145
|
-
#
|
|
145
|
+
# Propose automatic migration
|
|
146
146
|
from half_orm_dev.utils import hop_version
|
|
147
|
+
from half_orm_dev.repo import RepoError
|
|
147
148
|
installed_version = hop_version()
|
|
148
149
|
config_version = hop._Hop__repo._Repo__config.hop_version
|
|
149
150
|
current_branch = hop._Hop__repo.hgit.branch if hop._Hop__repo.hgit else 'unknown'
|
|
150
151
|
|
|
151
152
|
click.echo(f"\n{'='*70}")
|
|
152
|
-
click.echo(f"
|
|
153
|
+
click.echo(f"✨ {utils.Color.bold('Repository Migration Available')} ✨")
|
|
153
154
|
click.echo(f"{'='*70}")
|
|
154
|
-
click.echo(f"\n Repository version: {
|
|
155
|
-
click.echo(f" Installed version: {
|
|
155
|
+
click.echo(f"\n Repository version: {config_version}")
|
|
156
|
+
click.echo(f" Installed version: {installed_version}")
|
|
156
157
|
click.echo(f" Current branch: {current_branch}")
|
|
157
|
-
click.echo(f"\n
|
|
158
|
-
click.echo(f"
|
|
159
|
-
click.echo(f"
|
|
158
|
+
click.echo(f"\n A migration is needed to update the repository structure.")
|
|
159
|
+
click.echo(f" This will:")
|
|
160
|
+
click.echo(f" • Switch to ho-prod branch (if not already there)")
|
|
161
|
+
click.echo(f" • Update repository configuration")
|
|
162
|
+
click.echo(f" • Sync changes to all active branches")
|
|
163
|
+
click.echo(f"\n 💡 You can interrupt (Ctrl+C) to backup .git/ if needed.")
|
|
160
164
|
click.echo(f"\n{'='*70}\n")
|
|
165
|
+
|
|
166
|
+
# Ask for confirmation
|
|
167
|
+
if click.confirm("Apply migration now?", default=True):
|
|
168
|
+
click.echo()
|
|
169
|
+
|
|
170
|
+
# Switch to ho-prod if needed
|
|
171
|
+
if current_branch != 'ho-prod':
|
|
172
|
+
try:
|
|
173
|
+
click.echo(f" Switching to ho-prod...")
|
|
174
|
+
hop._Hop__repo.hgit.checkout('ho-prod')
|
|
175
|
+
click.echo(f" ✓ Now on ho-prod")
|
|
176
|
+
click.echo()
|
|
177
|
+
except Exception as e:
|
|
178
|
+
click.echo(utils.Color.red(f" ❌ Failed to switch to ho-prod: {e}"), err=True)
|
|
179
|
+
click.echo(f"\n Please switch manually: git checkout ho-prod", err=True)
|
|
180
|
+
click.echo(f" Then run: half_orm dev migrate\n", err=True)
|
|
181
|
+
raise click.Abort()
|
|
182
|
+
|
|
183
|
+
# Run migration
|
|
184
|
+
try:
|
|
185
|
+
click.echo(f" Running migrations...")
|
|
186
|
+
result = hop._Hop__repo.run_migrations_if_needed(silent=False)
|
|
187
|
+
|
|
188
|
+
if result['migration_run']:
|
|
189
|
+
click.echo(f"\n✓ {utils.Color.green('Migration completed successfully')}")
|
|
190
|
+
click.echo(f" Updated .hop/config: hop_version = {installed_version}")
|
|
191
|
+
click.echo(f" Synced .hop/ to active branches")
|
|
192
|
+
click.echo()
|
|
193
|
+
|
|
194
|
+
# Return to original branch if we switched
|
|
195
|
+
if current_branch != 'ho-prod':
|
|
196
|
+
try:
|
|
197
|
+
click.echo(f" Returning to {current_branch}...")
|
|
198
|
+
hop._Hop__repo.hgit.checkout(current_branch)
|
|
199
|
+
click.echo(f" ✓ Back on {current_branch}\n")
|
|
200
|
+
except Exception:
|
|
201
|
+
click.echo(f" ⚠️ Could not return to {current_branch}", err=True)
|
|
202
|
+
click.echo(f" You are now on ho-prod\n", err=True)
|
|
203
|
+
else:
|
|
204
|
+
click.echo(f"✓ {utils.Color.green('Repository is up to date')}\n")
|
|
205
|
+
|
|
206
|
+
except RepoError as e:
|
|
207
|
+
click.echo(utils.Color.red(f"\n❌ Migration failed: {e}\n"), err=True)
|
|
208
|
+
raise click.Abort()
|
|
209
|
+
else:
|
|
210
|
+
# User declined migration
|
|
211
|
+
click.echo(f"\n Migration declined.")
|
|
212
|
+
click.echo(f" All commands are blocked until migration is complete.")
|
|
213
|
+
click.echo(f"\n To apply migration later, run:")
|
|
214
|
+
click.echo(f" {utils.Color.bold('half_orm dev migrate')}")
|
|
215
|
+
click.echo(f"\n{'='*70}\n")
|
|
161
216
|
else:
|
|
162
217
|
# Normal display
|
|
163
218
|
click.echo(hop.state)
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
0.17.2-a9
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
0.17.2-a8
|
|
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-0.17.2a8 → half_orm_dev-0.17.2a9}/half_orm_dev/migrations/0/17/1/00_move_to_hop.py
RENAMED
|
File without changes
|
{half_orm_dev-0.17.2a8 → half_orm_dev-0.17.2a9}/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
|
{half_orm_dev-0.17.2a8 → half_orm_dev-0.17.2a9}/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
|