]> git.ipfire.org Git - thirdparty/sqlalchemy/alembic.git/commit
Add "module" post-write hook
authorFrazer McLean <frazer@frazermclean.co.uk>
Tue, 8 Jul 2025 15:01:43 +0000 (11:01 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Tue, 8 Jul 2025 17:59:33 +0000 (13:59 -0400)
commit7fd2b1fc8a78d0d787277cf51db861444f4332d7
tree92e46648de52e467a0d91034bf801b008a5e134d
parent7c84327e2c02b1fe7f8336d63dc7c8a89b609870
Add "module" post-write hook

This hook type is almost identical to the console_scripts hook, except
it's running `python -m black` instead of using black's console_script.

It is mainly useful for tools without console scripts (e.g. ruff), but
has semantics closer to the console_scripts hook in that it finds the
ruff module available to the running interpreter instead of finding
an executable by path.

Pull request courtesy Frazer McLean.

Fixes: #1686
Closes: #1687
Pull-request: https://github.com/sqlalchemy/alembic/pull/1687
Pull-request-sha: 54d29c34642d88e88ab29e46fa4022d227f8aa60
Change-Id: I804a1a7d3f6423ba23bc556b7f4024c401a8787e
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/pyproject.toml.mako
alembic/templates/pyproject_async/pyproject.toml.mako
docs/build/autogenerate.rst
docs/build/tutorial.rst
docs/build/unreleased/1686.rst [new file with mode: 0644]
tests/test_post_write.py