Skip to content

Commit 5d6e1d7

Browse files
committed
Merge remote-tracking branch 'origin/main' into support-indexing-of-dir-listed-packages
2 parents f0171d5 + c3c703a commit 5d6e1d7

11 files changed

Lines changed: 2048 additions & 558 deletions

purldb-toolkit/src/purldb_toolkit/purlcli.py

Lines changed: 314 additions & 193 deletions
Large diffs are not rendered by default.

purldb-toolkit/tests/data/purlcli/expected_metadata_output.json

Lines changed: 154 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88
"--purl": [
99
"pkg:pypi/fetchcode",
1010
"pkg:pypi/fetchcode@0.3.0",
11+
"pkg:pypi/fetchcode@0.3.0?os=windows",
12+
"pkg:pypi/fetchcode@0.3.0os=windows",
13+
"pkg:pypi/fetchcode@5.0.0",
1114
"pkg:cargo/banquo",
1215
"pkg:nginx/nginx",
1316
"pkg:gem/rails",
@@ -19,13 +22,18 @@
1922
"purls": [
2023
"pkg:pypi/fetchcode",
2124
"pkg:pypi/fetchcode@0.3.0",
25+
"pkg:pypi/fetchcode@0.3.0?os=windows",
26+
"pkg:pypi/fetchcode@0.3.0os=windows",
27+
"pkg:pypi/fetchcode@5.0.0",
2228
"pkg:cargo/banquo",
2329
"pkg:nginx/nginx",
2430
"pkg:gem/rails",
2531
"pkg:rubygems/rails"
2632
],
2733
"errors": [],
2834
"warnings": [
35+
"'pkg:pypi/fetchcode@0.3.0os=windows' does not exist in the upstream repo",
36+
"'pkg:pypi/fetchcode@5.0.0' does not exist in the upstream repo",
2937
"'pkg:nginx/nginx' not supported with `metadata` command",
3038
"'pkg:gem/rails' not supported with `metadata` command"
3139
]
@@ -320,6 +328,152 @@
320328
"repository_download_url": null,
321329
"api_data_url": null
322330
},
331+
{
332+
"purl": "pkg:pypi/fetchcode@0.3.0?os=windows",
333+
"type": "pypi",
334+
"namespace": null,
335+
"name": "fetchcode",
336+
"version": "0.3.0",
337+
"qualifiers": {
338+
"os": "windows"
339+
},
340+
"subpath": null,
341+
"primary_language": null,
342+
"description": null,
343+
"release_date": null,
344+
"parties": [],
345+
"keywords": [],
346+
"homepage_url": "https://github.com/nexB/fetchcode",
347+
"download_url": null,
348+
"api_url": "https://pypi.org/pypi/fetchcode/json",
349+
"size": null,
350+
"sha1": null,
351+
"md5": null,
352+
"sha256": null,
353+
"sha512": null,
354+
"bug_tracking_url": null,
355+
"code_view_url": null,
356+
"vcs_url": null,
357+
"copyright": null,
358+
"license_expression": null,
359+
"declared_license": "Apache-2.0",
360+
"notice_text": null,
361+
"root_path": null,
362+
"dependencies": [],
363+
"contains_source_code": null,
364+
"source_packages": [],
365+
"repository_homepage_url": null,
366+
"repository_download_url": null,
367+
"api_data_url": null
368+
},
369+
{
370+
"purl": "pkg:pypi/fetchcode@0.1.0",
371+
"type": "pypi",
372+
"namespace": null,
373+
"name": "fetchcode",
374+
"version": "0.1.0",
375+
"qualifiers": {},
376+
"subpath": null,
377+
"primary_language": null,
378+
"description": null,
379+
"release_date": null,
380+
"parties": [],
381+
"keywords": [],
382+
"homepage_url": "https://github.com/nexB/fetchcode",
383+
"download_url": "https://files.pythonhosted.org/packages/19/a0/c90e5ba4d71ea1a1a89784f6d839ffb0dbf32d270cba04d5602188cb3713/fetchcode-0.1.0-py3-none-any.whl",
384+
"api_url": "https://pypi.org/pypi/fetchcode/json",
385+
"size": null,
386+
"sha1": null,
387+
"md5": null,
388+
"sha256": null,
389+
"sha512": null,
390+
"bug_tracking_url": null,
391+
"code_view_url": null,
392+
"vcs_url": null,
393+
"copyright": null,
394+
"license_expression": null,
395+
"declared_license": "Apache-2.0",
396+
"notice_text": null,
397+
"root_path": null,
398+
"dependencies": [],
399+
"contains_source_code": null,
400+
"source_packages": [],
401+
"repository_homepage_url": null,
402+
"repository_download_url": null,
403+
"api_data_url": null
404+
},
405+
{
406+
"purl": "pkg:pypi/fetchcode@0.2.0",
407+
"type": "pypi",
408+
"namespace": null,
409+
"name": "fetchcode",
410+
"version": "0.2.0",
411+
"qualifiers": {},
412+
"subpath": null,
413+
"primary_language": null,
414+
"description": null,
415+
"release_date": null,
416+
"parties": [],
417+
"keywords": [],
418+
"homepage_url": "https://github.com/nexB/fetchcode",
419+
"download_url": "https://files.pythonhosted.org/packages/d7/e9/96e9302e84e326b3c10a40c1723f21f4db96b557a17c6871e7a4c6336906/fetchcode-0.2.0-py3-none-any.whl",
420+
"api_url": "https://pypi.org/pypi/fetchcode/json",
421+
"size": null,
422+
"sha1": null,
423+
"md5": null,
424+
"sha256": null,
425+
"sha512": null,
426+
"bug_tracking_url": null,
427+
"code_view_url": null,
428+
"vcs_url": null,
429+
"copyright": null,
430+
"license_expression": null,
431+
"declared_license": "Apache-2.0",
432+
"notice_text": null,
433+
"root_path": null,
434+
"dependencies": [],
435+
"contains_source_code": null,
436+
"source_packages": [],
437+
"repository_homepage_url": null,
438+
"repository_download_url": null,
439+
"api_data_url": null
440+
},
441+
{
442+
"purl": "pkg:pypi/fetchcode@0.3.0",
443+
"type": "pypi",
444+
"namespace": null,
445+
"name": "fetchcode",
446+
"version": "0.3.0",
447+
"qualifiers": {},
448+
"subpath": null,
449+
"primary_language": null,
450+
"description": null,
451+
"release_date": null,
452+
"parties": [],
453+
"keywords": [],
454+
"homepage_url": "https://github.com/nexB/fetchcode",
455+
"download_url": "https://files.pythonhosted.org/packages/8d/fb/e45da0abf63504c3f88ad02537dc9dc64ea5206b09ce29cfb8191420d678/fetchcode-0.3.0-py3-none-any.whl",
456+
"api_url": "https://pypi.org/pypi/fetchcode/json",
457+
"size": null,
458+
"sha1": null,
459+
"md5": null,
460+
"sha256": null,
461+
"sha512": null,
462+
"bug_tracking_url": null,
463+
"code_view_url": null,
464+
"vcs_url": null,
465+
"copyright": null,
466+
"license_expression": null,
467+
"declared_license": "Apache-2.0",
468+
"notice_text": null,
469+
"root_path": null,
470+
"dependencies": [],
471+
"contains_source_code": null,
472+
"source_packages": [],
473+
"repository_homepage_url": null,
474+
"repository_download_url": null,
475+
"api_data_url": null
476+
},
323477
{
324478
"purl": "pkg:cargo/banquo",
325479
"type": "cargo",

purldb-toolkit/tests/data/purlcli/expected_metadata_output_unique.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88
"--purl": [
99
"pkg:pypi/fetchcode",
1010
"pkg:pypi/fetchcode@0.3.0",
11+
"pkg:pypi/fetchcode@0.3.0?os=windows",
12+
"pkg:pypi/fetchcode@0.3.0os=windows",
13+
"pkg:pypi/fetchcode@5.0.0",
1114
"pkg:cargo/banquo",
1215
"pkg:nginx/nginx",
1316
"pkg:gem/rails",
@@ -20,6 +23,9 @@
2023
"purls": [
2124
"pkg:pypi/fetchcode",
2225
"pkg:pypi/fetchcode@0.3.0",
26+
"pkg:pypi/fetchcode@0.3.0?os=windows",
27+
"pkg:pypi/fetchcode@0.3.0os=windows",
28+
"pkg:pypi/fetchcode@5.0.0",
2329
"pkg:cargo/banquo",
2430
"pkg:nginx/nginx",
2531
"pkg:gem/rails",
@@ -28,6 +34,9 @@
2834
"errors": [],
2935
"warnings": [
3036
"input PURL: 'pkg:pypi/fetchcode@0.3.0' normalized to 'pkg:pypi/fetchcode'",
37+
"input PURL: 'pkg:pypi/fetchcode@0.3.0?os=windows' normalized to 'pkg:pypi/fetchcode'",
38+
"input PURL: 'pkg:pypi/fetchcode@0.3.0os=windows' normalized to 'pkg:pypi/fetchcode'",
39+
"input PURL: 'pkg:pypi/fetchcode@5.0.0' normalized to 'pkg:pypi/fetchcode'",
3140
"'pkg:nginx/nginx' not supported with `metadata` command",
3241
"'pkg:gem/rails' not supported with `metadata` command"
3342
]

purldb-toolkit/tests/data/purlcli/expected_urls_output.json

Lines changed: 3 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,12 @@
2323
"pkg:gem/bundler-sass",
2424
"pkg:rubygems/bundler-sass",
2525
"pkg:pypi/matchcode",
26-
"pkg:rubygems/bundler-sass",
2726
"abcdefg",
2827
"pkg/abc",
29-
"pkg:nuget/auth0-aspnet@1.1.0",
30-
"pkg:cargo/socksprox"
28+
"pkg:nuget/auth0-aspnet@1.1.0"
3129
],
3230
"--file": null,
33-
"--output": "/mnt/c/nexb/purldb-testing/2024-current-01-testing/json-output/2024-02-14-urls--output-01.json"
31+
"--output": "<stdout>"
3432
},
3533
"purls": [
3634
"pkg:pypi/fetchcode",
@@ -50,11 +48,9 @@
5048
"pkg:gem/bundler-sass",
5149
"pkg:rubygems/bundler-sass",
5250
"pkg:pypi/matchcode",
53-
"pkg:rubygems/bundler-sass",
5451
"abcdefg",
5552
"pkg/abc",
56-
"pkg:nuget/auth0-aspnet@1.1.0",
57-
"pkg:cargo/socksprox"
53+
"pkg:nuget/auth0-aspnet@1.1.0"
5854
],
5955
"errors": [],
6056
"warnings": [
@@ -330,29 +326,6 @@
330326
"url": "https://rubygems.org/gems/bundler-sass"
331327
}
332328
},
333-
{
334-
"purl": "pkg:rubygems/bundler-sass",
335-
"download_url": {
336-
"url": null
337-
},
338-
"inferred_urls": [
339-
{
340-
"url": "https://rubygems.org/gems/bundler-sass"
341-
}
342-
],
343-
"repo_download_url": {
344-
"url": null
345-
},
346-
"repo_download_url_by_package_type": {
347-
"url": null
348-
},
349-
"repo_url": {
350-
"url": "https://rubygems.org/gems/bundler-sass"
351-
},
352-
"url": {
353-
"url": "https://rubygems.org/gems/bundler-sass"
354-
}
355-
},
356329
{
357330
"purl": "pkg:nuget/auth0-aspnet@1.1.0",
358331
"download_url": {
@@ -378,29 +351,6 @@
378351
"url": {
379352
"url": "https://www.nuget.org/packages/auth0-aspnet/1.1.0"
380353
}
381-
},
382-
{
383-
"purl": "pkg:cargo/socksprox",
384-
"download_url": {
385-
"url": null
386-
},
387-
"inferred_urls": [
388-
{
389-
"url": "https://crates.io/crates/socksprox"
390-
}
391-
],
392-
"repo_download_url": {
393-
"url": null
394-
},
395-
"repo_download_url_by_package_type": {
396-
"url": null
397-
},
398-
"repo_url": {
399-
"url": "https://crates.io/crates/socksprox"
400-
},
401-
"url": {
402-
"url": "https://crates.io/crates/socksprox"
403-
}
404354
}
405355
]
406356
}

0 commit comments

Comments
 (0)