Closed Karmaki closed 4 months ago
Try this:
cat pyproject.toml | tomlq --yaml-output . > pyproject.yaml
cat pyproject.yaml | yq --toml-output . > pyproject.toml
Thank you very much for your answer.
I missed --toml-output
option because it is not listed in my yq --help
, and indeed, cat pyproject.yaml | yq .
is OK, but with --toml-output
, I get:
yq: Error running jq: _ConvertError: Invalid type <class 'NoneType'>.
My version is:
$ yq --version
yq 3.2.3
Maybe this is a new option?
The option is undocumented on purpose. It has been there for as long as TOML support has been there.
Can you paste the contents of your pyproject.toml?
Ah, I think I know what's happening there. You are trying to convert a YAML file with null values into TOML, which does not support them.
Filed #183
I'm going to close this issue since there is no bug that I can identify aside from that.
Sorry for the delay of my answer. Indeed, this was the problem. Thank you very much for your answer and for the new ticket.
I was wondering if there is a way to take a YAML file as input, and output a TOML file? Since you are handling both formats, I thought it should be possible, but if it is, I do not find how.
Thanks in advance for your answer, and thanks for your nice tool.