dmart 1.4.13__py3-none-any.whl → 1.4.14__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.
alembic.ini CHANGED
@@ -3,7 +3,7 @@
3
3
  [alembic]
4
4
  # path to migration scripts
5
5
  # Use forward slashes (/) also on windows to provide an os agnostic path
6
- script_location = alembic
6
+ script_location = dmart_migrations
7
7
 
8
8
  # template used to generate migration file names; The default value is %%(rev)s_%%(slug)s
9
9
  # Uncomment the line below if you want the files to be prepended with date and time
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: dmart
3
- Version: 1.4.13
3
+ Version: 1.4.14
4
4
  Requires-Python: >=3.11
5
5
  Requires-Dist: fastapi
6
6
  Requires-Dist: pydantic
@@ -1,7 +1,7 @@
1
- alembic.ini,sha256=wQweByyHQm-EI8BQkE0SHNRjULJ6Xn5jqgvv88IT5Sg,3738
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=dGBsl6j-cWD91aEeyw4VgHAG8Xh6sYrPXVKKUMRLMtk,24794
4
+ dmart.py,sha256=HHCKuf_JomcSCwWs2QWH4FKNhCZa-r5kgbk0r6vcAEQ,24117
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
@@ -179,7 +179,7 @@ dmart_migrations/env.py,sha256=P1gnJRIUrP2jLHZ7HDbfkzkpuZJ_LMWqw05HIqOUJHo,3110
179
179
  dmart_migrations/notes.txt,sha256=X7LYSNmulLRiAUXvw07Z85bSGRTnx4NUpoNC9D2DfO8,395
180
180
  dmart_migrations/script.py.mako,sha256=u-ABdYW1tcIILgJFJdQZYLxoAI8Awd6wZbx30rY6fxU,680
181
181
  dmart_migrations/__pycache__/__init__.cpython-314.pyc,sha256=BB6R74YhUmoPWg2dYz2gTIM0CE7sMcOt0dsgqEEPza4,174
182
- dmart_migrations/__pycache__/env.cpython-314.pyc,sha256=9L-2pPlUSIrHh1JLQilY0TDxqo7_ikqfKhFwImuCuwk,3935
182
+ dmart_migrations/__pycache__/env.cpython-314.pyc,sha256=27dvi9nRTOIogSJ7ytGX2i1CbTEw4rwPaZV_OGS175g,4278
183
183
  dmart_migrations/scripts/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
184
184
  dmart_migrations/scripts/calculate_checksums.py,sha256=v2NLEvReA9V3noJE-BWANgKDdhc8Mqg1ZmJJ8nc8sGI,3443
185
185
  dmart_migrations/scripts/migration_f7a4949eed19.py,sha256=oUXuxjU4MbVafm4S-xu5J_4apHqW6hQZ8ftpJtCtM28,1462
@@ -215,7 +215,7 @@ dmart_migrations/versions/__pycache__/8640dcbebf85_add_notes_to_users.cpython-31
215
215
  dmart_migrations/versions/__pycache__/91c94250232a_adding_fk_on_owner_shortname.cpython-314.pyc,sha256=IIEupLleN5nEUUpTCXWGV-LXsdzGJrcnrolJmpi8WMo,6383
216
216
  dmart_migrations/versions/__pycache__/98ecd6f56f9a_ext_meta_with_owner_group_shortname.cpython-314.pyc,sha256=tPXDQ_TCEK9sv3ZinAk9vUJcwuqE75ymoT_0O_0qLss,5657
217
217
  dmart_migrations/versions/__pycache__/9aae9138c4ef_indexing_created_at_updated_at.cpython-314.pyc,sha256=D3m2fuhNbUUNZi21p45UDy8uUmAOio1RZzqoPnKD6G4,6990
218
- dmart_migrations/versions/__pycache__/b53f916b3f6d_json_to_jsonb.cpython-314.pyc,sha256=tsx4FNUeGpuqnMm_ewhDnjXGdBOzypSVqo_AQtzoOVk,34026
218
+ dmart_migrations/versions/__pycache__/b53f916b3f6d_json_to_jsonb.cpython-314.pyc,sha256=eBvU5VFctw1AqklCtprJJhvGXZVYpvxBcuZiI6bOBGY,34035
219
219
  dmart_migrations/versions/__pycache__/eb5f1ec65156_adding_user_locked_to_device.cpython-314.pyc,sha256=v47hBAxgbjkSAsEn8O2EUTUOPR0D9bVD8fJl9erlpzM,2514
220
220
  dmart_migrations/versions/__pycache__/f7a4949eed19_adding_query_policies_to_meta.cpython-314.pyc,sha256=jCW56_bq_qQM6H9CjPu2qOm8gywSO7TEHHywlyv1qcI,5099
221
221
  languages/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -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.13.dist-info/METADATA,sha256=0d3-SkAFxQeeKVN8VClBRVNVJapIVbCXbvT8bwFV5fQ,2069
286
- dmart-1.4.13.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
287
- dmart-1.4.13.dist-info/entry_points.txt,sha256=GjfoGh1bpxuU9HHGJzbtCFPNptHv9TryxHMN3uBSKpg,37
288
- dmart-1.4.13.dist-info/top_level.txt,sha256=XELQhaIfj-qupnyBrir39qFRh8ncu1RXkCHeitzqLLg,275
289
- dmart-1.4.13.dist-info/RECORD,,
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,,
dmart.py CHANGED
@@ -537,9 +537,9 @@ def main():
537
537
  pkg_dir = Path(__file__).resolve().parent
538
538
 
539
539
  # Try to find migrations directory
540
- # When installed via PyPI, it's renamed to dmart_migrations to avoid conflict with alembic library
541
540
  alembic_dir = pkg_dir / "dmart_migrations"
542
541
  if not alembic_dir.exists():
542
+ # Fallback to alembic for backward compatibility
543
543
  alembic_dir = pkg_dir / "alembic"
544
544
 
545
545
  original_ini_path = pkg_dir / "alembic.ini"
@@ -550,45 +550,31 @@ def main():
550
550
  print(f"Error: 'alembic.ini' not found in {pkg_dir} or {alembic_dir}")
551
551
  sys.exit(1)
552
552
 
553
- # Use subprocess to run alembic to avoid shadowing issues in the current process.
554
- # We use the current python executable to ensure we use the same environment.
555
- env = os.environ.copy()
556
- python_path = env.get("PYTHONPATH", "")
557
- if python_path:
558
- env["PYTHONPATH"] = f"{pkg_dir}{os.pathsep}{python_path}"
559
- else:
560
- env["PYTHONPATH"] = str(pkg_dir)
561
-
562
553
  try:
563
- # Check if alembic is installed
564
- check = subprocess.run(
565
- [sys.executable, "-c", "import alembic"],
566
- capture_output=True,
567
- env=env
568
- )
569
- if check.returncode != 0:
554
+ # Check if alembic library is installed using importlib.metadata
555
+ import importlib.metadata
556
+ try:
557
+ importlib.metadata.version('alembic')
558
+ except importlib.metadata.PackageNotFoundError:
570
559
  print("Error: 'alembic' library not found. Please install it with 'pip install alembic'.")
571
- if check.stderr:
572
- print(f"Stderr: {check.stderr.decode()}")
573
560
  sys.exit(1)
574
561
 
575
562
  import tempfile
576
- # Create a temporary alembic.ini to override script_location if needed
563
+ import re
564
+ # Create a temporary alembic.ini to override script_location with absolute path
577
565
  with tempfile.NamedTemporaryFile(mode='w', suffix='.ini', delete=False) as tf:
578
566
  with open(original_ini_path, 'r') as f:
579
567
  content = f.read()
580
568
 
581
- # Ensure script_location points to the actual directory (absolute path)
582
- import re
583
569
  content = re.sub(r'^script_location\s*=.*$', f'script_location = {alembic_dir.as_posix()}', content, flags=re.MULTILINE)
584
570
  tf.write(content)
585
571
  temp_ini_path = tf.name
586
572
 
587
573
  try:
574
+ # Run alembic upgrade head
588
575
  result = subprocess.run(
589
576
  [sys.executable, "-m", "alembic", "-c", temp_ini_path, "upgrade", "head"],
590
- cwd=pkg_dir,
591
- env=env
577
+ cwd=pkg_dir
592
578
  )
593
579
  if result.returncode != 0:
594
580
  sys.exit(result.returncode)
File without changes