Title: Infer Python version from `.python-version` file when no backend is set by Copilot · Pull Request #1802 · usethis-python/usethis-python · GitHub
Open Graph Title: Infer Python version from `.python-version` file when no backend is set by Copilot · Pull Request #1802 · usethis-python/usethis-python
X Title: Infer Python version from `.python-version` file when no backend is set by Copilot · Pull Request #1802 · usethis-python/usethis-python
Description: When no package manager backend is active and requires-python is absent or yields no matches, usethis was unconditionally falling back to the running interpreter version. This ignores projects that pin their Python version via a .python-version file. Changes PythonVersion.from_python_version_file(path) — new classmethod on PythonVersion that reads and parses a .python-version file, raising FileNotFoundError or PythonVersionParseError on failure. _get_current_python_version() — new private helper in environ/python.py that prefers .python-version (project root) and falls back to the running interpreter only when the file is absent or unparseable. get_supported_minor_python_versions() — all three PythonVersion.from_interpreter() call sites replaced with _get_current_python_version(), covering the no-requires-python, empty-match, and out-of-bounds warning paths. Warning message updated from "Current Python interpreter" to "Current Python version" to reflect the broader source. Step-down rule fix — _get_current_python_version is placed above its caller per the project's step-down convention (follow-up commit).
Open Graph Description: When no package manager backend is active and requires-python is absent or yields no matches, usethis was unconditionally falling back to the running interpreter version. This ignores projects that...
X Description: When no package manager backend is active and requires-python is absent or yields no matches, usethis was unconditionally falling back to the running interpreter version. This ignores projects that...
Opengraph URL: https://github.com/usethis-python/usethis-python/pull/1802
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:0798c98f-0de2-7010-2b51-63138a6a3828 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | C22E:38C5EF:4FBBD1:6C28D7:6A4D3DEF |
| html-safe-nonce | 4401dd629975962496623eb5bf2ecbf35aa617de1f55468bf368b017376f1e15 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDMjJFOjM4QzVFRjo0RkJCRDE6NkMyOEQ3OjZBNEQzREVGIiwidmlzaXRvcl9pZCI6IjYzMzg2NjQ4NjA2NjY5MDQwNDciLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 36945714a5d1354ba98a63257a97bee259c144147495745c8a390e8e68b5eb1e |
| hovercard-subject-tag | pull_request:3487971264 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/usethis-python/usethis-python/pull/1802/files |
| twitter:image | https://avatars.githubusercontent.com/in/1143301?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/in/1143301?s=400&v=4 |
| og:image:alt | When no package manager backend is active and requires-python is absent or yields no matches, usethis was unconditionally falling back to the running interpreter version. This ignores projects that... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 92571a8944142227b7e19cd10918b1ddd06e5066c1ad5bc7e4769cf6140a87e6 |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/usethis-python/usethis-python git https://github.com/usethis-python/usethis-python.git |
| octolytics-dimension-user_id | 216362695 |
| octolytics-dimension-user_login | usethis-python |
| octolytics-dimension-repository_id | 842189705 |
| octolytics-dimension-repository_nwo | usethis-python/usethis-python |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 842189705 |
| octolytics-dimension-repository_network_root_nwo | usethis-python/usethis-python |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 56fc8347865a14e2ec811533d68f929cf4e0ec19 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width