Skip to content

Commit

Permalink
fix: include pkg version in pkgIdProvenance label
Browse files Browse the repository at this point in the history
  • Loading branch information
gemaxim committed Dec 18, 2024
1 parent 5bbc02b commit de1fc50
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion lib/poetry-dep-graph-builder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ function addDependenciesForPkg(
scope: dependency.isDev ? 'dev' : 'prod',
};
if (pkg.name != pkgName) {
labels.pkgIdProvenance = pkgName;
labels.pkgIdProvenance = `${pkgName}@${pkg.version}`;
}
builder
.addPkgNode(pkgInfo, pkg.name, {
Expand Down
12 changes: 6 additions & 6 deletions test/fixtures/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ describe('buildDepGraph', () => {
})
.connectDep(depGraphBuilder.rootNodeId, 'jinja2')
.addPkgNode({ name: 'markupsafe', version: '1.1.1' }, 'markupsafe', {
labels: { scope: 'prod', pkgIdProvenance: 'MarkupSafe' },
labels: { scope: 'prod', pkgIdProvenance: 'MarkupSafe@1.1.1' },
})
.connectDep('jinja2', 'markupsafe')
.build();
Expand All @@ -68,7 +68,7 @@ describe('buildDepGraph', () => {
})
.connectDep(depGraphBuilder.rootNodeId, 'six')
.addPkgNode({ name: 'isodd', version: '0.1.2' }, 'isodd', {
labels: { scope: 'dev', pkgIdProvenance: 'isOdd' },
labels: { scope: 'dev', pkgIdProvenance: 'isOdd@0.1.2' },
})
.connectDep(depGraphBuilder.rootNodeId, 'isodd')
.build();
Expand Down Expand Up @@ -108,7 +108,7 @@ describe('buildDepGraph', () => {
})
.connectDep(depGraphBuilder.rootNodeId, 'six')
.addPkgNode({ name: 'isodd', version: '0.1.2' }, 'isodd', {
labels: { scope: 'dev', pkgIdProvenance: 'isOdd' },
labels: { scope: 'dev', pkgIdProvenance: 'isOdd@0.1.2' },
})
.connectDep(depGraphBuilder.rootNodeId, 'isodd')
.build();
Expand Down Expand Up @@ -148,7 +148,7 @@ describe('buildDepGraph', () => {
})
.connectDep(depGraphBuilder.rootNodeId, 'six')
.addPkgNode({ name: 'isodd', version: '0.1.2' }, 'isodd', {
labels: { scope: 'dev', pkgIdProvenance: 'isOdd' },
labels: { scope: 'dev', pkgIdProvenance: 'isOdd@0.1.2' },
})
.connectDep(depGraphBuilder.rootNodeId, 'isodd')
.addPkgNode({ name: 'simple-enum', version: '0.0.6' }, 'simple-enum', {
Expand Down Expand Up @@ -192,15 +192,15 @@ describe('buildDepGraph', () => {
})
.connectDep(depGraphBuilder.rootNodeId, 'six')
.addPkgNode({ name: 'isodd', version: '0.1.2' }, 'isodd', {
labels: { scope: 'dev', pkgIdProvenance: 'isOdd' },
labels: { scope: 'dev', pkgIdProvenance: 'isOdd@0.1.2' },
})
.connectDep(depGraphBuilder.rootNodeId, 'isodd')
.addPkgNode({ name: 'simple-enum', version: '0.0.6' }, 'simple-enum', {
labels: { scope: 'dev' },
})
.connectDep(depGraphBuilder.rootNodeId, 'simple-enum')
.addPkgNode({ name: 'whattype', version: '0.0.1' }, 'whattype', {
labels: { scope: 'dev', pkgIdProvenance: 'whatType' },
labels: { scope: 'dev', pkgIdProvenance: 'whatType@0.0.1' },
})
.connectDep(depGraphBuilder.rootNodeId, 'whattype')
.build();
Expand Down

0 comments on commit de1fc50

Please sign in to comment.