hatch
hatch copied to clipboard
hatchling better error message for missing build hook
Currently, this is the error message:
[2024-01-30T05:01:48.201Z] File "/tmp/pip-build-env-1oyn1dg3/overlay/lib/python3.11/site-packages/hatchling/builders/hooks/custom.py", line 33, in __new__
[2024-01-30T05:01:48.201Z] raise OSError(message)
[2024-01-30T05:01:48.201Z] OSError: Build script does not exist: hatch_build.py
It would be nice if the message contains the path is looking into, and what files are found there. This is especially in the CI failures would be very helpful.
OSError: Build script does not exist: hatch_build.py inside tmp/pip-build-env-1oyn1dg3/magic found pyproject.toml, src, tests
FYI the relative path to that script is configurable and merely defaults to hatch_build.py.
I suppose I don't have any objections to making it more informative however it might be better to say in the message something about being relative to the project root instead.