-
-
Notifications
You must be signed in to change notification settings - Fork 576
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 misc package scanning bugs #4073
Conversation
5fce14d
to
5f62b34
Compare
5f62b34
to
7454fab
Compare
Signed-off-by: Ayan Sinha Mahapatra <ayansmahapatra@gmail.com>
Signed-off-by: Ayan Sinha Mahapatra <ayansmahapatra@gmail.com>
7454fab
to
a98327e
Compare
@@ -14,6 +14,7 @@ | |||
|
|||
from packagedcode import models | |||
from packagedcode.pypi import BaseDependencyFileHandler | |||
from dparse2.parser import parse_requirement_line |
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.
Do you really want to use this and not our own pip-requirements-parser?
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.
This is what we were using previously with dparse, I added some improvements on the function, and this was using parse_requirement_line
internally, but pip-requirements-parser
would make more sense possibly, I will open a follow up issue on conda to include this. This would be helpful also to parse requirement lines with source repos.
@@ -107,33 +125,152 @@ def parse(cls, location, package_only=False): | |||
# u'progressbar2', u'python >=3.6'])]) | |||
for req in reqs: | |||
name, _, requirement = req.partition(" ") | |||
purl = PackageURL(type=cls.default_package_type, name=name) | |||
version = None | |||
if requirement.startswith("=="): |
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.
I guess this is OK as a quick fix, but we should steal the code from https://github.com/conda/conda/blob/5eed0193f2acd45b26599af4b71f241fd8666ccd/conda/models/version.py#L52 in the future
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.
Good to merge! And we can refine later
Tasks
Run tests locally to check for errors.