]> git.ipfire.org Git - thirdparty/sqlalchemy/alembic.git/commit
allow pep 621 configuration
authorMike Bayer <mike_mp@zzzcomputing.com>
Tue, 13 May 2025 14:14:10 +0000 (10:14 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Mon, 19 May 2025 13:27:02 +0000 (09:27 -0400)
commita52a18f7f7d34148d869de442c9b448809c49672
tree8bf26e7bc804ab8d84feaf20795870d24d435b32
parent9913fdb8e20262ccbc34f715b044d36b4be8b5ad
allow pep 621 configuration

Added optional :pep:`621` support to Alembic, where a subset of the
project-centric configuration normally found in the ``alembic.ini`` file
can now be retrieved from the project-wide ``pyproject.toml`` file.   A new
init template ``pyproject`` is added which illustrates a basic :pep:`621`
setup.  The :pep:`621` feature supports configuration values that are
relevant to code locations and code production only; it does not
accommodate database connectivity, configuration, or logging configuration.
These latter configurational elements remain as elements that can be
present either in the ``alembic.ini`` file, or retrieved elsewhere within
the ``env.py`` file.   The change also allows the ``alembic.ini`` file to
be completely optional if the ``pyproject.toml`` file contains a base
alembic configuration section.

Fixes: #1082
Change-Id: I7c6d1e68eb570bc5273e3500a17b342dfbd69d1b
25 files changed:
alembic/command.py
alembic/config.py
alembic/script/base.py
alembic/script/write_hooks.py
alembic/templates/async/alembic.ini.mako
alembic/templates/generic/alembic.ini.mako
alembic/templates/multidb/alembic.ini.mako
alembic/templates/pyproject/README [new file with mode: 0644]
alembic/templates/pyproject/alembic.ini.mako [new file with mode: 0644]
alembic/templates/pyproject/env.py [new file with mode: 0644]
alembic/templates/pyproject/pyproject.toml.mako [new file with mode: 0644]
alembic/templates/pyproject/script.py.mako [new file with mode: 0644]
alembic/testing/__init__.py
alembic/testing/env.py
alembic/testing/fixtures.py
alembic/util/__init__.py
alembic/util/compat.py
alembic/util/pyfiles.py
docs/build/autogenerate.rst
docs/build/cookbook.rst
docs/build/tutorial.rst
docs/build/unreleased/1082.rst [new file with mode: 0644]
pyproject.toml
tests/test_command.py
tests/test_post_write.py