dmart 1.4.21__py3-none-any.whl → 1.4.22__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: dmart
3
- Version: 1.4.21
3
+ Version: 1.4.22
4
4
  Requires-Python: >=3.11
5
5
  Requires-Dist: fastapi
6
6
  Requires-Dist: pydantic
@@ -1,6 +1,6 @@
1
1
  bundler.py,sha256=MDTUTVS0WL7gb-i1rDcS4i37KTqaW88TluL4L3rwjRw,1817
2
2
  data_generator.py,sha256=CnE-VHEeX7-lAXtqCgbRqR9WHjTuOgeiZcviYrHAmho,2287
3
- dmart.py,sha256=p5fLlsAoCtT9-2J34y8BE6vhkC5gHdXL9mc6nkAZGFQ,26230
3
+ dmart.py,sha256=T63eUgBZXSWYIi6GRaRBdHQvnZ4HGam46naY0gTlI4c,24705
4
4
  get_settings.py,sha256=Sbe2WCoiK398E7HY4SNLfDN_GmE8knR4M-YJWF31jcg,153
5
5
  info.json,sha256=hXQWl19lfMkEj_zXdehGeKjiKGNJ7emY4S7d4pIqJ1E,123
6
6
  main.py,sha256=KZGhIL6AnEm5ZAPy4IvhBDpzSTjuodilV7NafNOyhzM,19676
@@ -272,8 +272,8 @@ utils/ticket_sys_utils.py,sha256=9QAlW2iiy8KyxQRBDj_WmzS5kKb0aYJmGwd4qzmGVqo,700
272
272
  utils/web_notifier.py,sha256=QM87VVid2grC5lK3NdS1yzz0z1wXljr4GChJOeK86W4,843
273
273
  utils/templates/activation.html.j2,sha256=XAMKCdoqONoc4ZQucD0yV-Pg5DlHHASZrTVItNS-iBE,640
274
274
  utils/templates/reminder.html.j2,sha256=aoS8bTs56q4hjAZKsb0jV9c-PIURBELuBOpT_qPZNVU,639
275
- dmart-1.4.21.dist-info/METADATA,sha256=tHgxO-v_yePlbzxXCXfIjDv8ubvItn2SkEBpgAPachk,2149
276
- dmart-1.4.21.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
277
- dmart-1.4.21.dist-info/entry_points.txt,sha256=GjfoGh1bpxuU9HHGJzbtCFPNptHv9TryxHMN3uBSKpg,37
278
- dmart-1.4.21.dist-info/top_level.txt,sha256=S-gfX1pLerapNXiHZ8lvPYoV7sgwSX2_NCZ6xfzDUHM,267
279
- dmart-1.4.21.dist-info/RECORD,,
275
+ dmart-1.4.22.dist-info/METADATA,sha256=Et0n5lf20vuttHiL3AOs-psMuNhC883LbbQQGZ0yMTE,2149
276
+ dmart-1.4.22.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
277
+ dmart-1.4.22.dist-info/entry_points.txt,sha256=GjfoGh1bpxuU9HHGJzbtCFPNptHv9TryxHMN3uBSKpg,37
278
+ dmart-1.4.22.dist-info/top_level.txt,sha256=S-gfX1pLerapNXiHZ8lvPYoV7sgwSX2_NCZ6xfzDUHM,267
279
+ dmart-1.4.22.dist-info/RECORD,,
dmart.py CHANGED
@@ -18,10 +18,9 @@ from pathlib import Path
18
18
  from hypercorn.config import Config
19
19
  from hypercorn.run import run
20
20
 
21
+ # Try to import alembic
21
22
  try:
22
- # Try to import alembic
23
23
  import alembic
24
-
25
24
  # Check if we are importing the local alembic directory which is likely a leftover
26
25
  if hasattr(alembic, '__path__'):
27
26
  local_alembic_path = os.path.abspath(os.path.join(os.path.dirname(os.path.abspath(__file__)), 'alembic'))
@@ -38,7 +37,10 @@ try:
38
37
  import alembic
39
38
  except Exception:
40
39
  pass
40
+ except ImportError:
41
+ pass
41
42
 
43
+ try:
42
44
  from alembic import command as alembic_command
43
45
  from alembic.config import Config as AlembicConfig
44
46
  HAS_ALEMBIC = True
@@ -412,20 +414,6 @@ def hypercorn_main() -> int:
412
414
 
413
415
 
414
416
  def main():
415
- # Use sys.argv directly instead of modifying it in place which might be confusing
416
- # But to fix the UnboundLocalError, we just need to refer to the global sys module
417
- # The error happens because we're assigning to sys.argv, making python think sys is local
418
- # but we haven't imported it in this scope (it's imported at module level)
419
- # However, in Python, module-level imports are available in functions.
420
- # The issue is likely that we are assigning to sys.argv, which makes Python treat 'sys' as a local variable
421
- # But wait, sys is imported at the top.
422
- # Actually, the error "UnboundLocalError: cannot access local variable 'sys' where it is not associated with a value"
423
- # suggests that there might be a local variable named 'sys' somewhere or something weird is happening.
424
- # Ah, I see what happened. I added "import sys" inside the try/except block in the migrate case!
425
- # That local import shadows the global import for the whole function scope in Python 3.x due to how scoping works.
426
-
427
- # Let's fix this by removing the local import of sys in the migrate case since it's already imported globally.
428
-
429
417
  global sys
430
418
 
431
419
  args = sys.argv[1:]
@@ -459,10 +447,6 @@ def main():
459
447
  import threading
460
448
  threading.Thread(target=open_browser, daemon=True).start()
461
449
 
462
- # We need to update sys.argv for hypercorn/fastapi if they use it,
463
- # but here we are calling asyncio.run(server()) which uses settings.
464
- # hypercorn_main uses sys.argv, but we call it explicitly above.
465
- # Let's just set sys.argv to the modified args just in case.
466
450
  sys.argv = [sys.argv[0]] + args
467
451
  asyncio.run(server())
468
452
  case "health-check":
@@ -474,7 +458,6 @@ def main():
474
458
  parser.add_argument("-s", "--space", help="hit the target space or pass (all) to make the full health check")
475
459
  parser.add_argument("-m", "--schemas", nargs="*", help="hit the target schema inside the space")
476
460
 
477
- # parse_args defaults to sys.argv[1:], so we need to pass the relevant args
478
461
  args_parsed = parser.parse_args(args[1:])
479
462
  before_time = time.time()
480
463
  asyncio.run(health_check(args_parsed.type, args_parsed.space, args_parsed.schemas))
File without changes