Conversation
|
@TG1999 You For example: ValueError: I need a function that, provided a requirements file, returns directly the json as a python object. |
6266e68 to
ca9eeb0
Compare
f43e112 to
1e04ecf
Compare
pombredanne
left a comment
There was a problem hiding this comment.
Thanks! See some feedback for your review
There was a problem hiding this comment.
@TG1999 I'm getting an error when using this requirements file as input:
https://github.com/nexB/scancode-toolkit/blob/develop/requirements.txt
>>> inspector_output = resolver_api(requirement_files=['requirements.txt'])
Traceback (most recent call last):
File "<console>", line 1, in <module>
File "/Volumes/nexB/repos/scancode.io/lib/python3.9/site-packages/python_inspector/resolve_cli.py", line 446, in resolver_api
resolved_dependencies, purls = resolve(
File "/Volumes/nexB/repos/scancode.io/lib/python3.9/site-packages/python_inspector/resolve_cli.py", line 542, in resolve
resolved_dependencies, packages = get_resolved_dependencies(
TypeError: cannot unpack non-iterable NoneType object
2 more issues:
Using this input that contains only 1 package entry: reqs.txt
from python_inspector.resolve_cli import resolver_api
>>> resolver_api(requirement_files=["reqs.txt"])
>>> packages = inspector_output.get("packages")
>>> len(packages)
2
>>> packages[0].get("purl")
'pkg:pypi/toml@0.10.2'
>>> packages[1].get("purl")
'pkg:pypi/toml@0.10.2'
>>> packages[0]['parties']
[{'type': 'person', 'role': 'author', 'name': 'William Pearson', 'email': 'uiri@xqz.ca', 'url': None},
{'type': 'person', 'role': 'maintainer', 'name': '', 'email': '', 'url': None}]
-
There should be only 1 entry for that package in the resolve packages.
-
One of the 2
partiesentry is empty, no name, no email, no URL.
|
@tdruez Re: We have one download_url per package, that's why the purl for both of these are same. |
|
@tdruez Re: I got this error while using this req file : I will suggest you to use this |
Could you expend a bit your explanation? |
Could you explain why this issue is occurring? What is the specific part of this requirements file that cause thew issue? |
@tdruez rdflib causes this issue, https://github.com/RDFLib/rdflib/blob/main/setup.py |
db7f6e4 to
52c8f7b
Compare
|
@TG1999 why "force pushing" into a single commit again? I makes impossible to track the progress made... |
|
@tdruez we pushed some commits in between that were only for verifying the content of the flaky tests in the CI. And since the verification is now done I squashed the intermediate commits. |
src/python_inspector/api.py
Outdated
| } | ||
|
|
||
|
|
||
| def resolver_api( |
There was a problem hiding this comment.
This is a better name IMHO:
| def resolver_api( | |
| def resolve_dependencies( |
Signed-off-by: Tushar Goel <tushar.goel.dav@gmail.com>
Signed-off-by: Tushar Goel <tushar.goel.dav@gmail.com>
Currently if there is no direct dependencies provided in a manifest file we raise exception and don't process it anymore, but this is incorrect we should provide metadata in manifest files instead of failing altogether Signed-off-by: Tushar Goel <tushar.goel.dav@gmail.com>
Signed-off-by: Tushar Goel <tushar.goel.dav@gmail.com>
Reference: #39
Signed-off-by: Tushar Goel tushar.goel.dav@gmail.com