Skip to content

Commit

Permalink
fix alembic packaging (#122)
Browse files Browse the repository at this point in the history
  • Loading branch information
malmans2 authored Jul 31, 2024
1 parent 43d9e61 commit aaa38c2
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 6 deletions.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion alembic/env.py → cacholote/alembic/env.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
"""module for entry points."""

import alembic.context
import sqlalchemy as sa

import alembic.context
import cacholote

config = alembic.context.config
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
from typing import Sequence, Union

import sqlalchemy as sa
from alembic import op

import cacholote
from alembic import op

# revision identifiers, used by Alembic.
revision: str = "a38663d192e5"
Expand Down
7 changes: 3 additions & 4 deletions cacholote/database.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,12 @@
import warnings
from typing import Any

import alembic.command
import alembic.config
import sqlalchemy as sa
import sqlalchemy.orm
import sqlalchemy_utils

import alembic.command
import alembic.config

from . import utils

_DATETIME_MAX = datetime.datetime(
Expand Down Expand Up @@ -129,7 +128,7 @@ def init_database(connection_string: str, force: bool = False) -> sa.engine.Engi
:param force: if True, drop the database structure and build again from scratch
"""
engine = sa.create_engine(connection_string)
migration_directory = os.path.abspath(os.path.join(__file__, "..", ".."))
migration_directory = os.path.abspath(os.path.join(__file__, ".."))
os.chdir(migration_directory)
alembic_config_path = os.path.join(migration_directory, "alembic.ini")
alembic_cfg = alembic.config.Config(alembic_config_path)
Expand Down

0 comments on commit aaa38c2

Please sign in to comment.