Skip to content

Commit

Permalink
fix(pip-compile): provide filename with cmd (#12433)
Browse files Browse the repository at this point in the history
  • Loading branch information
rarkins committed Nov 1, 2021
1 parent e96d35d commit 2cf8979
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
10 changes: 5 additions & 5 deletions lib/manager/pip-compile/__snapshots__/artifacts.spec.ts.snap
Expand Up @@ -14,7 +14,7 @@ Array [
exports[`manager/pip-compile/artifacts returns null if unchanged 1`] = `
Array [
Object {
"cmd": "pip-compile",
"cmd": "pip-compile requirements.in",
"options": Object {
"cwd": "/tmp/github/some/repo",
"encoding": "utf-8",
Expand All @@ -37,7 +37,7 @@ Array [
exports[`manager/pip-compile/artifacts returns updated requirements.txt 1`] = `
Array [
Object {
"cmd": "pip-compile",
"cmd": "pip-compile requirements.in",
"options": Object {
"cwd": "/tmp/github/some/repo",
"encoding": "utf-8",
Expand All @@ -60,7 +60,7 @@ Array [
exports[`manager/pip-compile/artifacts returns updated requirements.txt when doing lockfile maintenance 1`] = `
Array [
Object {
"cmd": "pip-compile",
"cmd": "pip-compile requirements.in",
"options": Object {
"cwd": "/tmp/github/some/repo",
"encoding": "utf-8",
Expand Down Expand Up @@ -95,7 +95,7 @@ Array [
},
},
Object {
"cmd": "docker run --rm --name=renovate_python --label=renovate_child -v \\"/tmp/github/some/repo\\":\\"/tmp/github/some/repo\\" -v \\"/tmp/renovate/cache\\":\\"/tmp/renovate/cache\\" -w \\"/tmp/github/some/repo\\" renovate/python bash -l -c \\"pip install --user pip-tools && pip-compile\\"",
"cmd": "docker run --rm --name=renovate_python --label=renovate_child -v \\"/tmp/github/some/repo\\":\\"/tmp/github/some/repo\\" -v \\"/tmp/renovate/cache\\":\\"/tmp/renovate/cache\\" -w \\"/tmp/github/some/repo\\" renovate/python bash -l -c \\"pip install --user pip-tools && pip-compile requirements.in\\"",
"options": Object {
"cwd": "/tmp/github/some/repo",
"encoding": "utf-8",
Expand Down Expand Up @@ -130,7 +130,7 @@ Array [
},
},
Object {
"cmd": "docker run --rm --name=renovate_python --label=renovate_child -v \\"/tmp/github/some/repo\\":\\"/tmp/github/some/repo\\" -v \\"/tmp/renovate/cache\\":\\"/tmp/renovate/cache\\" -w \\"/tmp/github/some/repo\\" renovate/python bash -l -c \\"pip install --user pip-tools1.2.3 && pip-compile\\"",
"cmd": "docker run --rm --name=renovate_python --label=renovate_child -v \\"/tmp/github/some/repo\\":\\"/tmp/github/some/repo\\" -v \\"/tmp/renovate/cache\\":\\"/tmp/renovate/cache\\" -w \\"/tmp/github/some/repo\\" renovate/python bash -l -c \\"pip install --user pip-tools1.2.3 && pip-compile requirements.in\\"",
"options": Object {
"cwd": "/tmp/github/some/repo",
"encoding": "utf-8",
Expand Down
7 changes: 4 additions & 3 deletions lib/manager/pip-compile/artifacts.ts
@@ -1,5 +1,6 @@
import is from '@sindresorhus/is';
import { quote as pipCompile } from 'shlex';
import { quote } from 'shlex';
import { parse } from 'upath';
import { TEMPORARY_ERROR } from '../../constants/error-messages';
import { logger } from '../../logger';
import { ExecOptions, exec } from '../../util/exec';
Expand Down Expand Up @@ -57,7 +58,7 @@ export async function updateArtifacts({
if (config.isLockFileMaintenance) {
await deleteLocalFile(outputFileName);
}
const cmd = 'pip-compile';
const cmd = `pip-compile ${quote(parse(inputFileName).base)}`;
const tagConstraint = getPythonConstraint(config);
const pipToolsConstraint = getPipToolsConstraint(config);
const execOptions: ExecOptions = {
Expand All @@ -67,7 +68,7 @@ export async function updateArtifacts({
tagConstraint,
tagScheme: 'pep440',
preCommands: [
`pip install --user ${pipCompile(`pip-tools${pipToolsConstraint}`)}`,
`pip install --user ${quote(`pip-tools${pipToolsConstraint}`)}`,
],
},
};
Expand Down

0 comments on commit 2cf8979

Please sign in to comment.