Skip to content

Commit 6323a32

Browse files
wjtbrettcannon
authored andcommitted
Detect pipenv by looking for Pipfile, not pipfile (#994)
On platforms with case-sensitive filesystems, like Linux, these are not equivalent. pipenv documents that the file should be called Pipfile[0] and `Pipfile.find()` only finds files matching this exact case[1]. As a result, even if `pipenv --venv` in `cwd` would return success, it will never be run on Linux, and Code never detects the pipenv. (You can work around this with `touch pipfile`.) With this change, it's detected successfully. I believe there's no need to add a backwards-compatibility check for the old case, because on platforms where the old, incorrect check worked, so will the new, correct one. [0] https://docs.pipenv.org/basics/#example-pipfile-pipfile-lock [1] https://github.com/pypa/pipfile/blob/5acb9ac7/pipfile/api.py#L76-L85
1 parent ece0479 commit 6323a32

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/client/interpreter/locators/services/pipEnvService.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ export class PipEnvService extends CacheableLocatorService {
6969

7070
private async getInterpreterPathFromPipenv(cwd: string): Promise<string | undefined> {
7171
// Quick check before actually running pipenv
72-
if (!await this.fs.fileExistsAsync(path.join(cwd, 'pipfile'))) {
72+
if (!await this.fs.fileExistsAsync(path.join(cwd, 'Pipfile'))) {
7373
return;
7474
}
7575
const venvFolder = await this.invokePipenv('--venv', cwd);

0 commit comments

Comments
 (0)