Fix misc package scanning bugs#4073
Conversation
5fce14d to
5f62b34
Compare
5f62b34 to
7454fab
Compare
Signed-off-by: Ayan Sinha Mahapatra <[email protected]>
Signed-off-by: Ayan Sinha Mahapatra <[email protected]>
7454fab to
a98327e
Compare
|
|
||
| from packagedcode import models | ||
| from packagedcode.pypi import BaseDependencyFileHandler | ||
| from dparse2.parser import parse_requirement_line |
There was a problem hiding this comment.
Do you really want to use this and not our own pip-requirements-parser?
There was a problem hiding this comment.
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.
| 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.
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
pombredanne
left a comment
There was a problem hiding this comment.
Good to merge! And we can refine later
Tasks
Run tests locally to check for errors.