Feature Request
Could poetry please handle typos/errors in tool.poetry.packages better?
If you make a typo or another error in specifying packages to include into your package and the modules specified in pyproject.toml don't exist, you'll get a very user-unfriendly message:
$ poetry build
Building dummy_package (1.49.1)
[IndexError]
list index out of range
Let's say you have a package called dummy_package and in it you have python modules dummy1 and dummy2 you want to include into the package. Then you'd like to put this into your pyproject.toml:
packages = [
{ include = "dummy1" },
{ include = "dummy2" },
]
If instead you make a mistake and have e.g. this there:
packages = [
{ include = "dumny1" },
{ include = "dumny2" },
]
You ge tthe above mentioned error which is very confusing and not helpful at all.
The error happens because you mention a module that doesn't exist in your project directory. The actual error happens in method check_elements() (specifically on line 37 in current master) in poetry/masonry/utils/package_include.py but I think it might be detectable in poetry/masonry/utils/include.py where it tries to expand the path. Maybe there it could issue a warning or something?
The issue was mentioned e.g. in #1247 but that issue is closed and I'd like this to get a little more attention as I spent a few hours debugging this.
Thank you!
Feature Request
Could poetry please handle typos/errors in
tool.poetry.packagesbetter?If you make a typo or another error in specifying packages to include into your package and the modules specified in pyproject.toml don't exist, you'll get a very user-unfriendly message:
Let's say you have a package called dummy_package and in it you have python modules dummy1 and dummy2 you want to include into the package. Then you'd like to put this into your pyproject.toml:
If instead you make a mistake and have e.g. this there:
You ge tthe above mentioned error which is very confusing and not helpful at all.
The error happens because you mention a module that doesn't exist in your project directory. The actual error happens in method
check_elements()(specifically on line 37 in current master) inpoetry/masonry/utils/package_include.pybut I think it might be detectable inpoetry/masonry/utils/include.pywhere it tries to expand the path. Maybe there it could issue a warning or something?The issue was mentioned e.g. in #1247 but that issue is closed and I'd like this to get a little more attention as I spent a few hours debugging this.
Thank you!