Skip to content

Commit 9a9cb66

Browse files
authored
Add more misspellings to the .python-version filename check (#2051)
Based on misspellings seen in Honeycomb, that affected more than one app. Having this fixed list of misspellings isn't ideal (given there will be a long tail of misspellings not on it), however, short term it allows us to offer a very specific error message so the majority of apps are fixed by their owners, whilst still maintaining a low false positive rate (vs a looser regex). Longer term we'll likely be making the `.python-version` file mandatory, at which point the error message for that can list out the files in the app source root (the same way we do for detection errors), which will help with the long tail cases. (We can also do things like replace unicode or stray whitespace in the file listing, to make those confusing for the user cases easier to spot too.) GUS-W-21320154.
1 parent 108a416 commit 9a9cb66

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
- Updated uv from 0.10.7 to 0.10.9. ([#2049](https://github.com/heroku/heroku-buildpack-python/pull/2049))
66
- Switched to downloading uv from `releases.astral.sh` instead of GitHub releases. ([#2050](https://github.com/heroku/heroku-buildpack-python/pull/2050))
7+
- Updated the check for misspelled `.python-version` files with additional misspellings seen in the wild. ([#2051](https://github.com/heroku/heroku-buildpack-python/pull/2051))
78

89
## [v338] - 2026-03-03
910

lib/python_version.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,12 @@ PYTHON_FULL_VERSION_REGEX="${INT_REGEX}\.${INT_REGEX}\.${INT_REGEX}"
2525

2626
# Misspellings of the `.python-version` file seen in the wild.
2727
MISSPELLED_PYTHON_VERSION_FILE_NAMES=(
28+
" .python-version"
29+
". python-version"
2830
".python_version.txt"
2931
".python_version"
3032
".python-version "
33+
",python-version"
3134
".python-version."
3235
".python-version.py"
3336
".python-version.rtf"

0 commit comments

Comments
 (0)