Skip to content

Commit

Permalink
feat: do individual packages
Browse files Browse the repository at this point in the history
  • Loading branch information
mistercrunch committed May 14, 2024
1 parent e6168a4 commit d0e2267
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/github.js
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,9 @@ class Github {
} else {
deps = optDeps[group];
}
} else {
const tree = await this.getSubPackageTree();
deps = Object.keys(tree);
}
if (shuffle) {
deps = shuffleArray(deps);
Expand Down
2 changes: 1 addition & 1 deletion src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,8 @@ export function parsePinnedRequirementsTree(requirements) {
const lines = requirements
.split('\n')
.filter((line) => !line.startsWith('#')) // this removes comments at the top/bottom but not vias since they are indented
.filter((line) => !line.startsWith('-')) // this removes funky lines refing other files
.map((line) => line.trim().toLowerCase())
.filter((line) => !line.startsWith('-')) // this removes funky lines refing other files
.filter((line) => !!line);

const depsObject = {};
Expand Down
10 changes: 10 additions & 0 deletions src/utils.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,16 @@ describe('parsePinnedRequirementsTree', () => {
alembic: { deps: [], version: '1.13.1' },
});
});
it('ignores lines with dash r', () => {
const requirements = `
-r requirements.txt
alembic==1.13.1
# via flask-migrate`;
expect(parsePinnedRequirementsTree(requirements)).toEqual({
'flask-migrate': { deps: ['alembic'], version: null },
alembic: { deps: [], version: '1.13.1' },
});
});
});

describe('mergeParsedRequirementsTree', () => {
Expand Down

0 comments on commit d0e2267

Please sign in to comment.