https://pantsbuild.org/ logo
#general
Title
# general
f

future-oxygen-10553

08/05/2022, 3:45 PM
From my thread yesterday I’m working on a
pep621_requirements
target. I’ve more-or-less copied the code for
poetry_requirements
and changed a few names, and where the parser looks for the dependencies in the
pyproject.toml
file
😎 2
I’ve got a
ValueError
:
ValueError: The value pyproject.toml must be wrapped in an iterable (e.g. a list).
Although I suspect it’s from the instantiation of the
Address
.
I have no idea why this wouldn’t work, if
poetry_requirements
works… I can’t see anything I’ve changed that would result in this particular error
The final exception that’s raised is
Copy code
InvalidFieldTypeException: The 'sources' field in target src/experiment_service/pyproject.toml:experiment_service_requirements must be an iterable of strings (e.g. a list of strings), but was `'pyproject.toml'` with type `str`.
p

proud-dentist-22844

08/05/2022, 4:44 PM
I’m so excited to see
pep621_requirements
. I would love to get away from requirements.txt files.
❤️ 1
h

happy-kitchen-89482

08/05/2022, 4:46 PM
Hey @future-oxygen-10553, can you post your work-in-progress to a repo we can clone and look at? That would be the easiest way to debug
f

future-oxygen-10553

08/05/2022, 5:01 PM
Sure thing
p

proud-dentist-22844

08/05/2022, 5:14 PM
That exception suggests that you have
sources="pyproject.toml"
instead of
sources=["pyproject.toml"]
. Maybe check your default value to make sure it is a list or tuple.
1
h

hundreds-father-404

08/05/2022, 5:16 PM
You probably want to use
SingleSourceField
also, so it's
source="pyproject.toml"
p

proud-dentist-22844

08/05/2022, 7:44 PM
Eventually (in v2.0), Poetry will support PEP 621 as well: https://twitter.com/SDisPater/status/1521932867214921728
❤️ 2
5 Views