* get requirements from requirements.txt * @param {string} source * @return {string[]}
(source)
| 620 | * @return {string[]} |
| 621 | */ |
| 622 | function getRequirements(source) { |
| 623 | const requirements = fse |
| 624 | .readFileSync(source, { encoding: 'utf-8' }) |
| 625 | .replace(/\\\n/g, ' ') |
| 626 | .split(/\r?\n/) |
| 627 | |
| 628 | return requirements.reduce((acc, req) => { |
| 629 | req = req.trim() |
| 630 | if (!req.startsWith('-r')) { |
| 631 | return [...acc, req] |
| 632 | } |
| 633 | source = path.join(path.dirname(source), req.replace(/^-r\s+/, '')) |
| 634 | return [...acc, ...getRequirements(source)] |
| 635 | }, []) |
| 636 | } |
| 637 | |
| 638 | /** create a filtered requirements.txt without anything from noDeploy |
| 639 | * then remove all comments and empty lines, and sort the list which |
no test coverage detected
searching dependent graphs…