I'm working on a project where I need to install all of the Poetry extras to run an automated build. What is the easiest way to get that list as a space-separated list, for use in poetry install --extras="$extras"
?
Some possibilities:
sed
command to get the tool.poetry.extras
section of pyproject.toml and pull out the names would be a hack, and only works if the TOML is nicely and consistently formatted.sed
hack over that.jq
, but I'm not aware of it.Sorry, cannot add as a comment, but probably you could use now
poetry install --all-extras
with newer Poetry version https://python-poetry.org/docs/pyproject/#extras