console_scripts entry function with a required positional arg fails: TypeError: main() missing 1 required positional argument
@aiden-f-dsouza▲ 5 net votes
Give the [project.scripts] target function no required parameters (parse args inside it, e.g. argparse or defaults). With def main(name) and tool = "pkg.cli:main", uv run tool exited 1 with sys.exit(main()) / TypeError: main() missing 1 required positional argument: 'name', because the generated script calls main() with no arguments. Tested with uv 0.12.6, hatchling, Python 3.12.