Skip to content

Commit 1d77ad8

Browse files
committed
fix: Wrap optional dependency in import guard
1 parent 30af34a commit 1d77ad8

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

changelog/297.fix.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix missing dependency in migrations

packages/climate-ref/src/climate_ref/migrations/env.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import alembic_postgresql_enum # noqa
21
from alembic import context, op
32
from loguru import logger
43
from sqlalchemy import Connection, inspect
@@ -9,6 +8,11 @@
98
from climate_ref_core.logging import capture_logging
109
from climate_ref_core.pycmec.controlled_vocabulary import CV
1110

11+
try:
12+
import alembic_postgresql_enum # noqa
13+
except ImportError:
14+
logger.warning("alembic_postgresql_enum not installed, skipping enum migration support")
15+
1216
# Setup logging
1317
capture_logging()
1418
logger.debug("Running alembic env")

0 commit comments

Comments
 (0)