dmart 1.4.25__py3-none-any.whl → 1.4.27__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.25
3
+ Version: 1.4.27
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=EKr0YX1j4yoDrvc1LLHiXqBTKUtJAGvnDkIy3O9JdlA,25719
3
+ dmart.py,sha256=qPlcwDLQQc_9E1J0owKgBsPG4vBGJitpetAz2SPwvRQ,23771
4
4
  get_settings.py,sha256=Sbe2WCoiK398E7HY4SNLfDN_GmE8knR4M-YJWF31jcg,153
5
5
  main.py,sha256=KZGhIL6AnEm5ZAPy4IvhBDpzSTjuodilV7NafNOyhzM,19676
6
6
  migrate.py,sha256=hn1MZoVby_Jjqhc7y3CrLcGD619QmVZv3PONNvO7VKQ,665
@@ -271,8 +271,8 @@ utils/ticket_sys_utils.py,sha256=9QAlW2iiy8KyxQRBDj_WmzS5kKb0aYJmGwd4qzmGVqo,700
271
271
  utils/web_notifier.py,sha256=QM87VVid2grC5lK3NdS1yzz0z1wXljr4GChJOeK86W4,843
272
272
  utils/templates/activation.html.j2,sha256=XAMKCdoqONoc4ZQucD0yV-Pg5DlHHASZrTVItNS-iBE,640
273
273
  utils/templates/reminder.html.j2,sha256=aoS8bTs56q4hjAZKsb0jV9c-PIURBELuBOpT_qPZNVU,639
274
- dmart-1.4.25.dist-info/METADATA,sha256=1UTQWFfPUraoJmDrQI5DrLWcwSCPPHQHJaZ4LHa80-c,2149
275
- dmart-1.4.25.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
276
- dmart-1.4.25.dist-info/entry_points.txt,sha256=GjfoGh1bpxuU9HHGJzbtCFPNptHv9TryxHMN3uBSKpg,37
277
- dmart-1.4.25.dist-info/top_level.txt,sha256=S-gfX1pLerapNXiHZ8lvPYoV7sgwSX2_NCZ6xfzDUHM,267
278
- dmart-1.4.25.dist-info/RECORD,,
274
+ dmart-1.4.27.dist-info/METADATA,sha256=QlsnUz4bB_fM667kje4gSj_YDU44AZqRV-U7ykf3wrs,2149
275
+ dmart-1.4.27.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
276
+ dmart-1.4.27.dist-info/entry_points.txt,sha256=GjfoGh1bpxuU9HHGJzbtCFPNptHv9TryxHMN3uBSKpg,37
277
+ dmart-1.4.27.dist-info/top_level.txt,sha256=S-gfX1pLerapNXiHZ8lvPYoV7sgwSX2_NCZ6xfzDUHM,267
278
+ dmart-1.4.27.dist-info/RECORD,,
dmart.py CHANGED
@@ -3,14 +3,11 @@ from __future__ import annotations
3
3
 
4
4
  import argparse
5
5
  import asyncio
6
- import configparser
7
6
  import json
8
7
  import os
9
8
  import shutil
10
9
  import ssl
11
10
  import subprocess
12
- import sys
13
- import tempfile
14
11
  import time
15
12
  import warnings
16
13
  import webbrowser
@@ -20,36 +17,6 @@ from pathlib import Path
20
17
  from hypercorn.config import Config
21
18
  from hypercorn.run import run
22
19
 
23
- # Try to import alembic
24
- try:
25
- import alembic
26
- # Check if we are importing the local alembic directory which is likely a leftover
27
- if hasattr(alembic, '__path__'):
28
- local_alembic_path = os.path.abspath(os.path.join(os.path.dirname(os.path.abspath(__file__)), 'alembic'))
29
- for p in alembic.__path__:
30
- if os.path.abspath(p) == local_alembic_path:
31
- # Check if it is a namespace package (no __init__.py)
32
- if not os.path.exists(os.path.join(p, '__init__.py')):
33
- # It is a leftover directory
34
- try:
35
- shutil.rmtree(p)
36
- # Force reload
37
- if 'alembic' in sys.modules:
38
- del sys.modules['alembic']
39
- import alembic
40
- except Exception:
41
- pass
42
- except ImportError:
43
- pass
44
-
45
- try:
46
- from alembic import command as alembic_command
47
- from alembic.config import Config as AlembicConfig
48
- HAS_ALEMBIC = True
49
- ALEMBIC_ERROR = None
50
- except ImportError as e:
51
- HAS_ALEMBIC = False
52
- ALEMBIC_ERROR = e
53
20
 
54
21
  from data_adapters.file.archive import archive
55
22
  from data_adapters.file.create_index import main as create_index
@@ -588,31 +555,20 @@ def main():
588
555
  sys.exit(1)
589
556
 
590
557
  try:
558
+ try:
559
+ from alembic import command as alembic_command
560
+ from alembic.config import Config as AlembicConfig
561
+ HAS_ALEMBIC = True
562
+ ALEMBIC_ERROR = None
563
+ except ImportError as e:
564
+ HAS_ALEMBIC = False
565
+ ALEMBIC_ERROR = e
566
+
591
567
  # Check if alembic library is installed
592
568
  if not HAS_ALEMBIC:
593
- print("Warning: 'alembic' library not found. Attempting to run 'alembic' CLI...")
594
-
595
- with tempfile.NamedTemporaryFile(mode='w', suffix='.ini', delete=False) as tmp:
596
- temp_ini_path = tmp.name
597
- config = configparser.ConfigParser()
598
- config.read(str(ini_path))
599
- if not config.has_section('alembic'):
600
- config.add_section('alembic')
601
- config.set('alembic', 'script_location', alembic_dir.as_posix())
602
- config.write(tmp)
603
-
604
- try:
605
- subprocess.run([sys.executable, "-m", "alembic", "-c", temp_ini_path, "upgrade", "head"], check=True)
606
- except Exception as e:
607
- print(f"Error running alembic CLI: {e}")
608
- print("Please install 'alembic' library with 'pip install alembic'.")
609
- if ALEMBIC_ERROR:
610
- print(f"Details: {ALEMBIC_ERROR}")
611
- sys.exit(1)
612
- finally:
613
- if os.path.exists(temp_ini_path):
614
- os.unlink(temp_ini_path)
615
- return
569
+ print(f"Error: 'alembic' library not found. {ALEMBIC_ERROR}")
570
+ print("Please install 'alembic' library with 'pip install alembic'.")
571
+ sys.exit(1)
616
572
 
617
573
  alembic_cfg = AlembicConfig(str(ini_path))
618
574
  alembic_cfg.set_main_option("script_location", alembic_dir.as_posix())
File without changes