Closed adamtheturtle closed 4 months ago
I think let's remove it, PR welcome.
Does this mean that developers using the API should use https://github.com/tox-dev/pyproject-fmt-rust instead (I understand that one is currently undocumented but supposedly that is a WIP)?
What's your use case?
For now, I would like to be able to run pyproject-fmt
(with its default configurations) on a str
variable from inside my Python code, without having to subprocess or create temporary files.
That is used in ini2toml
to simply create a pyproject.toml
file with the default formatting provided by pyproject-fmt
.
Previously I was running
from pyproject_fmt import Config, format_pyproject
..
format_pyproject(Config(Path("pyproject.toml"), text))
The rust package has no defaults. Today, your best chance would be to just do a sub process call. We could expose an endpoint for this functionality though. PR welcome 🤗
OK, I think in this case that might be a regression on https://github.com/tox-dev/pyproject-fmt/issues/3? (not really a regresion because there was a major version bump, but a removal of a feature previously implemented).
We changed the interface, so the new API would also need to look differently.
Thanks @gaborbernat, I will give another go at reimplementing the feature with a new look.
So if I understand this correctly you are not really interested in the fancy diff or check functionality. You just want to format the file after generating it with no output, Yes?
Yes, more or less.
I am more interested in formatting the string before saving the file (avoiding to touch the disk would be a big plus for me).
Visit https://pyproject-fmt.readthedocs.io/en/latest/#module-pyproject_fmt, see:
This section should either be removed or changed to explain an API.