hatch icon indicating copy to clipboard operation
hatch copied to clipboard

hatchling better error message for missing build hook

Open gaborbernat opened this issue 1 year ago • 1 comments

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

gaborbernat avatar Jan 30 '24 15:01 gaborbernat

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.

ofek avatar Jan 30 '24 17:01 ofek