Describe the bug
I'm using Ruff to lint and reformat my code, and I'm trying to get it working as a post-write hook in Alembic, but Ruff is actually written in Rust and is installed as a compiled binary, so it isn't included in importlib metadata as a console-scripts entrypoint, and Alembic throws an "Could not find entrypoint console_scripts.ruff" error.
Expected behavior
There should be an out of the box write hook runner that can execute arbitrary binaries, and not just the console-scripts runner that only supports Python modules' entrypoints.
To Reproduce
Install Ruff:
Confirm that the ruff binary is in path and can be executed:
$ ruff --version
ruff 0.0.278
In alembic.ini:
...
[post_write_hooks]
hooks = ruff
ruff.type = console_scripts
ruff.entrypoint = ruff
ruff.options = --fix REVISION_SCRIPT_FILENAME
...
Error
Generating /srv/app/alembic/versions/2023-07-15_2341_ecc9e22f7cf5_.py ... done
Running post write hook {name!r} ...
FAILED
FAILED: Could not find entrypoint console_scripts.ruff
Versions.
- OS: Debian 12.0
- Python: 3.11.4
- Alembic: 1.11.1
- SQLAlchemy: 2.0.19
- Database: irrelevant
- DBAPI: irrelevant
Additional context
Have a nice day!
Describe the bug
I'm using Ruff to lint and reformat my code, and I'm trying to get it working as a post-write hook in Alembic, but Ruff is actually written in Rust and is installed as a compiled binary, so it isn't included in
importlibmetadata as a console-scripts entrypoint, and Alembic throws an "Could not find entrypoint console_scripts.ruff" error.Expected behavior
There should be an out of the box write hook runner that can execute arbitrary binaries, and not just the
console-scriptsrunner that only supports Python modules' entrypoints.To Reproduce
Install Ruff:
Confirm that the
ruffbinary is in path and can be executed:In
alembic.ini:Error
Versions.
Additional context
Have a nice day!