From be99cd8e8dfa509713680852909ddd23dbaab1f7 Mon Sep 17 00:00:00 2001 From: Erin O'Connell Date: Sat, 20 Apr 2019 21:18:16 -0600 Subject: [PATCH 1/4] if black is being installed, append pre This is so it can be resolved correctly by pipenv --- src/client/common/installer/pipEnvInstaller.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/client/common/installer/pipEnvInstaller.ts b/src/client/common/installer/pipEnvInstaller.ts index 08947cb4cd3c..25a6cf5ab54b 100644 --- a/src/client/common/installer/pipEnvInstaller.ts +++ b/src/client/common/installer/pipEnvInstaller.ts @@ -31,8 +31,12 @@ export class PipEnvInstaller extends ModuleInstaller implements IModuleInstaller return interpreters && interpreters.length > 0; } protected async getExecutionInfo(moduleName: string, _resource?: Uri): Promise { + const args = ['install', moduleName, '--dev']; + if (moduleName === 'black') { + args.push('--pre'); + }; return { - args: ['install', moduleName, '--dev'], + args: args, execPath: pipenvName }; } From 951d3816787e4aedfd420caedb8152ef5a180259 Mon Sep 17 00:00:00 2001 From: Erin O'Connell Date: Sat, 20 Apr 2019 21:34:14 -0600 Subject: [PATCH 2/4] extra extra read all about it! update news --- news/2 Fixes/5171.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 news/2 Fixes/5171.md diff --git a/news/2 Fixes/5171.md b/news/2 Fixes/5171.md new file mode 100644 index 000000000000..22501e6aab49 --- /dev/null +++ b/news/2 Fixes/5171.md @@ -0,0 +1 @@ +Append `--pre` to black installation command so pipenv can properly resolve it. From ee29b046f29cb5905a429cab2fe51c711991cc9d Mon Sep 17 00:00:00 2001 From: Erin O'Connell Date: Sat, 20 Apr 2019 21:48:27 -0600 Subject: [PATCH 3/4] if black is being installed make sure we pass --pre --- src/test/common/installer/moduleInstaller.unit.test.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/test/common/installer/moduleInstaller.unit.test.ts b/src/test/common/installer/moduleInstaller.unit.test.ts index 78a11a2e7d0d..a86cd69bbedd 100644 --- a/src/test/common/installer/moduleInstaller.unit.test.ts +++ b/src/test/common/installer/moduleInstaller.unit.test.ts @@ -217,6 +217,9 @@ suite('Module Installer', () => { test(`Test args (${product.name})`, async () => { setActiveInterpreter(); const expectedArgs = ['install', moduleName, '--dev']; + if (moduleName === 'black') { + expectedArgs.push('--pre') + } await installModuleAndVerifyCommand(pipenvName, expectedArgs); }); } From e53f9061d16467a9ae2d8995a9a5f3cfa0f444e1 Mon Sep 17 00:00:00 2001 From: Don Jayamanne Date: Tue, 23 Apr 2019 09:21:30 -0700 Subject: [PATCH 4/4] Thank author of PR --- news/2 Fixes/5171.md | 1 + 1 file changed, 1 insertion(+) diff --git a/news/2 Fixes/5171.md b/news/2 Fixes/5171.md index 22501e6aab49..daf2063644ff 100644 --- a/news/2 Fixes/5171.md +++ b/news/2 Fixes/5171.md @@ -1 +1,2 @@ Append `--pre` to black installation command so pipenv can properly resolve it. +(thanks [Erin O'Connell](https://github.com/erinxocon))