renovate/lib/manager/pip_requirements/update.js
Ayoub Kaanich c8ae853d58 feat: python requirements.txt support (#1858)
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.
2018-04-28 20:39:07 +02:00

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;
}
}