fix(release): write pyproject.toml with LF newlines

bump.py wrote via Python text mode, which translated newlines to CRLF on Windows and produced a 'CRLF will be replaced by LF' warning on every release. Write with newline='' so the file stays LF, matching .gitattributes.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-06-06 12:17:32 -04:00
parent f2c94b3f71
commit 667882995a

View File

@@ -62,7 +62,10 @@ def main(argv: list[str] | None = None) -> int:
print("Dry run - pyproject.toml not modified.") print("Dry run - pyproject.toml not modified.")
return 0 return 0
repo.PYPROJECT.write_text(set_version(repo.PYPROJECT.read_text("utf-8"), str(new_version))) updated = set_version(repo.PYPROJECT.read_text("utf-8"), str(new_version))
# newline="" writes the string's "\n"s verbatim (LF), instead of translating to the
# platform default (CRLF on Windows) — keeps pyproject.toml LF, matching .gitattributes.
repo.PYPROJECT.write_text(updated, encoding="utf-8", newline="")
print(f"Updated {repo.PYPROJECT.name} to version {new_version}.") print(f"Updated {repo.PYPROJECT.name} to version {new_version}.")
print( print(
f"Next: draft release notes (/release-notes), review CHANGELOG.md, then\n" f"Next: draft release notes (/release-notes), review CHANGELOG.md, then\n"