Skip to content

Commit

Permalink
feat(manager/pyenv): specify "Python" for commitMessageTopic (#21145)
Browse files Browse the repository at this point in the history
  • Loading branch information
ikesyo authored Mar 25, 2023
1 parent cec2e14 commit cab3571
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
21 changes: 18 additions & 3 deletions lib/modules/manager/pyenv/extract.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,36 @@ describe('modules/manager/pyenv/extract', () => {
it('returns a result', () => {
const res = extractPackageFile('3.7.1\n');
expect(res.deps).toEqual([
{ depName: 'python', currentValue: '3.7.1', datasource: 'docker' },
{
depName: 'python',
commitMessageTopic: 'Python',
currentValue: '3.7.1',
datasource: 'docker',
},
]);
});

it('supports ranges', () => {
const res = extractPackageFile('3.8\n');
expect(res.deps).toEqual([
{ depName: 'python', currentValue: '3.8', datasource: 'docker' },
{
depName: 'python',
commitMessageTopic: 'Python',
currentValue: '3.8',
datasource: 'docker',
},
]);
});

it('skips non ranges', () => {
const res = extractPackageFile('latestn');
expect(res.deps).toEqual([
{ depName: 'python', currentValue: 'latestn', datasource: 'docker' },
{
depName: 'python',
commitMessageTopic: 'Python',
currentValue: 'latestn',
datasource: 'docker',
},
]);
});
});
Expand Down
1 change: 1 addition & 0 deletions lib/modules/manager/pyenv/extract.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import type { PackageDependency, PackageFileContent } from '../types';
export function extractPackageFile(content: string): PackageFileContent {
const dep: PackageDependency = {
depName: 'python',
commitMessageTopic: 'Python',
currentValue: content.trim(),
datasource: DockerDatasource.id,
};
Expand Down

0 comments on commit cab3571

Please sign in to comment.