-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Preserve line breaks in poetry.lock (regression) #7527
Comments
there has been no recent change here, poetry continues to use tomlkit to write its lockfiles. The tomlkit API offers no control so far as I can see over this, so if there's something important to you here you'll need to raise it at that project. python-poetry/tomlkit#200 and python-poetry/tomlkit#201 look like the last time anyone worried about this |
Maybe this has changed actually, perhaps reading the lockfile via tomlkit allowed preservation of the existing line endings where reading it through tomli discards that information. IMO this would be a reason to move further away from tomlkit and write the lockfile with tomli-w (which uses the same line ending on all platforms). |
I don't think that's reason enough. We discussed that we don't want to introduce two libraries for writing toml files if there is not a really good reason. And we are tied to tomlkit for modifying pyproject.toml via
I suppose |
I think the right tomlkit-based-direction would be to add an option to force the line endings - so that poetry could always write the same line endings regardless of platform. ie not even trying to preserve existing line endings. Of course we already discussed the pros and cons of using tomli-w for writing in #6562, eg #6201 is another example of tomlkit being too clever for its own good. But sure: although this issue would seem to count in tomli-w's favour that's not necessarily enough to tip the balance. |
re "two toml-writing libraries": I definitely acknowledge that it would look a little bit weird. On the other hand
No doubt it's possible to work through those bugs while sticking with tomlkit, but for me: I would be comfortable with the above as justification enough to change. |
Those who are developing on both windows and other platforms likely ought to have a suitable |
I develop on all three major operating systems, and I never have to deal with this because I simply only create files with |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
-vvv
option) and have included the output below.Issue
When generating poetry.lock in mixed environments (e.g. Windows and Linux), CRLF gets replaced by LF and vice versa. This had already been reported and supposedly fixed before (#1488), but probably regressed during the introduction of tomli (#6562). I couldn't find any special treatment for line endings of poetry.lock in poetry's code.
The text was updated successfully, but these errors were encountered: