Skip to content

'alembic history' ignores env.py #447

@sqlalchemy-bot

Description

@sqlalchemy-bot

Migrated issue, originally created by rkrzr (@rkrzr)

We rely on env.py to set the correct PYTHONPATH, so that we can import our modules in an alembic migration. This works for all commands (e.g. alembic current, alembic upgrade, alembic downgrade), except for alembic history.

For alembic history it fails with: ModuleNotFoundError: No module named 'bla'

It seems that alembic history does not read in env.py.

The workaround for this is to run PYTHONPATH=. alembic history, which works correctly.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions