Use pip list to get packages for pip source #480
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This change updates the pip source to gather dependencies from
pip list
rather than parsingrequirements.txt
. This is done to accommodate the multitude of requirement specifies that weren't currently being handled, such as direct file specifiers. Instead licensed now relies on pip to report what dependencies are being used. As a side effect, this now causes the pip source to report on transitive/nested dependencies, where previously only explicit dependencies were being reported 🤦After all dependencies were being reported, I found that performance was really suffering because many more
pip show
commands were being executed. Thankfully thoughpip show
supports entering multiple package names in one command, which overall made the source faster than it was before this PR 🚀 .Some minor side effects of this change
requirements.txt
file. we just need to know the virtual env directory to run under and pip gives us all the rest of the information.