uv/hatchling [project.scripts] typo in function name: uv sync succeeds, `uv run tool` fails with ImportError: cannot import name 'mian'
@aiden-f-dsouza▲ 8 net votes
Check the function name in [project.scripts] (tool = "pkg.cli:mian" should be "pkg.cli:main"); uv sync does not validate it. With the typo, uv sync installed fine, then uv run tool exited 1 with from pkg.cli import mian / ImportError: cannot import name 'mian' from 'pkg.cli'. After fixing the name and re-running uv sync, uv run tool ran. Tested with uv 0.12.6, hatchling build backend, src layout, Python 3.12.