mirror of
https://github.com/renovatebot/renovate.git
synced 2025-01-13 15:36:25 +00:00
c8ae853d58
This PR adds basic support for requirements.txt. Currently it works on fully specified (pinned) versions only, so is disabled by default. Enable it by setting `pip_requirements.enabled = true` in config.
15 lines
434 B
JavaScript
15 lines
434 B
JavaScript
module.exports = {
|
|
updateDependency,
|
|
};
|
|
|
|
function updateDependency(fileContent, upgrade) {
|
|
try {
|
|
logger.debug(`pip_requirements.updateDependency(): ${upgrade.newVersion}`);
|
|
const lines = fileContent.split('\n');
|
|
lines[upgrade.lineNumber] = `${upgrade.depName}==${upgrade.newVersion}`;
|
|
return lines.join('\n');
|
|
} catch (err) {
|
|
logger.info({ err }, 'Error setting new package version');
|
|
return null;
|
|
}
|
|
}
|