A question on the poetry_requirements macro. Is th...
# general
g
A question on the poetry_requirements macro. Is there a way for pants to ignore dev-dependencies in project.toml?
h
Not currently, but it would be reasonable and not super hard to add a field to it called
dev_dependencies
, with a default to True. Any interest in adding that? If so, I'm happy to give some thoughts on how to implement it
g
Sure. Sounds a fun task if I am bored during the holiday.
h
Cool! So you'd add a
BoolField
subclass in src/python/pants/backend/python/macros/poetry_requirements.py with a default to True. https://www.pantsbuild.org/docs/target-api-new-fields talks about how to add a new field Then it looks like you'll want to modify the function
parse_poetry_requirements
to take an argument for whether to include dev dependencies. With this line
parse_requirements_callback=partial(parse_poetry_requirements, build_root),
, you'll want to add to the args something like
dev_dependencies=request.generator[MyNewField].value