| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
There was a problem hiding this comment.
This PR improves the readability and functionality when reading the .python-version file by supporting multiple versions, handling pyenv-virtualenv pointers, ignoring comments and empty lines, and trimming whitespace.
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/utils.ts | Renamed and updated function to support multi-line version files and pointer handling. |
| src/setup-python.ts | Updated import and usage to reflect the new function name. |
| tests/utils.test.ts | Added tests for multi-line files and updated expected outcomes. |
Sorry, something went wrong.
| if (line.startsWith('#') || line.trim() === '') { | ||
| return undefined; | ||
| } | ||
| let version: string = line.trim(); |
There was a problem hiding this comment.
[nitpick] Consider caching the result of line.trim() in a variable to avoid calling trim() multiple times within the mapping function.
| if (line.startsWith('#') || line.trim() === '') { | |
| return undefined; | |
| } | |
| let version: string = line.trim(); | |
| const trimmedLine = line.trim(); | |
| if (line.startsWith('#') || trimmedLine === '') { | |
| return undefined; | |
| } | |
| let version: string = trimmedLine; |
Sorry, something went wrong.
|
The relevant changes and improvements proposed here have already been addressed and implemented in PR #787. Hence, this PR is now superseded by #787, which provides a more comprehensive solution for the scenarios discussed. Therefore, we are closing this pull request. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Enhance reading from .python-version file, matching the Pyenv behavior:
(see Don't use .python-version for auto-activation pyenv/pyenv-virtualenv#472)
We extend our thanks to @krystof-k for the valuable contribution in implementing this feature in PR #787. To expedite its availability to users, we have created this PR, which incorporates the same changes while addressing the CI issues that had previously delayed the merge of PR #787.
Check list: