Skip to content

Commit

Permalink
feat(pip-compile): Treat .txt files as pip_requirements files (#29491)
Browse files Browse the repository at this point in the history
  • Loading branch information
mbudnek committed Jun 6, 2024
1 parent f7de298 commit 8fb3e2f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions lib/modules/manager/pip-compile/common.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -342,5 +342,10 @@ describe('modules/manager/pip-compile/common', () => {
expect(matchManager('file.in')).toBe('pip_requirements');
expect(matchManager('another_file.in')).toBe('pip_requirements');
});

it('matches pip_requirements any .txt file', () => {
expect(matchManager('file.txt')).toBe('pip_requirements');
expect(matchManager('another_file.txt')).toBe('pip_requirements');
});
});
});
2 changes: 1 addition & 1 deletion lib/modules/manager/pip-compile/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ export function matchManager(filename: string): SupportedManagers | 'unknown' {
return 'pep621';
}
// naive, could be improved, maybe use pip_requirements.fileMatch
if (filename.endsWith('.in')) {
if (filename.endsWith('.in') || filename.endsWith('.txt')) {
return 'pip_requirements';
}
return 'unknown';
Expand Down

0 comments on commit 8fb3e2f

Please sign in to comment.