Relative path for script_location in alembic.ini #1628
-
Hi team! 👋 I've encountered some surprising behaviour while working with I have collection of alembic directories each with their own path_to_ini_file = Path(...) / "alembic.ini"
config = Config(path_to_ini_file)
script_dir = ScriptDirectory.from_config(config)
heads = script_dir.get_heads() However, I noticed that
It was looking into My workaround was path_to_migration_directory = Path(...) # where the versions/ folder lives
config = Config()
config.set_main_option("script_location", str(path_to_migration_directory.resolve()))
script_dir = ScriptDirectory.from_config(config)
heads = script_dir.get_heads() I tracked it down to this line which leads to setting |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
oh, I've never heard of systems assuming the absolute location of the ini file is where "." should be. as documented we support the
it's not a dot but that will give you the absolute path of where your .ini file is. |
Beta Was this translation helpful? Give feedback.
oh, I've never heard of systems assuming the absolute location of the ini file is where "." should be. as documented we support the
%(here)s
symbol, which is how this is set explicitly for .ini files:it's not a dot but that will give you the absolute path of where your .ini file is.