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:
@@ -62,7 +62,10 @@ def main(argv: list[str] | None = None) -> int:
|
||||
print("Dry run - pyproject.toml not modified.")
|
||||
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"Next: draft release notes (/release-notes), review CHANGELOG.md, then\n"
|
||||
|
||||
Reference in New Issue
Block a user