pants
pants copied to clipboard
pants cannot infer package extra from poetry configuration in pyproject.toml
Describe the bug when a poetry_requirement is provided, pants only infer the package on the surface level as dependencies but not package extra, for example, if I provide
[tool.poetry.dependencies]
polars = {extras = ["adbc"],version="^0.20.16"}
only polars with be infered as project dependency, but not adbc. this is confirmed by running pants dependencies
and cause pants test ::
to fail due to missing dependency of adbc
Pants version 2.19.1
OS Linux
Additional info Add any other information about the problem here, such as attachments or links to gists, if relevant.
Shouldn't be too hard to fix. @Sage0614 , want to take a crack at it?
It looks like we do attempt to do something with extras
: https://github.com/pantsbuild/pants/blob/0cada92c46d56dbb0b1870d7af97ba6790d41e30/src/python/pants/backend/python/macros/poetry_requirements.py#L275
So it would require debugging that code to see if and why it's not doing the right thing.
Shouldn't be too hard to fix. @Sage0614 , want to take a crack at it?
I am pretty new to pants, I can try after getting familiar with it, it may take some time.