Skip to content

Commit

Permalink
Support uv
Browse files Browse the repository at this point in the history
  • Loading branch information
shirayu committed Sep 21, 2024
1 parent 738992a commit 0e983bc
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/configSettings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,15 @@ export class PythonSettings implements IPythonSettings {
return pythonBinFromPath(process.env.CONDA_PREFIX);
}

// uv creates `.python-version` and `.venv`
let p = path.join(this.workspaceRoot, 'uv.lock');
const p2 = path.join(this.workspaceRoot, '.venv');
if (fs.existsSync(p) && fs.existsSync(p2)) {
return pythonBinFromPath(p2);
}

// `pyenv local` creates `.python-version`, but not `PYENV_VERSION`
let p = path.join(this.workspaceRoot, '.python-version');
p = path.join(this.workspaceRoot, '.python-version');
if (fs.existsSync(p)) {
if (!process.env.PYENV_VERSION) {
// pyenv local can special multiple Python, use first one only
Expand Down

0 comments on commit 0e983bc

Please sign in to comment.