Skip to content
Snippets Groups Projects
Unverified Commit 591b572e authored by Michael Kriese's avatar Michael Kriese Committed by GitHub
Browse files

feat(pip_requirements): allow override hashin constraints (#26037)

parent 4b7a5e7b
No related branches found
No related tags found
No related merge requests found
......@@ -23,7 +23,9 @@ const adminConfig: RepoGlobalConfig = {
containerbaseDir: join('/tmp/renovate/cache/containerbase'),
};
const config: UpdateArtifactsConfig = { constraints: { python: '3.10.2' } };
const config: UpdateArtifactsConfig = {
constraints: { python: '3.10.2', hashin: '0.17.0' },
};
/*
* Sample package file content that exhibits dependencies with and without
......@@ -231,7 +233,7 @@ describe('modules/manager/pip_requirements/artifacts', () => {
'bash -l -c "' +
'install-tool python 3.10.2 ' +
'&& ' +
'install-tool hashin 0.1.7 ' +
'install-tool hashin 0.17.0 ' +
'&& ' +
'hashin atomicwrites==1.4.0 -r requirements.txt' +
'"',
......@@ -266,7 +268,7 @@ describe('modules/manager/pip_requirements/artifacts', () => {
]);
expect(execSnapshots).toMatchObject([
{ cmd: 'install-tool python 3.10.2' },
{ cmd: 'install-tool hashin 0.1.7' },
{ cmd: 'install-tool hashin 0.17.0' },
{
cmd: 'hashin atomicwrites==1.4.0 -r requirements.txt',
options: { cwd: '/tmp/github/some/repo' },
......
......@@ -71,7 +71,7 @@ export async function updateArtifacts({
docker: {},
toolConstraints: [
{ toolName: 'python', constraint: config.constraints?.python },
{ toolName: 'hashin' },
{ toolName: 'hashin', constraint: config.constraints?.hashin },
],
extraEnv: {
PIP_CACHE_DIR: await ensureCacheDir('pip'),
......
......@@ -111,7 +111,7 @@ exports[`modules/manager/pipenv/artifacts supports docker mode 1`] = `
},
},
{
"cmd": "docker run --rm --name=renovate_sidecar --label=renovate_child -v "/tmp/github/some/repo":"/tmp/github/some/repo" -v "/tmp/renovate/cache":"/tmp/renovate/cache" -e PIPENV_CACHE_DIR -e PIP_CACHE_DIR -e CONTAINERBASE_CACHE_DIR -w "/tmp/github/some/repo" ghcr.io/containerbase/sidecar bash -l -c "install-tool python 3.7.6 && install-tool pipenv 2023.1.2 && pipenv lock"",
"cmd": "docker run --rm --name=renovate_sidecar --label=renovate_child -v "/tmp/github/some/repo":"/tmp/github/some/repo" -v "/tmp/renovate/cache":"/tmp/renovate/cache" -e PIPENV_CACHE_DIR -e PIP_CACHE_DIR -e CONTAINERBASE_CACHE_DIR -w "/tmp/github/some/repo" ghcr.io/containerbase/sidecar bash -l -c "install-tool python 3.7.6 && install-tool pipenv 2013.6.12 && pipenv lock"",
"options": {
"cwd": "/tmp/github/some/repo",
"encoding": "utf-8",
......
......@@ -77,6 +77,15 @@ describe('modules/manager/pipenv/artifacts', () => {
{ version: '3.10.2' },
],
});
// pipenv
getPkgReleases.mockResolvedValueOnce({
releases: [
{ version: '2013.5.19' },
{ version: '2013.6.11' },
{ version: '2013.6.12' },
],
});
});
it('returns if no Pipfile.lock found', async () => {
......@@ -209,7 +218,7 @@ describe('modules/manager/pipenv/artifacts', () => {
).not.toBeNull();
expect(execSnapshots).toMatchObject([
{ cmd: 'install-tool python 3.7.6' },
{ cmd: 'install-tool pipenv 2023.1.2' },
{ cmd: 'install-tool pipenv 2013.6.12' },
{ cmd: 'pipenv lock', options: { cwd: '/tmp/github/some/repo' } },
]);
});
......
......@@ -163,6 +163,15 @@ describe('util/exec/containerbase', () => {
).toBe(expected);
},
);
it('removes pep440 ==', async () => {
expect(
await resolveConstraint({
toolName: 'pipenv',
constraint: '==2020.8.13',
}),
).toBe('2020.8.13');
});
});
describe('generateInstallCommands()', () => {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment