dmart 1.4.14__py3-none-any.whl → 1.4.15__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.14
3
+ Version: 1.4.15
4
4
  Requires-Python: >=3.11
5
5
  Requires-Dist: fastapi
6
6
  Requires-Dist: pydantic
@@ -1,7 +1,7 @@
1
1
  alembic.ini,sha256=zs8d8VhH9TRwZrPK697EZPBCfaKvI4SqTuGuG0FAm2Y,3747
2
2
  bundler.py,sha256=so8ZJResb1PcOH5vboa_mpFAdYr_T8u8DbbFXd570Lg,1704
3
3
  data_generator.py,sha256=CnE-VHEeX7-lAXtqCgbRqR9WHjTuOgeiZcviYrHAmho,2287
4
- dmart.py,sha256=HHCKuf_JomcSCwWs2QWH4FKNhCZa-r5kgbk0r6vcAEQ,24117
4
+ dmart.py,sha256=ZoJwS2D0acAqSvsxwucOGwDDxVXAqnpxx64IkW6PVgA,23217
5
5
  get_settings.py,sha256=Sbe2WCoiK398E7HY4SNLfDN_GmE8knR4M-YJWF31jcg,153
6
6
  info.json,sha256=hXQWl19lfMkEj_zXdehGeKjiKGNJ7emY4S7d4pIqJ1E,123
7
7
  main.py,sha256=KZGhIL6AnEm5ZAPy4IvhBDpzSTjuodilV7NafNOyhzM,19676
@@ -282,8 +282,8 @@ utils/ticket_sys_utils.py,sha256=9QAlW2iiy8KyxQRBDj_WmzS5kKb0aYJmGwd4qzmGVqo,700
282
282
  utils/web_notifier.py,sha256=QM87VVid2grC5lK3NdS1yzz0z1wXljr4GChJOeK86W4,843
283
283
  utils/templates/activation.html.j2,sha256=XAMKCdoqONoc4ZQucD0yV-Pg5DlHHASZrTVItNS-iBE,640
284
284
  utils/templates/reminder.html.j2,sha256=aoS8bTs56q4hjAZKsb0jV9c-PIURBELuBOpT_qPZNVU,639
285
- dmart-1.4.14.dist-info/METADATA,sha256=H9gFXc-9yiV-o41d2QeSLIcFWjIJn041SLM6Ktc5_oY,2069
286
- dmart-1.4.14.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
287
- dmart-1.4.14.dist-info/entry_points.txt,sha256=GjfoGh1bpxuU9HHGJzbtCFPNptHv9TryxHMN3uBSKpg,37
288
- dmart-1.4.14.dist-info/top_level.txt,sha256=XELQhaIfj-qupnyBrir39qFRh8ncu1RXkCHeitzqLLg,275
289
- dmart-1.4.14.dist-info/RECORD,,
285
+ dmart-1.4.15.dist-info/METADATA,sha256=24CUQVxx3UY6pxDWKIYTH6BfPkcn6CdliEgXpH77ohI,2069
286
+ dmart-1.4.15.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
287
+ dmart-1.4.15.dist-info/entry_points.txt,sha256=GjfoGh1bpxuU9HHGJzbtCFPNptHv9TryxHMN3uBSKpg,37
288
+ dmart-1.4.15.dist-info/top_level.txt,sha256=XELQhaIfj-qupnyBrir39qFRh8ncu1RXkCHeitzqLLg,275
289
+ dmart-1.4.15.dist-info/RECORD,,
dmart.py CHANGED
@@ -551,36 +551,19 @@ def main():
551
551
  sys.exit(1)
552
552
 
553
553
  try:
554
- # Check if alembic library is installed using importlib.metadata
555
- import importlib.metadata
554
+ # Check if alembic library is installed
556
555
  try:
557
- importlib.metadata.version('alembic')
558
- except importlib.metadata.PackageNotFoundError:
556
+ from alembic.config import Config
557
+ from alembic import command
558
+ except ImportError:
559
559
  print("Error: 'alembic' library not found. Please install it with 'pip install alembic'.")
560
560
  sys.exit(1)
561
561
 
562
- import tempfile
563
- import re
564
- # Create a temporary alembic.ini to override script_location with absolute path
565
- with tempfile.NamedTemporaryFile(mode='w', suffix='.ini', delete=False) as tf:
566
- with open(original_ini_path, 'r') as f:
567
- content = f.read()
568
-
569
- content = re.sub(r'^script_location\s*=.*$', f'script_location = {alembic_dir.as_posix()}', content, flags=re.MULTILINE)
570
- tf.write(content)
571
- temp_ini_path = tf.name
562
+ alembic_cfg = Config(str(original_ini_path))
563
+ alembic_cfg.set_main_option("script_location", alembic_dir.as_posix())
572
564
 
573
- try:
574
- # Run alembic upgrade head
575
- result = subprocess.run(
576
- [sys.executable, "-m", "alembic", "-c", temp_ini_path, "upgrade", "head"],
577
- cwd=pkg_dir
578
- )
579
- if result.returncode != 0:
580
- sys.exit(result.returncode)
581
- finally:
582
- if os.path.exists(temp_ini_path):
583
- os.unlink(temp_ini_path)
565
+ # Run alembic upgrade head
566
+ command.upgrade(alembic_cfg, "head")
584
567
 
585
568
  except Exception as e:
586
569
  print(f"Error running migration: {e}")
File without changes