Skip to content

Use pyproject.toml as Python version source #799

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

Merged
merged 3 commits into from
Oct 16, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Disable Git converting line endings in files
This does the same as setting `core.autocrlf=false` via `git config` or a Git configuration file, but in a manner that
allows that configuration to be distributed, rather than each contributor having their own settings.

The immediate motivation for adding this file is as a workaround for a bug in the "actions/setup-python" action which
causes it to fail spuriously when pyproject.toml is used as the Python versioning source and that file has CRLF line
endings:

```text
Error: Control characters (codes < 0x1f and 0x7f) are not allowed in comments, use \u000d instead at row 10, col 34, pos 211:
 9:
10> # Integration tests dependencies.
                                     ^
11: invoke = "^2.2.0"
```

The GitHub Actions Windows runners hosted by GitHub have `core.autocrlf=false` in their Git configuration, which causes
the "actions/checkout" action step in a workflow to convert the repo's LF line endings to CRLF if the workflow runs on a
Windows runner.

A fix for the "actions/setup-python" action bug has already been made, so this would no longer be a problem once the
next release of the action comes out. However, the conversion of line endings by Git is utterly pointless because any
tool suitable for development work will have absolutely no problem working with LF line endings. The files in the
project have the line endings they do for a reason and Git should not ever modify them. So the addition of this file has
the ongoing benefit of ensuring Git won't be configured for the annoying and potentially harmful line ending conversion
on the contributor's machine.
  • Loading branch information
per1234 committed Oct 16, 2024
commit a98b459968f70e0fe9691f12f088b0e4bec12f0a
4 changes: 4 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# See: https://git-scm.com/docs/gitattributes

# Disable Git converting line endings in files (i.e., core.autocrlf=true).
* -text
Loading