From 1d75fe98bc96181a830cca2c4d320f9384a8192c Mon Sep 17 00:00:00 2001 From: =?utf8?q?Vlastimil=20Z=C3=ADma?= Date: Thu, 18 Nov 2021 10:27:15 +0100 Subject: [PATCH] Tweak docs about version_path_separator --- alembic/templates/async/alembic.ini.mako | 8 +++++--- alembic/templates/generic/alembic.ini.mako | 8 +++++--- alembic/templates/multidb/alembic.ini.mako | 8 +++++--- alembic/templates/pylons/alembic.ini.mako | 10 ++++++---- docs/build/branches.rst | 5 +++-- docs/build/tutorial.rst | 12 +++++++++--- 6 files changed, 33 insertions(+), 18 deletions(-) diff --git a/alembic/templates/async/alembic.ini.mako b/alembic/templates/async/alembic.ini.mako index fa44a8f8..9afeb2d2 100644 --- a/alembic/templates/async/alembic.ini.mako +++ b/alembic/templates/async/alembic.ini.mako @@ -35,16 +35,18 @@ prepend_sys_path = . # version location specification; This defaults # to ${script_location}/versions. When using multiple version # directories, initial revisions must be specified with --version-path. -# The path separator used here should be the separator specified by "version_path_separator" +# The path separator used here should be the separator specified by "version_path_separator" below. # version_locations = %(here)s/bar:%(here)s/bat:${script_location}/versions # version path separator; As mentioned above, this is the character used to split -# version_locations. Valid values are: +# version_locations. The default within new alembic.ini files is "os", which uses os.pathsep. +# If this key is omitted entirely, it falls back to the legacy behavior of splitting on spaces and/or commas. +# Valid values for version_path_separator are: # # version_path_separator = : # version_path_separator = ; # version_path_separator = space -version_path_separator = os # default: use os.pathsep +version_path_separator = os # Use os.pathsep. Default configuration used for new projects. # the output encoding used when revision files # are written from script.py.mako diff --git a/alembic/templates/generic/alembic.ini.mako b/alembic/templates/generic/alembic.ini.mako index fa44a8f8..9afeb2d2 100644 --- a/alembic/templates/generic/alembic.ini.mako +++ b/alembic/templates/generic/alembic.ini.mako @@ -35,16 +35,18 @@ prepend_sys_path = . # version location specification; This defaults # to ${script_location}/versions. When using multiple version # directories, initial revisions must be specified with --version-path. -# The path separator used here should be the separator specified by "version_path_separator" +# The path separator used here should be the separator specified by "version_path_separator" below. # version_locations = %(here)s/bar:%(here)s/bat:${script_location}/versions # version path separator; As mentioned above, this is the character used to split -# version_locations. Valid values are: +# version_locations. The default within new alembic.ini files is "os", which uses os.pathsep. +# If this key is omitted entirely, it falls back to the legacy behavior of splitting on spaces and/or commas. +# Valid values for version_path_separator are: # # version_path_separator = : # version_path_separator = ; # version_path_separator = space -version_path_separator = os # default: use os.pathsep +version_path_separator = os # Use os.pathsep. Default configuration used for new projects. # the output encoding used when revision files # are written from script.py.mako diff --git a/alembic/templates/multidb/alembic.ini.mako b/alembic/templates/multidb/alembic.ini.mako index 1f76ab56..80c8d9fb 100644 --- a/alembic/templates/multidb/alembic.ini.mako +++ b/alembic/templates/multidb/alembic.ini.mako @@ -35,16 +35,18 @@ prepend_sys_path = . # version location specification; This defaults # to ${script_location}/versions. When using multiple version # directories, initial revisions must be specified with --version-path. -# The path separator used here should be the separator specified by "version_path_separator" +# The path separator used here should be the separator specified by "version_path_separator" below. # version_locations = %(here)s/bar:%(here)s/bat:${script_location}/versions # version path separator; As mentioned above, this is the character used to split -# version_locations. Valid values are: +# version_locations. The default within new alembic.ini files is "os", which uses os.pathsep. +# If this key is omitted entirely, it falls back to the legacy behavior of splitting on spaces and/or commas. +# Valid values for version_path_separator are: # # version_path_separator = : # version_path_separator = ; # version_path_separator = space -version_path_separator = os # default: use os.pathsep +version_path_separator = os # Use os.pathsep. Default configuration used for new projects. # the output encoding used when revision files # are written from script.py.mako diff --git a/alembic/templates/pylons/alembic.ini.mako b/alembic/templates/pylons/alembic.ini.mako index c7313547..bb425a60 100644 --- a/alembic/templates/pylons/alembic.ini.mako +++ b/alembic/templates/pylons/alembic.ini.mako @@ -35,16 +35,18 @@ prepend_sys_path = . # version location specification; This defaults # to ${script_location}/versions. When using multiple version # directories, initial revisions must be specified with --version-path. -# The path separator used here should be the separator specified by "version_path_separator" +# The path separator used here should be the separator specified by "version_path_separator" below. # version_locations = %(here)s/bar:%(here)s/bat:${script_location}/versions # version path separator; As mentioned above, this is the character used to split -# version_locations. Valid values are: +# version_locations. The default within new alembic.ini files is "os", which uses os.pathsep. +# If this key is omitted entirely, it falls back to the legacy behavior of splitting on spaces and/or commas. +# Valid values for version_path_separator are: # # version_path_separator = : # version_path_separator = ; # version_path_separator = space -version_path_separator = os # default: use os.pathsep +version_path_separator = os # Use os.pathsep. Default configuration used for new projects. # the output encoding used when revision files # are written from script.py.mako @@ -63,4 +65,4 @@ version_path_separator = os # default: use os.pathsep pylons_config_file = ./development.ini -# that's it ! \ No newline at end of file +# that's it ! diff --git a/docs/build/branches.rst b/docs/build/branches.rst index f3e5f4b9..0eed96d1 100644 --- a/docs/build/branches.rst +++ b/docs/build/branches.rst @@ -521,11 +521,12 @@ that module. So to start out, we can edit ``alembic.ini`` to refer to multiple directories; we'll also state the current ``versions`` directory as one of them:: + # A separator for the location paths must be defined first. + version_path_separator = os # Use os.pathsep. # version location specification; this defaults # to foo/versions. When using multiple version # directories, initial revisions must be specified with --version-path - version_path_separator = space - version_locations = %(here)s/model/networking %(here)s/alembic/versions + version_locations = %(here)s/model/networking:%(here)s/alembic/versions The new directory ``%(here)s/model/networking`` is in terms of where the ``alembic.ini`` file is, as we are using the symbol ``%(here)s`` which diff --git a/docs/build/tutorial.rst b/docs/build/tutorial.rst index cf3fe192..fffd0742 100644 --- a/docs/build/tutorial.rst +++ b/docs/build/tutorial.rst @@ -162,16 +162,18 @@ The file generated with the "generic" configuration looks like:: # version location specification; This defaults # to ${script_location}/versions. When using multiple version # directories, initial revisions must be specified with --version-path. - # The path separator used here should be the separator specified by "version_path_separator" + # The path separator used here should be the separator specified by "version_path_separator" below. # version_locations = %(here)s/bar:%(here)s/bat:${script_location}/versions # version path separator; As mentioned above, this is the character used to split - # version_locations. Valid values are: + # version_locations. The default within new alembic.ini files is "os", which uses os.pathsep. + # If this key is omitted entirely, it falls back to the legacy behavior of splitting on spaces and/or commas. + # Valid values for version_path_separator are: # # version_path_separator = : # version_path_separator = ; # version_path_separator = space - version_path_separator = os # default: use os.pathsep + version_path_separator = os # Use os.pathsep. Default configuration used for new projects. # the output encoding used when revision files # are written from script.py.mako @@ -307,6 +309,10 @@ This file contains the following features: allow revisions to exist in multiple directories simultaneously. See :ref:`multiple_bases` for examples. +* ``version_path_separator`` - a separator of ``version_locations`` paths. + It should be defined if multiple ``version_locations`` is used. + See :ref:`multiple_bases` for examples. + * ``output_encoding`` - the encoding to use when Alembic writes the ``script.py.mako`` file into a new migration file. Defaults to ``'utf-8'``. -- 2.47.2