Prefer using PKG-INFO from .egg-info in assemble #3083 - #3091
Merged
Conversation
JonoYang
force-pushed
the
3083-no-pkg-info-deps
branch
from
September 3, 2022 01:20
ef37a0f to
2eb59ac
Compare
pombredanne
requested changes
Sep 3, 2022
pombredanne
left a comment
Member
There was a problem hiding this comment.
Thanks!
There are a few nit that likely are leftover from before... we should better track the extracted requirements and treat PyPI extras as optional
| { | ||
| "purl": "pkg:pypi/azure-storage-blob@12.9.0", | ||
| "extracted_requirement": "azure-storage-blob==12.9.0; extra == \"azureblockblob\"", | ||
| "scope": "azurebl |
Member
There was a problem hiding this comment.
We should have an extracted requirement of "msgpack"
| { | ||
| "purl": "pkg:pypi/azure-storage-blob@12.9.0", | ||
| "extracted_requirement": "azure-storage-blob==12.9.0; extra == \"azureblockblob\"", | ||
| "scope": "azurebl |
Member
There was a problem hiding this comment.
We should have instead:
Suggested change
| "scope": "azurebl | |
| "extracted_requirement": "couchbase>=3.0.0", |
| "extracted_requirement": "pylibmc; platform_system != \"Windows\" and extra == \"memcache\"", | ||
| "scope": "memcache", | ||
| "is_runtime": true, | ||
| "is_optional": false, |
Member
There was a problem hiding this comment.
IMHO we should be true for "extras" e.g. not an "install_requires" and therefore not in "install" scope:
Suggested change
| "is_optional": false, | |
| "is_optional": true, |
* Add test for checking that the .egg-info PKG-INFO is the only Package source reported
* Update test expectations
Signed-off-by: Jono Yang <jyang@nexb.com>
JonoYang
force-pushed
the
3083-no-pkg-info-deps
branch
from
September 6, 2022 17:44
2eb59ac to
99f5034
Compare
* Ensure extracted_requirement contains dependency name
* Update test expectations
Signed-off-by: Jono Yang <jyang@nexb.com>
JonoYang
force-pushed
the
3083-no-pkg-info-deps
branch
from
September 6, 2022 19:25
99f5034 to
9433eec
Compare
Signed-off-by: Jono Yang <jyang@nexb.com>
Member
Author
|
I've updated the code to return the dependency name in the extracted_requirements and to properly set the is_optional field on the dependencies listed in extra_requires. Tests are passing, so I will merge this. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 PR addresses #3083, where we have no dependencies returned when we scanned an installable Python codebase. This issue is cause by
BaseExtractedPythonLayout.assemble(), where it would use the package data from the PKG-INFO file from the root of a Python codebase rather than from the PKG-INFO file from the .egg-info directory (also located in the root of a Python codebase).We want to use the PKG-INFO file from the .egg-info directory because the package data from that contains the dependency information.