svc-infra 0.1.628__py3-none-any.whl → 0.1.629__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.

Potentially problematic release.


This version of svc-infra might be problematic. Click here for more details.

@@ -1,5 +1,6 @@
1
1
  from __future__ import annotations
2
2
 
3
+ import json
3
4
  import os
4
5
  from importlib import import_module
5
6
  from typing import List, Optional
@@ -124,7 +125,11 @@ def cmd_current(
124
125
  ):
125
126
  """Display the current revision for each database."""
126
127
  apply_database_url(database_url)
127
- core_current(verbose=verbose)
128
+ result = core_current(verbose=verbose)
129
+ try:
130
+ typer.echo(json.dumps(result))
131
+ except Exception:
132
+ typer.echo(str(result))
128
133
 
129
134
 
130
135
  def cmd_history(
@@ -189,7 +194,7 @@ def cmd_setup_and_migrate(
189
194
  Async vs. sync is inferred from SQL_URL.
190
195
  """
191
196
  final_pkgs = _find_pkgs(with_payments, discover_packages)
192
- core_setup_and_migrate(
197
+ result = core_setup_and_migrate(
193
198
  overwrite_scaffold=overwrite_scaffold,
194
199
  create_db_if_missing=create_db_if_missing,
195
200
  create_followup_revision=create_followup_revision,
@@ -198,6 +203,12 @@ def cmd_setup_and_migrate(
198
203
  discover_packages=final_pkgs or None,
199
204
  database_url=database_url,
200
205
  )
206
+ # Echo a concise JSON result so tests and users can introspect outcome
207
+ try:
208
+ typer.echo(json.dumps(result))
209
+ except Exception:
210
+ # Fallback to plain string if not JSON-serializable for any reason
211
+ typer.echo(str(result))
201
212
 
202
213
 
203
214
  def register(app: typer.Typer) -> None:
@@ -205,7 +216,11 @@ def register(app: typer.Typer) -> None:
205
216
  app.command("init")(cmd_init)
206
217
  app.command("revision")(cmd_revision)
207
218
  app.command("upgrade")(cmd_upgrade)
208
- app.command("downgrade")(cmd_downgrade)
219
+ # Allow unknown options so users can pass "-1" like Alembic without Click treating it as an option
220
+ app.command(
221
+ "downgrade",
222
+ context_settings={"ignore_unknown_options": True, "allow_extra_args": True},
223
+ )(cmd_downgrade)
209
224
  app.command("current")(cmd_current)
210
225
  app.command("history")(cmd_history)
211
226
  app.command("stamp")(cmd_stamp)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: svc-infra
3
- Version: 0.1.628
3
+ Version: 0.1.629
4
4
  Summary: Infrastructure for building and deploying prod-ready services
5
5
  License: MIT
6
6
  Keywords: fastapi,sqlalchemy,alembic,auth,infra,async,pydantic
@@ -139,7 +139,7 @@ svc_infra/cli/cmds/db/nosql/mongo/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeR
139
139
  svc_infra/cli/cmds/db/nosql/mongo/mongo_cmds.py,sha256=s5oAlZ9bYndiRhtmi9gSbcJPvR82bwCGRbxAF_ziBx4,6125
140
140
  svc_infra/cli/cmds/db/nosql/mongo/mongo_scaffold_cmds.py,sha256=AR2sNt8Faxa6vAJ3MxGSWqLU54DMOL_r72hDtnEk4Pg,4253
141
141
  svc_infra/cli/cmds/db/sql/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
142
- svc_infra/cli/cmds/db/sql/alembic_cmds.py,sha256=uCreHg69Zf6B5gbv9Dm39jCRk6q2KQy_05A-75IP0Fg,9650
142
+ svc_infra/cli/cmds/db/sql/alembic_cmds.py,sha256=C0TEZuwGmdb1WaaSbtjHf2RHAlxfuuacjLHfCi7ezxA,10237
143
143
  svc_infra/cli/cmds/db/sql/sql_export_cmds.py,sha256=YpkguUJFeFApMphVkhOJllTi25ejlsQaJarMe6vJD54,2685
144
144
  svc_infra/cli/cmds/db/sql/sql_scaffold_cmds.py,sha256=MKc_T_tY1Y_wQl7XTlq8GhYWMMI1q1_vcFZVPOEcNUg,4601
145
145
  svc_infra/cli/cmds/docs/docs_cmds.py,sha256=kvrBLeAvkv1lx_6TzvY_ciC9NJNBMNbmH0-wzA9LeHo,4501
@@ -325,7 +325,7 @@ svc_infra/webhooks/fastapi.py,sha256=BCNvGNxukf6dC2a4i-6en-PrjBGV19YvCWOot5lXWsA
325
325
  svc_infra/webhooks/router.py,sha256=6JvAVPMEth_xxHX-IsIOcyMgHX7g1H0OVxVXKLuMp9w,1596
326
326
  svc_infra/webhooks/service.py,sha256=hh-rw0otc00vipZ998XaV5mHsk0IDGYqon0FnhaGr60,2229
327
327
  svc_infra/webhooks/signing.py,sha256=NCwdZzmravUe7HVIK_uXK0qqf12FG-_MVsgPvOw6lsM,784
328
- svc_infra-0.1.628.dist-info/METADATA,sha256=gNFtYm9xyvUdLV7Llw0LCrfXZ3CADY9C_TQQ53RlBn8,8748
329
- svc_infra-0.1.628.dist-info/WHEEL,sha256=IYZQI976HJqqOpQU6PHkJ8fb3tMNBFjg-Cn-pwAbaFM,88
330
- svc_infra-0.1.628.dist-info/entry_points.txt,sha256=6x_nZOsjvn6hRZsMgZLgTasaCSKCgAjsGhACe_CiP0U,48
331
- svc_infra-0.1.628.dist-info/RECORD,,
328
+ svc_infra-0.1.629.dist-info/METADATA,sha256=er59ifizb7n0wnHT4qtUIMkCC1l5kx5yol0WXlyw-cw,8748
329
+ svc_infra-0.1.629.dist-info/WHEEL,sha256=IYZQI976HJqqOpQU6PHkJ8fb3tMNBFjg-Cn-pwAbaFM,88
330
+ svc_infra-0.1.629.dist-info/entry_points.txt,sha256=6x_nZOsjvn6hRZsMgZLgTasaCSKCgAjsGhACe_CiP0U,48
331
+ svc_infra-0.1.629.dist-info/RECORD,,