-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: ignore dependencies in virtualenv #9
Conversation
lib/poetry-dep-graph-builder.ts
Outdated
pkgName: string, | ||
pkgSpecs: PoetryLockFileDependency[], | ||
): PoetryLockFileDependency { | ||
const pkgLockInfo = pkgSpecs.find((lockItem) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const pkgLockInfo = pkgSpecs.find((lockItem) =>
lockItem.name.toLowerCase() === pkgName.toLowerCase()
);
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just to clarify, you mean to remove the return
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please see my comments
256ca6b
to
ea344c1
Compare
Looking great! |
🎉 This PR is included in version 1.1.3 🎉 The release is available on: Your semantic-release bot 📦🚀 |
What this does
Poetry uses the virtualenv to create an environment and this comes with these packages pre-installed, therefore they won't be listed in the lockfile as a dependency but it won't have its own metadata entry within the lockfile. This change prevents us trying to traverse the lockfile for those specific dependencies.
See: python-poetry/poetry#3075 (comment)
Also features a small refactor that better isolates the method to be able to test via unit tests rather than having to add a fixture for each scenario / writing custom manifest and lockfiles to mimic the scenario in a "unit" test, so it should make subsequent changes easier to test with less code. The refactor looks larger than it is as it involves the bulk of index being moved to a new file.
More information