Skip to content

Commit

Permalink
When using pipenv, install packages (such as linters, test frameworks…
Browse files Browse the repository at this point in the history
…) in dev-packages

Fixes #1110
  • Loading branch information
DonJayamanne authored Mar 21, 2018
1 parent 2b4a246 commit 7c3ff8a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions news/1 Enhancements/1110.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
When using pipenv, install packages (such as linters, test frameworks) in dev-packages.
2 changes: 1 addition & 1 deletion src/client/common/installer/pipEnvInstaller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export class PipEnvInstaller implements IModuleInstaller {

public installModule(name: string): Promise<void> {
const terminalService = this.serviceContainer.get<ITerminalServiceFactory>(ITerminalServiceFactory).getTerminalService();
return terminalService.sendCommand(pipenvName, ['install', name]);
return terminalService.sendCommand(pipenvName, ['install', name, '--dev']);
}

public async isSupported(resource?: Uri): Promise<boolean> {
Expand Down
4 changes: 2 additions & 2 deletions src/test/common/moduleInstaller.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ suite('Module Installer', () => {

let argsSent: string[] = [];
mockTerminalService
.setup(async t => await t.sendCommand(TypeMoq.It.isAnyString(), TypeMoq.It.isAny()))
.setup(t => t.sendCommand(TypeMoq.It.isAnyString(), TypeMoq.It.isAny()))
.returns((cmd: string, args: string[]) => { argsSent = args; return Promise.resolve(void 0); });
await pipInstaller.installModule(moduleName);

Expand Down Expand Up @@ -255,6 +255,6 @@ suite('Module Installer', () => {
await pipInstaller.installModule(moduleName);

expect(command!).equal('pipenv', 'Invalid command sent to terminal for installation.');
expect(argsSent.join(' ')).equal(`install ${moduleName}`, 'Invalid command arguments sent to terminal for installation.');
expect(argsSent.join(' ')).equal(`install ${moduleName} --dev`, 'Invalid command arguments sent to terminal for installation.');
});
});

0 comments on commit 7c3ff8a

Please sign in to comment.