Fix platform-specific default virtualenvs path for Poetry on Windows and macOS#1213
Fix platform-specific default virtualenvs path for Poetry on Windows and macOS#1213
Conversation
On Windows, Poetry stores virtualenvs in %LOCALAPPDATA%\pypoetry\Cache\virtualenvs (or %APPDATA%\pypoetry\Cache\virtualenvs). On macOS, it uses ~/Library/Caches/pypoetry/virtualenvs. The previous code hardcoded the Linux path (~/.cache/pypoetry/virtualenvs) for all platforms. Extract getDefaultPoetryVirtualenvsPath() to return the correct platform-specific path and use it in all 3 locations that previously had the hardcoded Linux path. Co-authored-by: karthiknadig <3840081+karthiknadig@users.noreply.github.com>
There was a problem hiding this comment.
The core fix is correct and well-implemented. The new getDefaultPoetryVirtualenvsPath() function properly handles platform-specific paths for Windows, macOS, and Linux.
Note: The PR includes unrelated package-lock.json changes (adding "peer": true to many packages). Consider reverting those before merging.
cc @copilot
| const result = getDefaultPoetryVirtualenvsPath(); | ||
|
|
||
| assert.strictEqual(result, undefined); | ||
| }); |
There was a problem hiding this comment.
Consider also testing when getUserHomeDir() returns undefined (not just empty string ''), since that's also a possible return value from that function.
There was a problem hiding this comment.
Added a test for getUserHomeDir() returning undefined in 7b16f74.
|
@copilot please address review comments |
Co-authored-by: karthiknadig <3840081+karthiknadig@users.noreply.github.com>
Reverted the unrelated |
getDefaultPoetryVirtualenvsPath()helper function inpoetryUtils.tsthat returns the platform-specific default path for Poetry virtualenvsgetDefaultPoetryVirtualenvsPath()function (7 tests, all passing)package-lock.jsonchangesgetUserHomeDir()returningundefinedOriginal prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.