Add file_path_separator to apply to all path splitting
Added new option to the ConfigParser config (typically via ``alembic.ini``)
``path_separator``. This new option supersedes the previous similar
option ``version_path_separator``. The new ``path_separator`` option
applies to the path splitting mechanism of both the ``version_locations``
option as well as the ``prepend_sys_path`` option, and in newly
rendered ``alembic.ini`` files will use the value ``os``, which means to
use the operating system path separator when splitting these string values
into a list of paths.
The new attribute applies necessary os-dependent path splitting to the
``prepend_sys_path`` option so that windows paths which contain drive
letters with colons are not inadvertently split, whereas previously
os-dependent path splitting were only available for the
``version_locations`` option.
Existing installations that do not have ``path_separator`` present
will continue to make use of ``version_path_separator`` when parsing the
``version_locations`` option, or splitting on spaces / commas if
``version_path_separator`` is also not present. ``prepend_sys_path`` will
continue to be split on spaces/commas/colons if ``path_separator`` is
not present. Under all of these fallback conditions, a deprecation
warning is now emitted encouraging to set ``path_separator``.
Pull request courtesy Mike Werezak.
This change also begins to move some of the role of interpreting
of specific config options into the Config object. This process will
continue as we look to add toml support to config.
Co-authored-by: Mike Bayer <mike_mp@zzzcomputing.com>
Fixes: #1330
Closes: #1331
Pull-request: https://github.com/sqlalchemy/alembic/pull/1331
Pull-request-sha:
f16b35d69acddd046cbba8f28e46219c872c151d
Change-Id: Idef47e8a6947210f1eb63c3d16c4be553effa3a2