]> git.ipfire.org Git - thirdparty/sqlalchemy/alembic.git/commit
Implement sys_path_prepend option
authorMike Bayer <mike_mp@zzzcomputing.com>
Sat, 20 Feb 2021 20:48:58 +0000 (15:48 -0500)
committerMike Bayer <mike_mp@zzzcomputing.com>
Sat, 20 Feb 2021 21:32:36 +0000 (16:32 -0500)
commitd6b0c1af3df98b50c6ec52781aa411592c4e0c32
treeb36b324cf2578c7cc26653d1f6b6934ae19586ea
parent490d9fa42b095cedb17abee17a063ee108992959
Implement sys_path_prepend option

Added new config file option ``prepend_sys_path``, which is a series of
paths that will be prepended to sys.path; the default value in newly
generated alembic.ini files is ".".  This fixes a long-standing issue
where for some reason running the alembic command line would not place the
local "." path in sys.path, meaning an application locally present in "."
and importable through normal channels, e.g. python interpreter, pytest,
etc. would not be located by Alembic, even though the ``env.py`` file is
loaded relative to the current path when ``alembic.ini`` contains a
relative path.

Change-Id: If8f4279bd862acca44d46f4b1ab90b0a18098af3
Fixes: #797
alembic/script/base.py
alembic/templates/generic/alembic.ini.mako
alembic/templates/multidb/alembic.ini.mako
alembic/templates/pylons/alembic.ini.mako
docs/build/front.rst
docs/build/tutorial.rst
docs/build/unreleased/797.rst [new file with mode: 0644]
tests/test_environment.py