dmart 1.4.13__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.
- alembic.ini +1 -1
- {dmart-1.4.13.dist-info → dmart-1.4.15.dist-info}/METADATA +1 -1
- {dmart-1.4.13.dist-info → dmart-1.4.15.dist-info}/RECORD +9 -9
- dmart.py +10 -41
- dmart_migrations/__pycache__/env.cpython-314.pyc +0 -0
- dmart_migrations/versions/__pycache__/b53f916b3f6d_json_to_jsonb.cpython-314.pyc +0 -0
- {dmart-1.4.13.dist-info → dmart-1.4.15.dist-info}/WHEEL +0 -0
- {dmart-1.4.13.dist-info → dmart-1.4.15.dist-info}/entry_points.txt +0 -0
- {dmart-1.4.13.dist-info → dmart-1.4.15.dist-info}/top_level.txt +0 -0
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 =
|
|
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,7 +1,7 @@
|
|
|
1
|
-
alembic.ini,sha256=
|
|
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=
|
|
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
|
|
@@ -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=
|
|
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=
|
|
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.
|
|
286
|
-
dmart-1.4.
|
|
287
|
-
dmart-1.4.
|
|
288
|
-
dmart-1.4.
|
|
289
|
-
dmart-1.4.
|
|
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
|
@@ -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,51 +550,20 @@ 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
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
)
|
|
569
|
-
if check.returncode != 0:
|
|
554
|
+
# Check if alembic library is installed
|
|
555
|
+
try:
|
|
556
|
+
from alembic.config import Config
|
|
557
|
+
from alembic import command
|
|
558
|
+
except ImportError:
|
|
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
|
-
|
|
576
|
-
|
|
577
|
-
with tempfile.NamedTemporaryFile(mode='w', suffix='.ini', delete=False) as tf:
|
|
578
|
-
with open(original_ini_path, 'r') as f:
|
|
579
|
-
content = f.read()
|
|
580
|
-
|
|
581
|
-
# Ensure script_location points to the actual directory (absolute path)
|
|
582
|
-
import re
|
|
583
|
-
content = re.sub(r'^script_location\s*=.*$', f'script_location = {alembic_dir.as_posix()}', content, flags=re.MULTILINE)
|
|
584
|
-
tf.write(content)
|
|
585
|
-
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())
|
|
586
564
|
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
[sys.executable, "-m", "alembic", "-c", temp_ini_path, "upgrade", "head"],
|
|
590
|
-
cwd=pkg_dir,
|
|
591
|
-
env=env
|
|
592
|
-
)
|
|
593
|
-
if result.returncode != 0:
|
|
594
|
-
sys.exit(result.returncode)
|
|
595
|
-
finally:
|
|
596
|
-
if os.path.exists(temp_ini_path):
|
|
597
|
-
os.unlink(temp_ini_path)
|
|
565
|
+
# Run alembic upgrade head
|
|
566
|
+
command.upgrade(alembic_cfg, "head")
|
|
598
567
|
|
|
599
568
|
except Exception as e:
|
|
600
569
|
print(f"Error running migration: {e}")
|
|
Binary file
|
|
Binary file
|
|
File without changes
|
|
File without changes
|
|
File without changes
|