You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When querying poetry config virtualenvs.path, Poetry may return a path containing the {cache-dir} placeholder (e.g., {cache-dir}/virtualenvs). The extension doesn't properly resolve this placeholder.
Current Code
// poetryUtils.ts L157-164const{ stdout }=awaitexec(`"${poetry}" config virtualenvs.path`);if(stdout){constvenvPath=stdout.trim();// Poetry might return the path with placeholders like {cache-dir}// If it doesn't start with / or C:\ etc., assume it's using defaultif(!path.isAbsolute(venvPath)||venvPath.includes('{')){consthome=getUserHomeDir();if(home){poetryVirtualenvsPath=path.join(home,'.cache','pypoetry','virtualenvs');}}
Replace {cache-dir} in the virtualenvs path with the actual cache directory
If cache-dir query fails, use platform-specific defaults
asyncfunctionresolveVirtualenvsPath(poetry: string,virtualenvsPath: string): Promise<string>{if(virtualenvsPath.includes('{cache-dir}')){try{const{ stdout }=awaitexec(`"${poetry}" config cache-dir`);constcacheDir=stdout.trim();returnvirtualenvsPath.replace('{cache-dir}',cacheDir);}catch{// Fall back to platform-specific default cache dirreturnvirtualenvsPath.replace('{cache-dir}',getDefaultCacheDir());}}returnvirtualenvsPath;}
Problem
When querying
poetry config virtualenvs.path, Poetry may return a path containing the{cache-dir}placeholder (e.g.,{cache-dir}/virtualenvs). The extension doesn't properly resolve this placeholder.Current Code
Issue
{cache-dir}is detected, the code falls back to a hardcoded path that's incorrect on Windows (see Poetry: Incorrect default virtualenvs path on Windows and macOS #1182){cache-dir}placeholder should be properly resolved to Poetry's actual cache directoryPET Server Reference
The PET server properly resolves this in
pet-poetry/src/config.rs:Suggested Fix
poetry config cache-dir{cache-dir}in the virtualenvs path with the actual cache directoryAffected File
src/managers/poetry/poetryUtils.ts