You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In ini2toml I am trying to keep the transformation 1-to-1 as much as possible (at least for the time being) and avoid loss of information. There are quite a few things that might be redundant or that could be simplified, but they are kept because they were explicitly set on setup.cfg. This relationship between long_description and long_description_content_type is one of them.
The approach I have been following is to ensure that the generated TOML is syntactic correct and semantically equivalent. But since the combination of {TOML language/Core Metadata/PEP 621} has a lot of quirks, it is always possible that the user may want to tweak the outcome to their taste.
That said I would be very happy to consider a PR from the community targeting this aspect. Maybe introducing an opt-in flag like --simplified?
First, thanks for this really useful tool!
Summary
I found a potential bug in pyproject-fmt where it misplaces a
[project.readme]
section inpyproject.toml
leading to an error.It looks like pyproject-fmt wasn't expecting a
[project.readme]
, and rather expected areadme =
under[project]
, which it handles fine.And the
pyproject.toml
was generated by ini2toml from asetup.cfg
using-p setup.cfg
, perhaps it could create the simplerreadme =
instead?Feel free to close this if it's not a good idea!
Details
1.
setup.cfg
topyproject.toml
Start with a minimal-ish
setup.cfg
with a Markdown README:Convert to
pyproject.toml
and validate:Creates this
pyproject.toml
:Note the README is in its own section:
2. Format with pyproject-fmt
Running:
Changes the
pyproject.toml
like this:To this
pyproject.toml
:Note that pyproject-fmt inserts
[project.readme]
right in the middle of the[project]
section:Alternatively
1.
setup.cfg
topyproject.toml
and editThis is likely a pyproject-fmt bug, but if we re-generate
pyproject.toml
:But manually edit the generated
pyproject.toml
and simplify the readme config:(Like pyproject-fmt itself does: https://github.com/tox-dev/pyproject-fmt/blob/e4e90cfa5f3731697673b34067796bbe7c9a8e07/pyproject.toml#L8)
2. Format with pyproject-fmt
This time pyproject-fmt doesn't break the file:
And makes valid edits:
The text was updated successfully, but these errors were encountered: