[+] improve alembic
This commit is contained in:
parent
eb2d630dd0
commit
2dec1e33c2
3
deps/test-task-2025-06-30-v1/Makefile
vendored
3
deps/test-task-2025-06-30-v1/Makefile
vendored
@ -1,4 +1,5 @@
|
|||||||
ENV_PATH ?= .venv
|
ENV_PATH ?= .venv
|
||||||
|
PYTHON_PATH = $(ENV_PATH)/bin/python3
|
||||||
PYTHON_VERSION ?= 3.10
|
PYTHON_VERSION ?= 3.10
|
||||||
UV_ARGS ?= --offline
|
UV_ARGS ?= --offline
|
||||||
DOCKER ?= podman
|
DOCKER ?= podman
|
||||||
@ -33,7 +34,7 @@ venv:
|
|||||||
pyright:
|
pyright:
|
||||||
$(ENV_PATH)/bin/python3 -m pyright \
|
$(ENV_PATH)/bin/python3 -m pyright \
|
||||||
-p pyproject.toml \
|
-p pyproject.toml \
|
||||||
-v $(ENV_PATH)
|
--pythonpath $(PYTHON_PATH)
|
||||||
|
|
||||||
|
|
||||||
compose_env:
|
compose_env:
|
||||||
|
1
deps/test-task-2025-06-30-v1/pyproject.toml
vendored
1
deps/test-task-2025-06-30-v1/pyproject.toml
vendored
@ -33,6 +33,7 @@ build-backend = 'setuptools.build_meta'
|
|||||||
|
|
||||||
[tool.alembic]
|
[tool.alembic]
|
||||||
script_location = 'python/online/fxreader/pr34/test_task_2025_06_30_v1/tickers/alembic'
|
script_location = 'python/online/fxreader/pr34/test_task_2025_06_30_v1/tickers/alembic'
|
||||||
|
prepend_sys_path = ['python']
|
||||||
|
|
||||||
[tool.ruff]
|
[tool.ruff]
|
||||||
line-length = 160
|
line-length = 160
|
||||||
|
@ -27,6 +27,8 @@ target_metadata = None
|
|||||||
|
|
||||||
|
|
||||||
def run_migrations_offline() -> None:
|
def run_migrations_offline() -> None:
|
||||||
|
from online.fxreader.pr34.test_task_2025_06_30_v1.tickers.settings import Settings
|
||||||
|
|
||||||
"""Run migrations in 'offline' mode.
|
"""Run migrations in 'offline' mode.
|
||||||
|
|
||||||
This configures the context with just a URL
|
This configures the context with just a URL
|
||||||
@ -38,7 +40,9 @@ def run_migrations_offline() -> None:
|
|||||||
script output.
|
script output.
|
||||||
|
|
||||||
"""
|
"""
|
||||||
url = config.get_main_option("sqlalchemy.url")
|
# url = config.get_main_option("sqlalchemy.url")
|
||||||
|
url = Settings.singleton().db_url
|
||||||
|
|
||||||
context.configure(
|
context.configure(
|
||||||
url=url,
|
url=url,
|
||||||
target_metadata=target_metadata,
|
target_metadata=target_metadata,
|
||||||
|
Loading…
Reference in New Issue
Block a user