dmart 1.4.22__py3-none-any.whl → 1.4.23__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.22
3
+ Version: 1.4.23
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=T63eUgBZXSWYIi6GRaRBdHQvnZ4HGam46naY0gTlI4c,24705
3
+ dmart.py,sha256=zgHBt-3kfKL4hCXmjK2CtNq0yTgEvrJH-53hETcvfJY,25688
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.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,,
275
+ dmart-1.4.23.dist-info/METADATA,sha256=ojXCy8URKygQ9ZaKcr98R76DD5QlBNsc7G3OTiQKmmc,2149
276
+ dmart-1.4.23.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
277
+ dmart-1.4.23.dist-info/entry_points.txt,sha256=GjfoGh1bpxuU9HHGJzbtCFPNptHv9TryxHMN3uBSKpg,37
278
+ dmart-1.4.23.dist-info/top_level.txt,sha256=S-gfX1pLerapNXiHZ8lvPYoV7sgwSX2_NCZ6xfzDUHM,267
279
+ dmart-1.4.23.dist-info/RECORD,,
dmart.py CHANGED
@@ -3,12 +3,14 @@ from __future__ import annotations
3
3
 
4
4
  import argparse
5
5
  import asyncio
6
+ import configparser
6
7
  import json
7
8
  import os
8
9
  import shutil
9
10
  import ssl
10
11
  import subprocess
11
12
  import sys
13
+ import tempfile
12
14
  import time
13
15
  import warnings
14
16
  import webbrowser
@@ -587,12 +589,29 @@ def main():
587
589
  try:
588
590
  # Check if alembic library is installed
589
591
  if not HAS_ALEMBIC:
590
- print("Error: 'alembic' library not found. Please install it with 'pip install alembic'.")
591
- if ALEMBIC_ERROR:
592
- print(f"Details: {ALEMBIC_ERROR}")
593
- print(f"Python executable: {sys.executable}")
594
- print(f"sys.path: {sys.path}")
595
- sys.exit(1)
592
+ print("Warning: 'alembic' library not found. Attempting to run 'alembic' CLI...")
593
+
594
+ with tempfile.NamedTemporaryFile(mode='w', suffix='.ini', delete=False) as tmp:
595
+ temp_ini_path = tmp.name
596
+ config = configparser.ConfigParser()
597
+ config.read(str(original_ini_path))
598
+ if not config.has_section('alembic'):
599
+ config.add_section('alembic')
600
+ config.set('alembic', 'script_location', alembic_dir.as_posix())
601
+ config.write(tmp)
602
+
603
+ try:
604
+ subprocess.run(["alembic", "-c", temp_ini_path, "upgrade", "head"], check=True)
605
+ except Exception as e:
606
+ print(f"Error running alembic CLI: {e}")
607
+ print("Please install 'alembic' library with 'pip install alembic'.")
608
+ if ALEMBIC_ERROR:
609
+ print(f"Details: {ALEMBIC_ERROR}")
610
+ sys.exit(1)
611
+ finally:
612
+ if os.path.exists(temp_ini_path):
613
+ os.unlink(temp_ini_path)
614
+ return
596
615
 
597
616
  alembic_cfg = AlembicConfig(str(original_ini_path))
598
617
  alembic_cfg.set_main_option("script_location", alembic_dir.as_posix())
File without changes