Skip to content

Commit 3008532

Browse files
brettcannonDonJayamanne
authored andcommitted
Cherry-pick Pipfile detection fix for 2018.2.1 (#1002)
* 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 * Prep for 2018.2.1
1 parent 3f777f6 commit 3008532

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# Changelog
22

3+
## 2018.2.1 (09 Mar 2018)
4+
5+
### Fixes
6+
7+
1. Check for `Pipfile` and not `pipfile` when looking for pipenv usage
8+
(thanks to [Will Thompson for the fix](https://github.com/wjt))
9+
310
## 2018.2.0 (08 Mar 2018)
411

512
[Release pushed by one week]

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "python",
33
"displayName": "Python",
44
"description": "Linting, Debugging (multi-threaded, remote), Intellisense, code formatting, refactoring, unit tests, snippets, and more.",
5-
"version": "2018.2.0",
5+
"version": "2018.2.1",
66
"publisher": "ms-python",
77
"author": {
88
"name": "Microsoft Corporation"

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)