diff --git a/tests/packagedcode/data/build_gradle/end2end/build.gradle-package-only-expected.json b/tests/packagedcode/data/build_gradle/end2end/build.gradle-package-only-expected.json new file mode 100644 index 00000000000..264afa7d09b --- /dev/null +++ b/tests/packagedcode/data/build_gradle/end2end/build.gradle-package-only-expected.json @@ -0,0 +1,97 @@ +{ + "packages": [], + "dependencies": [], + "files": [ + { + "path": "build.gradle", + "type": "file", + "package_data": [ + { + "type": "maven", + "namespace": null, + "name": null, + "version": null, + "qualifiers": {}, + "subpath": null, + "primary_language": null, + "description": null, + "release_date": null, + "parties": [], + "keywords": [], + "homepage_url": null, + "download_url": null, + "size": null, + "sha1": null, + "md5": null, + "sha256": null, + "sha512": null, + "bug_tracking_url": null, + "code_view_url": null, + "vcs_url": null, + "copyright": null, + "holder": null, + "declared_license_expression": null, + "declared_license_expression_spdx": null, + "license_detections": [], + "other_license_expression": null, + "other_license_expression_spdx": null, + "other_license_detections": [], + "extracted_license_statement": null, + "notice_text": null, + "source_packages": [], + "file_references": [], + "extra_data": {}, + "dependencies": [ + { + "purl": "pkg:maven/com.google/guava@1.0", + "extracted_requirement": "1.0", + "scope": "api", + "is_runtime": true, + "is_optional": false, + "is_resolved": true, + "resolved_package": {}, + "extra_data": {} + }, + { + "purl": "pkg:maven/org.apache/commons@1.0", + "extracted_requirement": "1.0", + "scope": "usageDependencies", + "is_runtime": true, + "is_optional": false, + "is_resolved": true, + "resolved_package": {}, + "extra_data": {} + }, + { + "purl": "pkg:maven/org.jacoco.ant@0.7.4.201502262128", + "extracted_requirement": "0.7.4.201502262128", + "scope": "", + "is_runtime": true, + "is_optional": false, + "is_resolved": true, + "resolved_package": {}, + "extra_data": {} + }, + { + "purl": "pkg:maven/org.jacoco.agent@0.7.4.201502262128", + "extracted_requirement": "0.7.4.201502262128", + "scope": "", + "is_runtime": true, + "is_optional": false, + "is_resolved": true, + "resolved_package": {}, + "extra_data": {} + } + ], + "repository_homepage_url": null, + "repository_download_url": null, + "api_data_url": null, + "datasource_id": "build_gradle", + "purl": null + } + ], + "for_packages": [], + "scan_errors": [] + } + ] +} \ No newline at end of file diff --git a/tests/packagedcode/data/cargo/scan-package-only.expected.json b/tests/packagedcode/data/cargo/scan-package-only.expected.json new file mode 100644 index 00000000000..5355bf80b74 --- /dev/null +++ b/tests/packagedcode/data/cargo/scan-package-only.expected.json @@ -0,0 +1,411 @@ +{ + "packages": [], + "dependencies": [], + "files": [ + { + "path": "scan", + "type": "directory", + "package_data": [], + "for_packages": [], + "scan_errors": [] + }, + { + "path": "scan/Cargo.lock", + "type": "file", + "package_data": [ + { + "type": "cargo", + "namespace": null, + "name": null, + "version": null, + "qualifiers": {}, + "subpath": null, + "primary_language": "Rust", + "description": null, + "release_date": null, + "parties": [], + "keywords": [], + "homepage_url": null, + "download_url": null, + "size": null, + "sha1": null, + "md5": null, + "sha256": null, + "sha512": null, + "bug_tracking_url": null, + "code_view_url": null, + "vcs_url": null, + "copyright": null, + "holder": null, + "declared_license_expression": null, + "declared_license_expression_spdx": null, + "license_detections": [], + "other_license_expression": null, + "other_license_expression_spdx": null, + "other_license_detections": [], + "extracted_license_statement": null, + "notice_text": null, + "source_packages": [], + "file_references": [], + "extra_data": {}, + "dependencies": [ + { + "purl": "pkg:cargo/ahash@0.7.4", + "extracted_requirement": "0.7.4", + "scope": "dependencies", + "is_runtime": true, + "is_optional": false, + "is_resolved": true, + "resolved_package": {}, + "extra_data": {} + }, + { + "purl": "pkg:cargo/autocfg@1.0.1", + "extracted_requirement": "1.0.1", + "scope": "dependencies", + "is_runtime": true, + "is_optional": false, + "is_resolved": true, + "resolved_package": {}, + "extra_data": {} + }, + { + "purl": "pkg:cargo/cfg-if@0.1.10", + "extracted_requirement": "0.1.10", + "scope": "dependencies", + "is_runtime": true, + "is_optional": false, + "is_resolved": true, + "resolved_package": {}, + "extra_data": {} + }, + { + "purl": "pkg:cargo/cfg-if@1.0.0", + "extracted_requirement": "1.0.0", + "scope": "dependencies", + "is_runtime": true, + "is_optional": false, + "is_resolved": true, + "resolved_package": {}, + "extra_data": {} + }, + { + "purl": "pkg:cargo/chrono@0.4.19", + "extracted_requirement": "0.4.19", + "scope": "dependencies", + "is_runtime": true, + "is_optional": false, + "is_resolved": true, + "resolved_package": {}, + "extra_data": {} + }, + { + "purl": "pkg:cargo/getrandom@0.2.3", + "extracted_requirement": "0.2.3", + "scope": "dependencies", + "is_runtime": true, + "is_optional": false, + "is_resolved": true, + "resolved_package": {}, + "extra_data": {} + }, + { + "purl": "pkg:cargo/hashbrown@0.11.2", + "extracted_requirement": "0.11.2", + "scope": "dependencies", + "is_runtime": true, + "is_optional": false, + "is_resolved": true, + "resolved_package": {}, + "extra_data": {} + }, + { + "purl": "pkg:cargo/libc@0.2.97", + "extracted_requirement": "0.2.97", + "scope": "dependencies", + "is_runtime": true, + "is_optional": false, + "is_resolved": true, + "resolved_package": {}, + "extra_data": {} + }, + { + "purl": "pkg:cargo/log@0.4.14", + "extracted_requirement": "0.4.14", + "scope": "dependencies", + "is_runtime": true, + "is_optional": false, + "is_resolved": true, + "resolved_package": {}, + "extra_data": {} + }, + { + "purl": "pkg:cargo/memory_units@0.4.0", + "extracted_requirement": "0.4.0", + "scope": "dependencies", + "is_runtime": true, + "is_optional": false, + "is_resolved": true, + "resolved_package": {}, + "extra_data": {} + }, + { + "purl": "pkg:cargo/num-integer@0.1.44", + "extracted_requirement": "0.1.44", + "scope": "dependencies", + "is_runtime": true, + "is_optional": false, + "is_resolved": true, + "resolved_package": {}, + "extra_data": {} + }, + { + "purl": "pkg:cargo/num-traits@0.2.14", + "extracted_requirement": "0.2.14", + "scope": "dependencies", + "is_runtime": true, + "is_optional": false, + "is_resolved": true, + "resolved_package": {}, + "extra_data": {} + }, + { + "purl": "pkg:cargo/once_cell@1.8.0", + "extracted_requirement": "1.8.0", + "scope": "dependencies", + "is_runtime": true, + "is_optional": false, + "is_resolved": true, + "resolved_package": {}, + "extra_data": {} + }, + { + "purl": "pkg:cargo/proxy-wasm@0.1.4", + "extracted_requirement": "0.1.4", + "scope": "dependencies", + "is_runtime": true, + "is_optional": false, + "is_resolved": true, + "resolved_package": {}, + "extra_data": {} + }, + { + "purl": "pkg:cargo/time@0.1.43", + "extracted_requirement": "0.1.43", + "scope": "dependencies", + "is_runtime": true, + "is_optional": false, + "is_resolved": true, + "resolved_package": {}, + "extra_data": {} + }, + { + "purl": "pkg:cargo/version_check@0.9.3", + "extracted_requirement": "0.9.3", + "scope": "dependencies", + "is_runtime": true, + "is_optional": false, + "is_resolved": true, + "resolved_package": {}, + "extra_data": {} + }, + { + "purl": "pkg:cargo/wasi@0.10.2%2Bwasi-snapshot-preview1", + "extracted_requirement": "0.10.2+wasi-snapshot-preview1", + "scope": "dependencies", + "is_runtime": true, + "is_optional": false, + "is_resolved": true, + "resolved_package": {}, + "extra_data": {} + }, + { + "purl": "pkg:cargo/wee_alloc@0.4.5", + "extracted_requirement": "0.4.5", + "scope": "dependencies", + "is_runtime": true, + "is_optional": false, + "is_resolved": true, + "resolved_package": {}, + "extra_data": {} + }, + { + "purl": "pkg:cargo/winapi@0.3.9", + "extracted_requirement": "0.3.9", + "scope": "dependencies", + "is_runtime": true, + "is_optional": false, + "is_resolved": true, + "resolved_package": {}, + "extra_data": {} + }, + { + "purl": "pkg:cargo/winapi-i686-pc-windows-gnu@0.4.0", + "extracted_requirement": "0.4.0", + "scope": "dependencies", + "is_runtime": true, + "is_optional": false, + "is_resolved": true, + "resolved_package": {}, + "extra_data": {} + }, + { + "purl": "pkg:cargo/winapi-x86_64-pc-windows-gnu@0.4.0", + "extracted_requirement": "0.4.0", + "scope": "dependencies", + "is_runtime": true, + "is_optional": false, + "is_resolved": true, + "resolved_package": {}, + "extra_data": {} + } + ], + "repository_homepage_url": null, + "repository_download_url": null, + "api_data_url": null, + "datasource_id": "cargo_lock", + "purl": null + } + ], + "for_packages": [], + "scan_errors": [] + }, + { + "path": "scan/Cargo.toml", + "type": "file", + "package_data": [ + { + "type": "cargo", + "namespace": null, + "name": "apple-xar", + "version": "0.4.0-pre", + "qualifiers": {}, + "subpath": null, + "primary_language": "Rust", + "description": "XAR archive reading and writing", + "release_date": null, + "parties": [ + { + "type": "person", + "role": "author", + "name": "Gregory Szorc", + "email": "gregory.szorc@gmail.com", + "url": null + } + ], + "keywords": [], + "homepage_url": "https://github.com/indygreg/PyOxidizer", + "download_url": null, + "size": null, + "sha1": null, + "md5": null, + "sha256": null, + "sha512": null, + "bug_tracking_url": null, + "code_view_url": null, + "vcs_url": "https://github.com/indygreg/PyOxidizer.git", + "copyright": null, + "holder": null, + "declared_license_expression": null, + "declared_license_expression_spdx": null, + "license_detections": [], + "other_license_expression": null, + "other_license_expression_spdx": null, + "other_license_detections": [], + "extracted_license_statement": "MPL-2.0", + "notice_text": null, + "source_packages": [], + "file_references": [], + "extra_data": {}, + "dependencies": [], + "repository_homepage_url": "https://crates.io/crates/apple-xar", + "repository_download_url": "https://crates.io/api/v1/crates/apple-xar/0.4.0-pre/download", + "api_data_url": "https://crates.io/api/v1/crates/apple-xar", + "datasource_id": "cargo_toml", + "purl": "pkg:cargo/apple-xar@0.4.0-pre" + } + ], + "for_packages": [], + "scan_errors": [] + }, + { + "path": "scan/dac", + "type": "directory", + "package_data": [], + "for_packages": [], + "scan_errors": [] + }, + { + "path": "scan/dac/Cargo.toml", + "type": "file", + "package_data": [ + { + "type": "cargo", + "namespace": null, + "name": "daachorse", + "version": "0.4.1", + "qualifiers": {}, + "subpath": null, + "primary_language": "Rust", + "description": "Daachorse: Double-Array Aho-Corasick", + "release_date": null, + "parties": [ + { + "type": "person", + "role": "author", + "name": "Koichi Akabe", + "email": "vbkaisetsu@gmail.com", + "url": null + }, + { + "type": "person", + "role": "author", + "name": "Shunsuke Kanda", + "email": "shnsk.knd@gmail.com", + "url": null + } + ], + "keywords": [], + "homepage_url": "https://github.com/daac-tools/daachorse", + "download_url": null, + "size": null, + "sha1": null, + "md5": null, + "sha256": null, + "sha512": null, + "bug_tracking_url": null, + "code_view_url": null, + "vcs_url": "https://github.com/daac-tools/daachorse", + "copyright": null, + "holder": null, + "declared_license_expression": null, + "declared_license_expression_spdx": null, + "license_detections": [], + "other_license_expression": null, + "other_license_expression_spdx": null, + "other_license_detections": [], + "extracted_license_statement": "MIT OR Apache-2.0", + "notice_text": null, + "source_packages": [], + "file_references": [], + "extra_data": { + "workspace": { + "members": [ + "bench", + "daacfind" + ] + } + }, + "dependencies": [], + "repository_homepage_url": "https://crates.io/crates/daachorse", + "repository_download_url": "https://crates.io/api/v1/crates/daachorse/0.4.1/download", + "api_data_url": "https://crates.io/api/v1/crates/daachorse", + "datasource_id": "cargo_toml", + "purl": "pkg:cargo/daachorse@0.4.1" + } + ], + "for_packages": [], + "scan_errors": [] + } + ] +} \ No newline at end of file diff --git a/tests/packagedcode/data/chef/package-only.scan.expected.json b/tests/packagedcode/data/chef/package-only.scan.expected.json new file mode 100644 index 00000000000..eb2362c2108 --- /dev/null +++ b/tests/packagedcode/data/chef/package-only.scan.expected.json @@ -0,0 +1,151 @@ +{ + "packages": [], + "dependencies": [], + "files": [ + { + "path": "package", + "type": "directory", + "package_data": [], + "for_packages": [], + "scan_errors": [] + }, + { + "path": "package/metadata.json", + "type": "file", + "package_data": [ + { + "type": "chef", + "namespace": null, + "name": "301", + "version": "0.1.0", + "qualifiers": {}, + "subpath": null, + "primary_language": "Ruby", + "description": "Installs/Configures 301", + "release_date": null, + "parties": [ + { + "type": null, + "role": "maintainer", + "name": "Mark Wilkerson", + "email": "mark@segfawlt.net", + "url": null + } + ], + "keywords": [], + "homepage_url": null, + "download_url": "https://supermarket.chef.io/cookbooks/301/versions/0.1.0/download", + "size": null, + "sha1": null, + "md5": null, + "sha256": null, + "sha512": null, + "bug_tracking_url": null, + "code_view_url": null, + "vcs_url": null, + "copyright": null, + "holder": null, + "declared_license_expression": null, + "declared_license_expression_spdx": null, + "license_detections": [], + "other_license_expression": null, + "other_license_expression_spdx": null, + "other_license_detections": [], + "extracted_license_statement": "MIT", + "notice_text": null, + "source_packages": [], + "file_references": [], + "extra_data": {}, + "dependencies": [ + { + "purl": "pkg:chef/nodejs", + "extracted_requirement": ">= 0.0.0", + "scope": "dependencies", + "is_runtime": true, + "is_optional": false, + "is_resolved": false, + "resolved_package": {}, + "extra_data": {} + } + ], + "repository_homepage_url": "https://supermarket.chef.io/cookbooks/301/versions/0.1.0/", + "repository_download_url": "https://supermarket.chef.io/cookbooks/301/versions/0.1.0/download", + "api_data_url": "https://supermarket.chef.io/api/v1/cookbooks/301/versions/0.1.0", + "datasource_id": "chef_cookbook_metadata_json", + "purl": "pkg:chef/301@0.1.0" + } + ], + "for_packages": [], + "scan_errors": [] + }, + { + "path": "package/metadata.rb", + "type": "file", + "package_data": [ + { + "type": "chef", + "namespace": null, + "name": "301", + "version": "0.1.0", + "qualifiers": {}, + "subpath": null, + "primary_language": "Ruby", + "description": "Installs/Configures 301", + "release_date": null, + "parties": [ + { + "type": null, + "role": "maintainer", + "name": "Mark Wilkerson", + "email": "mark@segfawlt.net", + "url": null + } + ], + "keywords": [], + "homepage_url": null, + "download_url": "https://supermarket.chef.io/cookbooks/301/versions/0.1.0/download", + "size": null, + "sha1": null, + "md5": null, + "sha256": null, + "sha512": null, + "bug_tracking_url": null, + "code_view_url": null, + "vcs_url": null, + "copyright": null, + "holder": null, + "declared_license_expression": null, + "declared_license_expression_spdx": null, + "license_detections": [], + "other_license_expression": null, + "other_license_expression_spdx": null, + "other_license_detections": [], + "extracted_license_statement": "MIT", + "notice_text": null, + "source_packages": [], + "file_references": [], + "extra_data": {}, + "dependencies": [ + { + "purl": "pkg:chef/nodejs", + "extracted_requirement": null, + "scope": "dependencies", + "is_runtime": true, + "is_optional": false, + "is_resolved": false, + "resolved_package": {}, + "extra_data": {} + } + ], + "repository_homepage_url": "https://supermarket.chef.io/cookbooks/301/versions/0.1.0/", + "repository_download_url": "https://supermarket.chef.io/cookbooks/301/versions/0.1.0/download", + "api_data_url": "https://supermarket.chef.io/api/v1/cookbooks/301/versions/0.1.0", + "datasource_id": "chef_cookbook_metadata_rb", + "purl": "pkg:chef/301@0.1.0" + } + ], + "for_packages": [], + "scan_errors": [] + } + ] +} \ No newline at end of file diff --git a/tests/packagedcode/data/cocoapods/assemble/solo/RxDataSources-package-only.podspec-expected.json b/tests/packagedcode/data/cocoapods/assemble/solo/RxDataSources-package-only.podspec-expected.json new file mode 100644 index 00000000000..93bbebb32e2 --- /dev/null +++ b/tests/packagedcode/data/cocoapods/assemble/solo/RxDataSources-package-only.podspec-expected.json @@ -0,0 +1,64 @@ +{ + "packages": [], + "dependencies": [], + "files": [ + { + "path": "RxDataSources.podspec", + "type": "file", + "package_data": [ + { + "type": "cocoapods", + "namespace": null, + "name": "RxDataSources", + "version": "4.0.1", + "qualifiers": {}, + "subpath": null, + "primary_language": "Objective-C", + "description": "This is a collection of reactive data sources for UITableView and UICollectionView.\n\nIt enables creation of animated data sources for table an collection views in just a couple of lines of code.\n\n```swift\nlet data: Observable
= ...\n\nlet dataSource = RxTableViewSectionedAnimatedDataSource
()\ndataSource.cellFactory = { (tv, ip, i) in\n let cell = tv.dequeueReusableCell(withIdentifier: \"Cell\") ?? UITableViewCell(style:.Default, reuseIdentifier: \"Cell\")\n cell.textLabel!.text = \"\\(i)\"\n return cell\n}\n\n// animated\ndata\n .bind(to: animatedTableView.rx.items(dataSource: dataSource))\n .disposed(by: disposeBag)\n\n// normal reload\ndata\n .bind(to: tableView.rx.items(dataSource: dataSource))\n .disposed(by: disposeBag)\n```", + "release_date": null, + "parties": [ + { + "type": "person", + "role": "author", + "name": "Krunoslav Zaher ", + "email": "krunoslav.zaher@gmail.com", + "url": null + } + ], + "keywords": [], + "homepage_url": "https://github.com/RxSwiftCommunity/RxDataSources", + "download_url": null, + "size": null, + "sha1": null, + "md5": null, + "sha256": null, + "sha512": null, + "bug_tracking_url": "https://github.com/RxSwiftCommunity/RxDataSources/issues/", + "code_view_url": "https://github.com/RxSwiftCommunity/RxDataSources/tree/4.0.1", + "vcs_url": "https://github.com/RxSwiftCommunity/RxDataSources.git", + "copyright": null, + "holder": null, + "declared_license_expression": null, + "declared_license_expression_spdx": null, + "license_detections": [], + "other_license_expression": null, + "other_license_expression_spdx": null, + "other_license_detections": [], + "extracted_license_statement": "MIT", + "notice_text": null, + "source_packages": [], + "file_references": [], + "extra_data": {}, + "dependencies": [], + "repository_homepage_url": "https://cocoapods.org/pods/RxDataSources", + "repository_download_url": "https://github.com/RxSwiftCommunity/RxDataSources/archive/refs/tags/4.0.1.zip", + "api_data_url": "https://raw.githubusercontent.com/CocoaPods/Specs/blob/master/Specs/9/a/4/RxDataSources/4.0.1/RxDataSources.podspec.json", + "datasource_id": "cocoapods_podspec", + "purl": "pkg:cocoapods/RxDataSources@4.0.1" + } + ], + "for_packages": [], + "scan_errors": [] + } + ] +} \ No newline at end of file diff --git a/tests/packagedcode/data/debian/basic/status-package-only.expected b/tests/packagedcode/data/debian/basic/status-package-only.expected new file mode 100644 index 00000000000..9266be9acd2 --- /dev/null +++ b/tests/packagedcode/data/debian/basic/status-package-only.expected @@ -0,0 +1,348 @@ +[ + { + "type": "deb", + "namespace": "ubuntu", + "name": "libncurses5", + "version": "6.1-1ubuntu1.18.04", + "qualifiers": { + "arch": "amd64" + }, + "subpath": null, + "primary_language": null, + "description": "shared libraries for terminal handling\n The ncurses library routines are a terminal-independent method of\n updating character screens with reasonable optimization.\n .\n This package contains the shared libraries necessary to run programs\n compiled with ncurses.", + "release_date": null, + "parties": [ + { + "type": null, + "role": "maintainer", + "name": "Ubuntu Developers", + "email": "ubuntu-devel-discuss@lists.ubuntu.com", + "url": null + } + ], + "keywords": [ + "libs" + ], + "homepage_url": "https://invisible-island.net/ncurses/", + "download_url": null, + "size": null, + "sha1": null, + "md5": null, + "sha256": null, + "sha512": null, + "bug_tracking_url": null, + "code_view_url": null, + "vcs_url": null, + "copyright": null, + "holder": null, + "declared_license_expression": null, + "declared_license_expression_spdx": null, + "license_detections": [], + "other_license_expression": null, + "other_license_expression_spdx": null, + "other_license_detections": [], + "extracted_license_statement": null, + "notice_text": null, + "source_packages": [ + "pkg:deb/ubuntu/ncurses" + ], + "file_references": [], + "extra_data": { + "multi_arch": "same" + }, + "dependencies": [], + "repository_homepage_url": null, + "repository_download_url": null, + "api_data_url": null, + "datasource_id": "debian_installed_status_db", + "purl": "pkg:deb/ubuntu/libncurses5@6.1-1ubuntu1.18.04?arch=amd64" + }, + { + "type": "deb", + "namespace": "ubuntu", + "name": "libcom-err2", + "version": "1.44.1-1ubuntu1.1", + "qualifiers": { + "arch": "amd64" + }, + "subpath": null, + "primary_language": null, + "description": "common error description library\n libcomerr is an attempt to present a common error-handling mechanism to\n manipulate the most common form of error code in a fashion that does not\n have the problems identified with mechanisms commonly in use.", + "release_date": null, + "parties": [ + { + "type": null, + "role": "maintainer", + "name": "Ubuntu Developers", + "email": "ubuntu-devel-discuss@lists.ubuntu.com", + "url": null + } + ], + "keywords": [ + "libs" + ], + "homepage_url": "http://e2fsprogs.sourceforge.net", + "download_url": null, + "size": null, + "sha1": null, + "md5": null, + "sha256": null, + "sha512": null, + "bug_tracking_url": null, + "code_view_url": null, + "vcs_url": null, + "copyright": null, + "holder": null, + "declared_license_expression": null, + "declared_license_expression_spdx": null, + "license_detections": [], + "other_license_expression": null, + "other_license_expression_spdx": null, + "other_license_detections": [], + "extracted_license_statement": null, + "notice_text": null, + "source_packages": [ + "pkg:deb/ubuntu/e2fsprogs" + ], + "file_references": [], + "extra_data": { + "multi_arch": "same" + }, + "dependencies": [], + "repository_homepage_url": null, + "repository_download_url": null, + "api_data_url": null, + "datasource_id": "debian_installed_status_db", + "purl": "pkg:deb/ubuntu/libcom-err2@1.44.1-1ubuntu1.1?arch=amd64" + }, + { + "type": "deb", + "namespace": "ubuntu", + "name": "libapt-pkg5.0", + "version": "1.6.11", + "qualifiers": { + "arch": "amd64" + }, + "subpath": null, + "primary_language": null, + "description": "package management runtime library\n This library provides the common functionality for searching and\n managing packages as well as information about packages.\n Higher-level package managers can depend upon this library.\n .\n This includes:\n * retrieval of information about packages from multiple sources\n * retrieval of packages and all dependent packages\n needed to satisfy a request either through an internal\n solver or by interfacing with an external one\n * authenticating the sources and validating the retrieved data\n * installation and removal of packages in the system\n * providing different transports to retrieve data over cdrom, ftp,\n http(s), rsh as well as an interface to add more transports like\n tor+http(s) (apt-transport-tor).", + "release_date": null, + "parties": [ + { + "type": null, + "role": "maintainer", + "name": "Ubuntu Developers", + "email": "ubuntu-devel-discuss@lists.ubuntu.com", + "url": null + } + ], + "keywords": [ + "libs" + ], + "homepage_url": null, + "download_url": null, + "size": null, + "sha1": null, + "md5": null, + "sha256": null, + "sha512": null, + "bug_tracking_url": null, + "code_view_url": null, + "vcs_url": null, + "copyright": null, + "holder": null, + "declared_license_expression": null, + "declared_license_expression_spdx": null, + "license_detections": [], + "other_license_expression": null, + "other_license_expression_spdx": null, + "other_license_detections": [], + "extracted_license_statement": null, + "notice_text": null, + "source_packages": [ + "pkg:deb/ubuntu/apt" + ], + "file_references": [], + "extra_data": { + "multi_arch": "same" + }, + "dependencies": [], + "repository_homepage_url": null, + "repository_download_url": null, + "api_data_url": null, + "datasource_id": "debian_installed_status_db", + "purl": "pkg:deb/ubuntu/libapt-pkg5.0@1.6.11?arch=amd64" + }, + { + "type": "deb", + "namespace": "ubuntu", + "name": "libaudit1", + "version": "1:2.8.2-1ubuntu1", + "qualifiers": { + "arch": "amd64" + }, + "subpath": null, + "primary_language": null, + "description": "Dynamic library for security auditing\n The audit-libs package contains the dynamic libraries needed for\n applications to use the audit framework. It is used to monitor systems for\n security related events.", + "release_date": null, + "parties": [ + { + "type": null, + "role": "maintainer", + "name": "Ubuntu Developers", + "email": "ubuntu-devel-discuss@lists.ubuntu.com", + "url": null + } + ], + "keywords": [ + "libs" + ], + "homepage_url": "https://people.redhat.com/sgrubb/audit/", + "download_url": null, + "size": null, + "sha1": null, + "md5": null, + "sha256": null, + "sha512": null, + "bug_tracking_url": null, + "code_view_url": null, + "vcs_url": null, + "copyright": null, + "holder": null, + "declared_license_expression": null, + "declared_license_expression_spdx": null, + "license_detections": [], + "other_license_expression": null, + "other_license_expression_spdx": null, + "other_license_detections": [], + "extracted_license_statement": null, + "notice_text": null, + "source_packages": [ + "pkg:deb/ubuntu/audit" + ], + "file_references": [], + "extra_data": { + "multi_arch": "same" + }, + "dependencies": [], + "repository_homepage_url": null, + "repository_download_url": null, + "api_data_url": null, + "datasource_id": "debian_installed_status_db", + "purl": "pkg:deb/ubuntu/libaudit1@1:2.8.2-1ubuntu1?arch=amd64" + }, + { + "type": "deb", + "namespace": "ubuntu", + "name": "perl-base", + "version": "5.26.1-6ubuntu0.3", + "qualifiers": { + "arch": "amd64" + }, + "subpath": null, + "primary_language": null, + "description": "minimal Perl system\n Perl is a scripting language used in many system scripts and utilities.\n .\n This package provides a Perl interpreter and the small subset of the\n standard run-time library required to perform basic tasks. For a full\n Perl installation, install \"perl\" (and its dependencies, \"perl-modules-5.26\"\n and \"perl-doc\").", + "release_date": null, + "parties": [ + { + "type": null, + "role": "maintainer", + "name": "Ubuntu Developers", + "email": "ubuntu-devel-discuss@lists.ubuntu.com", + "url": null + } + ], + "keywords": [ + "perl" + ], + "homepage_url": "http://dev.perl.org/perl5/", + "download_url": null, + "size": null, + "sha1": null, + "md5": null, + "sha256": null, + "sha512": null, + "bug_tracking_url": null, + "code_view_url": null, + "vcs_url": null, + "copyright": null, + "holder": null, + "declared_license_expression": null, + "declared_license_expression_spdx": null, + "license_detections": [], + "other_license_expression": null, + "other_license_expression_spdx": null, + "other_license_detections": [], + "extracted_license_statement": null, + "notice_text": null, + "source_packages": [ + "pkg:deb/ubuntu/perl" + ], + "file_references": [], + "extra_data": {}, + "dependencies": [], + "repository_homepage_url": null, + "repository_download_url": null, + "api_data_url": null, + "datasource_id": "debian_installed_status_db", + "purl": "pkg:deb/ubuntu/perl-base@5.26.1-6ubuntu0.3?arch=amd64" + }, + { + "type": "deb", + "namespace": "ubuntu", + "name": "libudev1", + "version": "237-3ubuntu10.22", + "qualifiers": { + "arch": "amd64" + }, + "subpath": null, + "primary_language": null, + "description": "libudev shared library\n This library provides access to udev device information.", + "release_date": null, + "parties": [ + { + "type": null, + "role": "maintainer", + "name": "Ubuntu Developers", + "email": "ubuntu-devel-discuss@lists.ubuntu.com", + "url": null + } + ], + "keywords": [ + "libs" + ], + "homepage_url": "https://www.freedesktop.org/wiki/Software/systemd", + "download_url": null, + "size": null, + "sha1": null, + "md5": null, + "sha256": null, + "sha512": null, + "bug_tracking_url": null, + "code_view_url": null, + "vcs_url": null, + "copyright": null, + "holder": null, + "declared_license_expression": null, + "declared_license_expression_spdx": null, + "license_detections": [], + "other_license_expression": null, + "other_license_expression_spdx": null, + "other_license_detections": [], + "extracted_license_statement": null, + "notice_text": null, + "source_packages": [ + "pkg:deb/ubuntu/systemd" + ], + "file_references": [], + "extra_data": { + "multi_arch": "same" + }, + "dependencies": [], + "repository_homepage_url": null, + "repository_download_url": null, + "api_data_url": null, + "datasource_id": "debian_installed_status_db", + "purl": "pkg:deb/ubuntu/libudev1@237-3ubuntu10.22?arch=amd64" + } +] \ No newline at end of file diff --git a/tests/packagedcode/data/freebsd/basic/+COMPACT_MANIFEST-package-only.expected b/tests/packagedcode/data/freebsd/basic/+COMPACT_MANIFEST-package-only.expected new file mode 100644 index 00000000000..9d7a4937eaf --- /dev/null +++ b/tests/packagedcode/data/freebsd/basic/+COMPACT_MANIFEST-package-only.expected @@ -0,0 +1,62 @@ +[ + { + "type": "freebsd", + "namespace": null, + "name": "dmidecode", + "version": "2.12", + "qualifiers": { + "arch": "freebsd:10:x86:64", + "origin": "sysutils/dmidecode" + }, + "subpath": null, + "primary_language": null, + "description": "Dmidecode is a tool or dumping a computer's DMI (some say SMBIOS) table\ncontents in a human-readable format. The output contains a description of the\nsystem's hardware components, as well as other useful pieces of information\nsuch as serial numbers and BIOS revision.\n\nWWW: http://www.nongnu.org/dmidecode/", + "release_date": null, + "parties": [ + { + "type": "person", + "role": "maintainer", + "name": null, + "email": "anders@FreeBSD.org", + "url": null + } + ], + "keywords": [ + "sysutils" + ], + "homepage_url": "http://www.nongnu.org/dmidecode/", + "download_url": "https://pkg.freebsd.org/freebsd:10:x86:64/latest/All/dmidecode-2.12.txz", + "size": null, + "sha1": null, + "md5": null, + "sha256": null, + "sha512": null, + "bug_tracking_url": null, + "code_view_url": "https://svnweb.freebsd.org/ports/head/sysutils/dmidecode", + "vcs_url": null, + "copyright": null, + "holder": null, + "declared_license_expression": null, + "declared_license_expression_spdx": null, + "license_detections": [], + "other_license_expression": null, + "other_license_expression_spdx": null, + "other_license_detections": [], + "extracted_license_statement": { + "licenses": [ + "GPLv2" + ], + "licenselogic": "single" + }, + "notice_text": null, + "source_packages": [], + "file_references": [], + "extra_data": {}, + "dependencies": [], + "repository_homepage_url": null, + "repository_download_url": null, + "api_data_url": null, + "datasource_id": "freebsd_compact_manifest", + "purl": "pkg:freebsd/dmidecode@2.12?arch=freebsd:10:x86:64&origin=sysutils/dmidecode" + } +] \ No newline at end of file diff --git a/tests/packagedcode/data/maven_misc/assemble/johnzon-jsonb-1.2.11-package-only-expected.json b/tests/packagedcode/data/maven_misc/assemble/johnzon-jsonb-1.2.11-package-only-expected.json new file mode 100644 index 00000000000..f62caf2832a --- /dev/null +++ b/tests/packagedcode/data/maven_misc/assemble/johnzon-jsonb-1.2.11-package-only-expected.json @@ -0,0 +1,395 @@ +{ + "packages": [], + "dependencies": [], + "files": [ + { + "path": "johnzon-jsonb-1.2.11", + "type": "directory", + "package_data": [], + "for_packages": [], + "scan_errors": [] + }, + { + "path": "johnzon-jsonb-1.2.11/META-INF", + "type": "directory", + "package_data": [], + "for_packages": [], + "scan_errors": [] + }, + { + "path": "johnzon-jsonb-1.2.11/META-INF/DEPENDENCIES", + "type": "file", + "package_data": [], + "for_packages": [], + "scan_errors": [] + }, + { + "path": "johnzon-jsonb-1.2.11/META-INF/LICENSE", + "type": "file", + "package_data": [], + "for_packages": [], + "scan_errors": [] + }, + { + "path": "johnzon-jsonb-1.2.11/META-INF/MANIFEST.MF", + "type": "file", + "package_data": [ + { + "type": "jar", + "namespace": "org.apache.johnzon", + "name": "Johnzon :: JSON-B Implementation", + "version": "1.2.11", + "qualifiers": {}, + "subpath": null, + "primary_language": null, + "description": "Apache Johnzon is an implementation of JSR-353 (JavaTM API for JSON Processing).", + "release_date": null, + "parties": [ + { + "role": "vendor", + "name": "The Apache Software Foundation" + } + ], + "keywords": [], + "homepage_url": "http://johnzon.apache.org/johnzon-jsonb", + "download_url": null, + "size": null, + "sha1": null, + "md5": null, + "sha256": null, + "sha512": null, + "bug_tracking_url": null, + "code_view_url": null, + "vcs_url": null, + "copyright": null, + "holder": null, + "declared_license_expression": null, + "declared_license_expression_spdx": null, + "license_detections": [], + "other_license_expression": null, + "other_license_expression_spdx": null, + "other_license_detections": [], + "extracted_license_statement": "http://www.apache.org/licenses/LICENSE-2.0.txt", + "notice_text": null, + "source_packages": [], + "file_references": [], + "extra_data": { + "documentation_url": "http://johnzon.apache.org/" + }, + "dependencies": [], + "repository_homepage_url": null, + "repository_download_url": null, + "api_data_url": null, + "datasource_id": "java_jar_manifest", + "purl": "pkg:jar/org.apache.johnzon/Johnzon%20::%20JSON-B%20Implementation@1.2.11" + } + ], + "for_packages": [], + "scan_errors": [] + }, + { + "path": "johnzon-jsonb-1.2.11/META-INF/NOTICE", + "type": "file", + "package_data": [], + "for_packages": [], + "scan_errors": [] + }, + { + "path": "johnzon-jsonb-1.2.11/META-INF/maven", + "type": "directory", + "package_data": [], + "for_packages": [], + "scan_errors": [] + }, + { + "path": "johnzon-jsonb-1.2.11/META-INF/maven/org.apache.johnzon", + "type": "directory", + "package_data": [], + "for_packages": [], + "scan_errors": [] + }, + { + "path": "johnzon-jsonb-1.2.11/META-INF/maven/org.apache.johnzon/johnzon-jsonb", + "type": "directory", + "package_data": [], + "for_packages": [], + "scan_errors": [] + }, + { + "path": "johnzon-jsonb-1.2.11/META-INF/maven/org.apache.johnzon/johnzon-jsonb/pom.properties", + "type": "file", + "package_data": [ + { + "type": "maven", + "namespace": "org.apache.johnzon", + "name": "johnzon-jsonb", + "version": "1.2.11", + "qualifiers": {}, + "subpath": null, + "primary_language": "Java", + "description": null, + "release_date": null, + "parties": [], + "keywords": [], + "homepage_url": null, + "download_url": null, + "size": null, + "sha1": null, + "md5": null, + "sha256": null, + "sha512": null, + "bug_tracking_url": null, + "code_view_url": null, + "vcs_url": null, + "copyright": null, + "holder": null, + "declared_license_expression": null, + "declared_license_expression_spdx": null, + "license_detections": [], + "other_license_expression": null, + "other_license_expression_spdx": null, + "other_license_detections": [], + "extracted_license_statement": null, + "notice_text": null, + "source_packages": [], + "file_references": [], + "extra_data": {}, + "dependencies": [], + "repository_homepage_url": null, + "repository_download_url": null, + "api_data_url": null, + "datasource_id": "maven_pom_properties", + "purl": "pkg:maven/org.apache.johnzon/johnzon-jsonb@1.2.11" + } + ], + "for_packages": [], + "scan_errors": [] + }, + { + "path": "johnzon-jsonb-1.2.11/META-INF/maven/org.apache.johnzon/johnzon-jsonb/pom.xml", + "type": "file", + "package_data": [ + { + "type": "maven", + "namespace": "org.apache.johnzon", + "name": "johnzon-jsonb", + "version": "1.2.11", + "qualifiers": {}, + "subpath": null, + "primary_language": "Java", + "description": "Johnzon :: JSON-B Implementation", + "release_date": null, + "parties": [], + "keywords": [], + "homepage_url": null, + "download_url": null, + "size": null, + "sha1": null, + "md5": null, + "sha256": null, + "sha512": null, + "bug_tracking_url": null, + "code_view_url": null, + "vcs_url": null, + "copyright": null, + "holder": null, + "declared_license_expression": null, + "declared_license_expression_spdx": null, + "license_detections": [], + "other_license_expression": null, + "other_license_expression_spdx": null, + "other_license_detections": [], + "extracted_license_statement": null, + "notice_text": null, + "source_packages": [ + "pkg:maven/org.apache.johnzon/johnzon-jsonb@1.2.11?classifier=sources" + ], + "file_references": [], + "extra_data": {}, + "dependencies": [ + { + "purl": "pkg:maven/org.apache.geronimo.specs/geronimo-annotation_1.3_spec@1.1", + "extracted_requirement": "1.1", + "scope": "provided", + "is_runtime": true, + "is_optional": true, + "is_resolved": true, + "resolved_package": {}, + "extra_data": {} + }, + { + "purl": "pkg:maven/org.apache.geronimo.specs/geronimo-jaxrs_2.1_spec@1.1", + "extracted_requirement": "1.1", + "scope": "provided", + "is_runtime": true, + "is_optional": true, + "is_resolved": true, + "resolved_package": {}, + "extra_data": {} + }, + { + "purl": "pkg:maven/org.apache.geronimo.specs/geronimo-jcdi_2.0_spec@1.1", + "extracted_requirement": "1.1", + "scope": "provided", + "is_runtime": true, + "is_optional": true, + "is_resolved": true, + "resolved_package": {}, + "extra_data": {} + }, + { + "purl": "pkg:maven/org.apache.geronimo.specs/geronimo-jsonb_1.0_spec", + "extracted_requirement": null, + "scope": "provided", + "is_runtime": true, + "is_optional": false, + "is_resolved": false, + "resolved_package": {}, + "extra_data": {} + }, + { + "purl": "pkg:maven/org.apache.johnzon/johnzon-mapper@1.2.11", + "extracted_requirement": "1.2.11", + "scope": "compile", + "is_runtime": false, + "is_optional": true, + "is_resolved": true, + "resolved_package": {}, + "extra_data": {} + }, + { + "purl": "pkg:maven/org.apache.cxf/cxf-rt-rs-client", + "extracted_requirement": "${cxf.version}", + "scope": "test", + "is_runtime": false, + "is_optional": true, + "is_resolved": false, + "resolved_package": {}, + "extra_data": {} + }, + { + "purl": "pkg:maven/org.apache.cxf/cxf-rt-frontend-jaxrs", + "extracted_requirement": "${cxf.version}", + "scope": "test", + "is_runtime": false, + "is_optional": true, + "is_resolved": false, + "resolved_package": {}, + "extra_data": {} + }, + { + "purl": "pkg:maven/org.apache.cxf/cxf-rt-transports-local", + "extracted_requirement": "${cxf.version}", + "scope": "test", + "is_runtime": false, + "is_optional": true, + "is_resolved": false, + "resolved_package": {}, + "extra_data": {} + }, + { + "purl": "pkg:maven/org.apache.geronimo.specs/geronimo-interceptor_1.2_spec@1.0", + "extracted_requirement": "1.0", + "scope": "test", + "is_runtime": false, + "is_optional": true, + "is_resolved": true, + "resolved_package": {}, + "extra_data": {} + }, + { + "purl": "pkg:maven/org.apache.geronimo.specs/geronimo-atinject_1.0_spec@1.0", + "extracted_requirement": "1.0", + "scope": "test", + "is_runtime": false, + "is_optional": true, + "is_resolved": true, + "resolved_package": {}, + "extra_data": {} + }, + { + "purl": "pkg:maven/org.apache.openwebbeans/openwebbeans-impl", + "extracted_requirement": "${owb.version}", + "scope": "test", + "is_runtime": false, + "is_optional": true, + "is_resolved": false, + "resolved_package": {}, + "extra_data": {} + } + ], + "repository_homepage_url": "https://repo1.maven.org/maven2/org/apache/johnzon/johnzon-jsonb/1.2.11/", + "repository_download_url": "https://repo1.maven.org/maven2/org/apache/johnzon/johnzon-jsonb/1.2.11/johnzon-jsonb-1.2.11.jar", + "api_data_url": "https://repo1.maven.org/maven2/org/apache/johnzon/johnzon-jsonb/1.2.11/johnzon-jsonb-1.2.11.pom", + "datasource_id": "maven_pom", + "purl": "pkg:maven/org.apache.johnzon/johnzon-jsonb@1.2.11" + } + ], + "for_packages": [], + "scan_errors": [] + }, + { + "path": "johnzon-jsonb-1.2.11/org", + "type": "directory", + "package_data": [], + "for_packages": [], + "scan_errors": [] + }, + { + "path": "johnzon-jsonb-1.2.11/org/apache", + "type": "directory", + "package_data": [], + "for_packages": [], + "scan_errors": [] + }, + { + "path": "johnzon-jsonb-1.2.11/org/apache/johnzon", + "type": "directory", + "package_data": [], + "for_packages": [], + "scan_errors": [] + }, + { + "path": "johnzon-jsonb-1.2.11/org/apache/johnzon/jaxrs", + "type": "directory", + "package_data": [], + "for_packages": [], + "scan_errors": [] + }, + { + "path": "johnzon-jsonb-1.2.11/org/apache/johnzon/jaxrs/jsonb", + "type": "directory", + "package_data": [], + "for_packages": [], + "scan_errors": [] + }, + { + "path": "johnzon-jsonb-1.2.11/org/apache/johnzon/jaxrs/jsonb/jaxrs", + "type": "directory", + "package_data": [], + "for_packages": [], + "scan_errors": [] + }, + { + "path": "johnzon-jsonb-1.2.11/org/apache/johnzon/jaxrs/jsonb/jaxrs/JsonbJaxrsProvider.class", + "type": "file", + "package_data": [], + "for_packages": [], + "scan_errors": [] + }, + { + "path": "johnzon-jsonb-1.2.11/org/apache/johnzon/jsonb", + "type": "directory", + "package_data": [], + "for_packages": [], + "scan_errors": [] + }, + { + "path": "johnzon-jsonb-1.2.11/org/apache/johnzon/jsonb/JohnzonBuilder.class", + "type": "file", + "package_data": [], + "for_packages": [], + "scan_errors": [] + } + ] +} \ No newline at end of file diff --git a/tests/packagedcode/data/npm/scan-nested/scan-package-only.expected.json b/tests/packagedcode/data/npm/scan-nested/scan-package-only.expected.json new file mode 100644 index 00000000000..ff9ce0e7f18 --- /dev/null +++ b/tests/packagedcode/data/npm/scan-nested/scan-package-only.expected.json @@ -0,0 +1,952 @@ +{ + "packages": [], + "dependencies": [], + "files": [ + { + "path": "scan", + "type": "directory", + "package_data": [], + "for_packages": [], + "scan_errors": [] + }, + { + "path": "scan/node_modules", + "type": "directory", + "package_data": [], + "for_packages": [], + "scan_errors": [] + }, + { + "path": "scan/node_modules/sequelize", + "type": "directory", + "package_data": [], + "for_packages": [], + "scan_errors": [] + }, + { + "path": "scan/node_modules/sequelize/package-lock.json", + "type": "file", + "package_data": [ + { + "type": "npm", + "namespace": "", + "name": "sequelize", + "version": "3.30.2", + "qualifiers": {}, + "subpath": null, + "primary_language": "JavaScript", + "description": null, + "release_date": null, + "parties": [], + "keywords": [], + "homepage_url": null, + "download_url": null, + "size": null, + "sha1": null, + "md5": null, + "sha256": null, + "sha512": null, + "bug_tracking_url": null, + "code_view_url": null, + "vcs_url": null, + "copyright": null, + "holder": null, + "declared_license_expression": null, + "declared_license_expression_spdx": null, + "license_detections": [], + "other_license_expression": null, + "other_license_expression_spdx": null, + "other_license_detections": [], + "extracted_license_statement": null, + "notice_text": null, + "source_packages": [], + "file_references": [], + "extra_data": { + "lockfile_version": 1 + }, + "dependencies": [ + { + "purl": "pkg:npm/ansi-regex@2.1.1", + "extracted_requirement": "2.1.1", + "scope": "devDependencies", + "is_runtime": false, + "is_optional": true, + "is_resolved": true, + "resolved_package": { + "type": "npm", + "namespace": "", + "name": "ansi-regex", + "version": "2.1.1", + "qualifiers": {}, + "subpath": null, + "primary_language": "JavaScript", + "description": null, + "release_date": null, + "parties": [], + "keywords": [], + "homepage_url": null, + "download_url": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "size": null, + "sha1": "c3b33ab5ee360d86e0e628f0468ae7ef27d654df", + "md5": null, + "sha256": null, + "sha512": null, + "bug_tracking_url": null, + "code_view_url": null, + "vcs_url": null, + "copyright": null, + "holder": null, + "declared_license_expression": null, + "declared_license_expression_spdx": null, + "license_detections": [], + "other_license_expression": null, + "other_license_expression_spdx": null, + "other_license_detections": [], + "extracted_license_statement": null, + "notice_text": null, + "source_packages": [], + "file_references": [ + [ + { + "path": "ansi-regex", + "size": 0, + "sha1": null, + "md5": null, + "sha256": null, + "sha512": null, + "extra_data": {} + } + ] + ], + "extra_data": {}, + "dependencies": [], + "repository_homepage_url": "https://www.npmjs.com/package/ansi-regex", + "repository_download_url": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "api_data_url": "https://registry.npmjs.org/ansi-regex/2.1.1", + "datasource_id": "npm_package_lock_json", + "purl": "pkg:npm/ansi-regex@2.1.1" + }, + "extra_data": {} + }, + { + "purl": "pkg:npm/to-fast-properties@1.0.3", + "extracted_requirement": "1.0.3", + "scope": "devDependencies", + "is_runtime": false, + "is_optional": true, + "is_resolved": true, + "resolved_package": { + "type": "npm", + "namespace": "", + "name": "to-fast-properties", + "version": "1.0.3", + "qualifiers": {}, + "subpath": null, + "primary_language": "JavaScript", + "description": null, + "release_date": null, + "parties": [], + "keywords": [], + "homepage_url": null, + "download_url": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-1.0.3.tgz", + "size": null, + "sha1": "b83571fa4d8c25b82e231b06e3a3055de4ca1a47", + "md5": null, + "sha256": null, + "sha512": null, + "bug_tracking_url": null, + "code_view_url": null, + "vcs_url": null, + "copyright": null, + "holder": null, + "declared_license_expression": null, + "declared_license_expression_spdx": null, + "license_detections": [], + "other_license_expression": null, + "other_license_expression_spdx": null, + "other_license_detections": [], + "extracted_license_statement": null, + "notice_text": null, + "source_packages": [], + "file_references": [ + [ + { + "path": "to-fast-properties", + "size": 0, + "sha1": null, + "md5": null, + "sha256": null, + "sha512": null, + "extra_data": {} + } + ] + ], + "extra_data": {}, + "dependencies": [], + "repository_homepage_url": "https://www.npmjs.com/package/to-fast-properties", + "repository_download_url": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-1.0.3.tgz", + "api_data_url": "https://registry.npmjs.org/to-fast-properties/1.0.3", + "datasource_id": "npm_package_lock_json", + "purl": "pkg:npm/to-fast-properties@1.0.3" + }, + "extra_data": {} + } + ], + "repository_homepage_url": "https://www.npmjs.com/package/sequelize", + "repository_download_url": "https://registry.npmjs.org/sequelize/-/sequelize-3.30.2.tgz", + "api_data_url": "https://registry.npmjs.org/sequelize/3.30.2", + "datasource_id": "npm_package_lock_json", + "purl": "pkg:npm/sequelize@3.30.2" + } + ], + "for_packages": [], + "scan_errors": [] + }, + { + "path": "scan/node_modules/sequelize/package.json", + "type": "file", + "package_data": [ + { + "type": "npm", + "namespace": null, + "name": "sequelize", + "version": "3.30.2", + "qualifiers": {}, + "subpath": null, + "primary_language": "JavaScript", + "description": "Multi dialect ORM for Node.JS/io.js", + "release_date": null, + "parties": [ + { + "type": "person", + "role": "author", + "name": "Sascha Depold", + "email": "sascha@depold.com", + "url": null + }, + { + "type": "person", + "role": "contributor", + "name": "Sascha Depold", + "email": "sascha@depold.com", + "url": null + }, + { + "type": "person", + "role": "contributor", + "name": "Jan Aagaard Meier", + "email": "janzeh@gmail.com\njmei@itu.dk", + "url": null + }, + { + "type": "person", + "role": "contributor", + "name": "Daniel Durante", + "email": "me@danieldurante.com", + "url": null + }, + { + "type": "person", + "role": "contributor", + "name": "Mick Hansen", + "email": "mick.kasper.hansen@gmail.com", + "url": null + } + ], + "keywords": [ + "mysql", + "nodejs", + "object relational mapper" + ], + "homepage_url": null, + "download_url": "https://registry.npmjs.org/sequelize/-/sequelize-3.30.2.tgz", + "size": null, + "sha1": null, + "md5": null, + "sha256": null, + "sha512": null, + "bug_tracking_url": "https://github.com/sequelize/sequelize/issues", + "code_view_url": null, + "vcs_url": "git+https://github.com/sequelize/sequelize.git", + "copyright": null, + "holder": null, + "declared_license_expression": null, + "declared_license_expression_spdx": null, + "license_detections": [], + "other_license_expression": null, + "other_license_expression_spdx": null, + "other_license_detections": [], + "extracted_license_statement": [ + "MIT" + ], + "notice_text": null, + "source_packages": [], + "file_references": [], + "extra_data": {}, + "dependencies": [ + { + "purl": "pkg:npm/bluebird", + "extracted_requirement": "^3.3.4", + "scope": "dependencies", + "is_runtime": true, + "is_optional": false, + "is_resolved": false, + "resolved_package": {}, + "extra_data": {} + }, + { + "purl": "pkg:npm/wkx", + "extracted_requirement": "0.2.0", + "scope": "dependencies", + "is_runtime": true, + "is_optional": false, + "is_resolved": false, + "resolved_package": {}, + "extra_data": {} + }, + { + "purl": "pkg:npm/chai", + "extracted_requirement": "^3.5.0", + "scope": "devDependencies", + "is_runtime": false, + "is_optional": true, + "is_resolved": false, + "resolved_package": {}, + "extra_data": {} + }, + { + "purl": "pkg:npm/chai-as-promised", + "extracted_requirement": "^5.1.0", + "scope": "devDependencies", + "is_runtime": false, + "is_optional": true, + "is_resolved": false, + "resolved_package": {}, + "extra_data": {} + }, + { + "purl": "pkg:npm/watchr", + "extracted_requirement": "~2.4.11", + "scope": "devDependencies", + "is_runtime": false, + "is_optional": true, + "is_resolved": false, + "resolved_package": {}, + "extra_data": {} + } + ], + "repository_homepage_url": "https://www.npmjs.com/package/sequelize", + "repository_download_url": "https://registry.npmjs.org/sequelize/-/sequelize-3.30.2.tgz", + "api_data_url": "https://registry.npmjs.org/sequelize/3.30.2", + "datasource_id": "npm_package_json", + "purl": "pkg:npm/sequelize@3.30.2" + } + ], + "for_packages": [], + "scan_errors": [] + }, + { + "path": "scan/node_modules/sequelize/yarn.lock", + "type": "file", + "package_data": [ + { + "type": "npm", + "namespace": null, + "name": null, + "version": null, + "qualifiers": {}, + "subpath": null, + "primary_language": "JavaScript", + "description": null, + "release_date": null, + "parties": [], + "keywords": [], + "homepage_url": null, + "download_url": null, + "size": null, + "sha1": null, + "md5": null, + "sha256": null, + "sha512": null, + "bug_tracking_url": null, + "code_view_url": null, + "vcs_url": null, + "copyright": null, + "holder": null, + "declared_license_expression": null, + "declared_license_expression_spdx": null, + "license_detections": [], + "other_license_expression": null, + "other_license_expression_spdx": null, + "other_license_detections": [], + "extracted_license_statement": null, + "notice_text": null, + "source_packages": [], + "file_references": [], + "extra_data": {}, + "dependencies": [ + { + "purl": "pkg:npm/abbrev@1.0.9", + "extracted_requirement": "1", + "scope": "dependencies", + "is_runtime": true, + "is_optional": false, + "is_resolved": true, + "resolved_package": { + "type": "npm", + "namespace": "", + "name": "abbrev", + "version": "1.0.9", + "qualifiers": {}, + "subpath": null, + "primary_language": "JavaScript", + "description": null, + "release_date": null, + "parties": [], + "keywords": [], + "homepage_url": null, + "download_url": "https://registry.yarnpkg.com/abbrev/-/abbrev-1.0.9.tgz", + "size": null, + "sha1": "91b4792588a7738c25f35dd6f63752a2f8776135", + "md5": null, + "sha256": null, + "sha512": null, + "bug_tracking_url": null, + "code_view_url": null, + "vcs_url": null, + "copyright": null, + "holder": null, + "declared_license_expression": null, + "declared_license_expression_spdx": null, + "license_detections": [], + "other_license_expression": null, + "other_license_expression_spdx": null, + "other_license_detections": [], + "extracted_license_statement": null, + "notice_text": null, + "source_packages": [], + "file_references": [], + "extra_data": {}, + "dependencies": [], + "repository_homepage_url": "https://www.npmjs.com/package/abbrev", + "repository_download_url": "https://registry.npmjs.org/abbrev/-/abbrev-1.0.9.tgz", + "api_data_url": "https://registry.npmjs.org/abbrev/1.0.9", + "datasource_id": "yarn_lock_v1", + "purl": "pkg:npm/abbrev@1.0.9" + }, + "extra_data": {} + }, + { + "purl": "pkg:npm/xdg-basedir@2.0.0", + "extracted_requirement": "^2.0.0", + "scope": "dependencies", + "is_runtime": true, + "is_optional": false, + "is_resolved": true, + "resolved_package": { + "type": "npm", + "namespace": "", + "name": "xdg-basedir", + "version": "2.0.0", + "qualifiers": {}, + "subpath": null, + "primary_language": "JavaScript", + "description": null, + "release_date": null, + "parties": [], + "keywords": [], + "homepage_url": null, + "download_url": "https://registry.yarnpkg.com/xdg-basedir/-/xdg-basedir-2.0.0.tgz", + "size": null, + "sha1": "edbc903cc385fc04523d966a335504b5504d1bd2", + "md5": null, + "sha256": null, + "sha512": null, + "bug_tracking_url": null, + "code_view_url": null, + "vcs_url": null, + "copyright": null, + "holder": null, + "declared_license_expression": null, + "declared_license_expression_spdx": null, + "license_detections": [], + "other_license_expression": null, + "other_license_expression_spdx": null, + "other_license_detections": [], + "extracted_license_statement": null, + "notice_text": null, + "source_packages": [], + "file_references": [], + "extra_data": {}, + "dependencies": [ + { + "purl": "pkg:npm/os-homedir", + "extracted_requirement": "^1.0.0", + "scope": "dependencies", + "is_runtime": true, + "is_optional": false, + "is_resolved": false, + "resolved_package": {}, + "extra_data": {} + } + ], + "repository_homepage_url": "https://www.npmjs.com/package/xdg-basedir", + "repository_download_url": "https://registry.npmjs.org/xdg-basedir/-/xdg-basedir-2.0.0.tgz", + "api_data_url": "https://registry.npmjs.org/xdg-basedir/2.0.0", + "datasource_id": "yarn_lock_v1", + "purl": "pkg:npm/xdg-basedir@2.0.0" + }, + "extra_data": {} + }, + { + "purl": "pkg:npm/xtend@4.0.1", + "extracted_requirement": "^4.0.0 ~4.0.1", + "scope": "dependencies", + "is_runtime": true, + "is_optional": false, + "is_resolved": true, + "resolved_package": { + "type": "npm", + "namespace": "", + "name": "xtend", + "version": "4.0.1", + "qualifiers": {}, + "subpath": null, + "primary_language": "JavaScript", + "description": null, + "release_date": null, + "parties": [], + "keywords": [], + "homepage_url": null, + "download_url": "https://registry.yarnpkg.com/xtend/-/xtend-4.0.1.tgz", + "size": null, + "sha1": "a5c6d532be656e23db820efb943a1f04998d63af", + "md5": null, + "sha256": null, + "sha512": null, + "bug_tracking_url": null, + "code_view_url": null, + "vcs_url": null, + "copyright": null, + "holder": null, + "declared_license_expression": null, + "declared_license_expression_spdx": null, + "license_detections": [], + "other_license_expression": null, + "other_license_expression_spdx": null, + "other_license_detections": [], + "extracted_license_statement": null, + "notice_text": null, + "source_packages": [], + "file_references": [], + "extra_data": {}, + "dependencies": [], + "repository_homepage_url": "https://www.npmjs.com/package/xtend", + "repository_download_url": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz", + "api_data_url": "https://registry.npmjs.org/xtend/4.0.1", + "datasource_id": "yarn_lock_v1", + "purl": "pkg:npm/xtend@4.0.1" + }, + "extra_data": {} + }, + { + "purl": "pkg:npm/yallist@2.0.0", + "extracted_requirement": "^2.0.0", + "scope": "dependencies", + "is_runtime": true, + "is_optional": false, + "is_resolved": true, + "resolved_package": { + "type": "npm", + "namespace": "", + "name": "yallist", + "version": "2.0.0", + "qualifiers": {}, + "subpath": null, + "primary_language": "JavaScript", + "description": null, + "release_date": null, + "parties": [], + "keywords": [], + "homepage_url": null, + "download_url": "https://registry.yarnpkg.com/yallist/-/yallist-2.0.0.tgz", + "size": null, + "sha1": "306c543835f09ee1a4cb23b7bce9ab341c91cdd4", + "md5": null, + "sha256": null, + "sha512": null, + "bug_tracking_url": null, + "code_view_url": null, + "vcs_url": null, + "copyright": null, + "holder": null, + "declared_license_expression": null, + "declared_license_expression_spdx": null, + "license_detections": [], + "other_license_expression": null, + "other_license_expression_spdx": null, + "other_license_detections": [], + "extracted_license_statement": null, + "notice_text": null, + "source_packages": [], + "file_references": [], + "extra_data": {}, + "dependencies": [], + "repository_homepage_url": "https://www.npmjs.com/package/yallist", + "repository_download_url": "https://registry.npmjs.org/yallist/-/yallist-2.0.0.tgz", + "api_data_url": "https://registry.npmjs.org/yallist/2.0.0", + "datasource_id": "yarn_lock_v1", + "purl": "pkg:npm/yallist@2.0.0" + }, + "extra_data": {} + } + ], + "repository_homepage_url": null, + "repository_download_url": null, + "api_data_url": null, + "datasource_id": "yarn_lock_v1", + "purl": null + } + ], + "for_packages": [], + "scan_errors": [] + }, + { + "path": "scan/package-lock.json", + "type": "file", + "package_data": [ + { + "type": "npm", + "namespace": "", + "name": "lodash.clonedeep", + "version": "4.3.2", + "qualifiers": {}, + "subpath": null, + "primary_language": "JavaScript", + "description": null, + "release_date": null, + "parties": [], + "keywords": [], + "homepage_url": null, + "download_url": null, + "size": null, + "sha1": null, + "md5": null, + "sha256": null, + "sha512": null, + "bug_tracking_url": null, + "code_view_url": null, + "vcs_url": null, + "copyright": null, + "holder": null, + "declared_license_expression": null, + "declared_license_expression_spdx": null, + "license_detections": [], + "other_license_expression": null, + "other_license_expression_spdx": null, + "other_license_detections": [], + "extracted_license_statement": null, + "notice_text": null, + "source_packages": [], + "file_references": [], + "extra_data": { + "lockfile_version": 1 + }, + "dependencies": [ + { + "purl": "pkg:npm/ms@2.0.0", + "extracted_requirement": "2.0.0", + "scope": "devDependencies", + "is_runtime": false, + "is_optional": true, + "is_resolved": true, + "resolved_package": { + "type": "npm", + "namespace": "", + "name": "ms", + "version": "2.0.0", + "qualifiers": {}, + "subpath": null, + "primary_language": "JavaScript", + "description": null, + "release_date": null, + "parties": [], + "keywords": [], + "homepage_url": null, + "download_url": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "size": null, + "sha1": "5608aeadfc00be6c2901df5f9861788de0d597c8", + "md5": null, + "sha256": null, + "sha512": null, + "bug_tracking_url": null, + "code_view_url": null, + "vcs_url": null, + "copyright": null, + "holder": null, + "declared_license_expression": null, + "declared_license_expression_spdx": null, + "license_detections": [], + "other_license_expression": null, + "other_license_expression_spdx": null, + "other_license_detections": [], + "extracted_license_statement": null, + "notice_text": null, + "source_packages": [], + "file_references": [ + [ + { + "path": "ms", + "size": 0, + "sha1": null, + "md5": null, + "sha256": null, + "sha512": null, + "extra_data": {} + } + ] + ], + "extra_data": {}, + "dependencies": [], + "repository_homepage_url": "https://www.npmjs.com/package/ms", + "repository_download_url": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "api_data_url": "https://registry.npmjs.org/ms/2.0.0", + "datasource_id": "npm_package_lock_json", + "purl": "pkg:npm/ms@2.0.0" + }, + "extra_data": {} + }, + { + "purl": "pkg:npm/regenerator-runtime@0.11.0", + "extracted_requirement": "0.11.0", + "scope": "dependencies", + "is_runtime": true, + "is_optional": false, + "is_resolved": true, + "resolved_package": { + "type": "npm", + "namespace": "", + "name": "regenerator-runtime", + "version": "0.11.0", + "qualifiers": {}, + "subpath": null, + "primary_language": "JavaScript", + "description": null, + "release_date": null, + "parties": [], + "keywords": [], + "homepage_url": null, + "download_url": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.11.0.tgz", + "size": null, + "sha1": null, + "md5": null, + "sha256": null, + "sha512": "fda03490b7916f937d2b47787f0ee8a046c8fb10def83283e3df4442aca01aa792f0ddf1b68d79a74f6e636c63ee2c4ff35b0d3d7bd12e701022a7554ad81bd4", + "bug_tracking_url": null, + "code_view_url": null, + "vcs_url": null, + "copyright": null, + "holder": null, + "declared_license_expression": null, + "declared_license_expression_spdx": null, + "license_detections": [], + "other_license_expression": null, + "other_license_expression_spdx": null, + "other_license_detections": [], + "extracted_license_statement": null, + "notice_text": null, + "source_packages": [], + "file_references": [ + [ + { + "path": "regenerator-runtime", + "size": 0, + "sha1": null, + "md5": null, + "sha256": null, + "sha512": null, + "extra_data": {} + } + ] + ], + "extra_data": {}, + "dependencies": [], + "repository_homepage_url": "https://www.npmjs.com/package/regenerator-runtime", + "repository_download_url": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.11.0.tgz", + "api_data_url": "https://registry.npmjs.org/regenerator-runtime/0.11.0", + "datasource_id": "npm_package_lock_json", + "purl": "pkg:npm/regenerator-runtime@0.11.0" + }, + "extra_data": {} + }, + { + "purl": "pkg:npm/to-fast-properties@1.0.3", + "extracted_requirement": "1.0.3", + "scope": "devDependencies", + "is_runtime": false, + "is_optional": true, + "is_resolved": true, + "resolved_package": { + "type": "npm", + "namespace": "", + "name": "to-fast-properties", + "version": "1.0.3", + "qualifiers": {}, + "subpath": null, + "primary_language": "JavaScript", + "description": null, + "release_date": null, + "parties": [], + "keywords": [], + "homepage_url": null, + "download_url": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-1.0.3.tgz", + "size": null, + "sha1": "b83571fa4d8c25b82e231b06e3a3055de4ca1a47", + "md5": null, + "sha256": null, + "sha512": null, + "bug_tracking_url": null, + "code_view_url": null, + "vcs_url": null, + "copyright": null, + "holder": null, + "declared_license_expression": null, + "declared_license_expression_spdx": null, + "license_detections": [], + "other_license_expression": null, + "other_license_expression_spdx": null, + "other_license_detections": [], + "extracted_license_statement": null, + "notice_text": null, + "source_packages": [], + "file_references": [ + [ + { + "path": "to-fast-properties", + "size": 0, + "sha1": null, + "md5": null, + "sha256": null, + "sha512": null, + "extra_data": {} + } + ] + ], + "extra_data": {}, + "dependencies": [], + "repository_homepage_url": "https://www.npmjs.com/package/to-fast-properties", + "repository_download_url": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-1.0.3.tgz", + "api_data_url": "https://registry.npmjs.org/to-fast-properties/1.0.3", + "datasource_id": "npm_package_lock_json", + "purl": "pkg:npm/to-fast-properties@1.0.3" + }, + "extra_data": {} + } + ], + "repository_homepage_url": "https://www.npmjs.com/package/lodash.clonedeep", + "repository_download_url": "https://registry.npmjs.org/lodash.clonedeep/-/lodash.clonedeep-4.3.2.tgz", + "api_data_url": "https://registry.npmjs.org/lodash.clonedeep/4.3.2", + "datasource_id": "npm_package_lock_json", + "purl": "pkg:npm/lodash.clonedeep@4.3.2" + } + ], + "for_packages": [], + "scan_errors": [] + }, + { + "path": "scan/package.json", + "type": "file", + "package_data": [ + { + "type": "npm", + "namespace": null, + "name": "lodash.clonedeep", + "version": "4.3.2", + "qualifiers": {}, + "subpath": null, + "primary_language": "JavaScript", + "description": "The lodash method `_.cloneDeep` exported as a module.", + "release_date": null, + "parties": [ + { + "type": "person", + "role": "author", + "name": "John-David Dalton", + "email": "john.david.dalton@gmail.com", + "url": "http://allyoucanleet.com/" + }, + { + "type": "person", + "role": "contributor", + "name": "John-David Dalton", + "email": "john.david.dalton@gmail.com", + "url": "http://allyoucanleet.com/" + }, + { + "type": "person", + "role": "contributor", + "name": "Blaine Bublitz", + "email": "blaine.bublitz@gmail.com", + "url": "https://github.com/phated" + }, + { + "type": "person", + "role": "contributor", + "name": "Mathias Bynens", + "email": "mathias@qiwi.be", + "url": "https://mathiasbynens.be/" + } + ], + "keywords": [ + "lodash-modularized", + "clonedeep" + ], + "homepage_url": "https://lodash.com/", + "download_url": "https://registry.npmjs.org/lodash.clonedeep/-/lodash.clonedeep-4.3.2.tgz", + "size": null, + "sha1": null, + "md5": null, + "sha256": null, + "sha512": null, + "bug_tracking_url": null, + "code_view_url": null, + "vcs_url": "https://github.com/lodash/lodash", + "copyright": null, + "holder": null, + "declared_license_expression": null, + "declared_license_expression_spdx": null, + "license_detections": [], + "other_license_expression": null, + "other_license_expression_spdx": null, + "other_license_detections": [], + "extracted_license_statement": [ + "MIT" + ], + "notice_text": null, + "source_packages": [], + "file_references": [], + "extra_data": {}, + "dependencies": [ + { + "purl": "pkg:npm/lodash._baseclone", + "extracted_requirement": "~4.5.0", + "scope": "dependencies", + "is_runtime": true, + "is_optional": false, + "is_resolved": false, + "resolved_package": {}, + "extra_data": {} + } + ], + "repository_homepage_url": "https://www.npmjs.com/package/lodash.clonedeep", + "repository_download_url": "https://registry.npmjs.org/lodash.clonedeep/-/lodash.clonedeep-4.3.2.tgz", + "api_data_url": "https://registry.npmjs.org/lodash.clonedeep/4.3.2", + "datasource_id": "npm_package_json", + "purl": "pkg:npm/lodash.clonedeep@4.3.2" + } + ], + "for_packages": [], + "scan_errors": [] + } + ] +} \ No newline at end of file diff --git a/tests/packagedcode/data/nuget/Castle.Core.nuspec-package-only.json.expected b/tests/packagedcode/data/nuget/Castle.Core.nuspec-package-only.json.expected new file mode 100644 index 00000000000..4e64d83d267 --- /dev/null +++ b/tests/packagedcode/data/nuget/Castle.Core.nuspec-package-only.json.expected @@ -0,0 +1,190 @@ +[ + { + "type": "nuget", + "namespace": null, + "name": "Castle.Core", + "version": "4.2.1", + "qualifiers": {}, + "subpath": null, + "primary_language": null, + "description": "Castle Core, including DynamicProxy, Logging Abstractions and DictionaryAdapter", + "release_date": null, + "parties": [ + { + "type": null, + "role": "author", + "name": "Castle Project Contributors", + "email": null, + "url": null + }, + { + "type": null, + "role": "owner", + "name": "Castle Project Contributors", + "email": null, + "url": null + } + ], + "keywords": [], + "homepage_url": "http://www.castleproject.org/", + "download_url": null, + "size": null, + "sha1": null, + "md5": null, + "sha256": null, + "sha512": null, + "bug_tracking_url": null, + "code_view_url": null, + "vcs_url": "git+https://github.com/castleproject/Core", + "copyright": "Copyright (c) 2004-2017 Castle Project - http://www.castleproject.org/", + "holder": null, + "declared_license_expression": null, + "declared_license_expression_spdx": null, + "license_detections": [], + "other_license_expression": null, + "other_license_expression_spdx": null, + "other_license_detections": [], + "extracted_license_statement": "http://www.apache.org/licenses/LICENSE-2.0.html", + "notice_text": null, + "source_packages": [], + "file_references": [], + "extra_data": {}, + "dependencies": [ + { + "purl": "pkg:nuget/NETStandard.Library", + "extracted_requirement": "1.6.1", + "scope": "dependency", + "is_runtime": true, + "is_optional": false, + "is_resolved": false, + "resolved_package": {}, + "extra_data": { + "framework": ".NETStandard1.3", + "exclude": "Build,Analyzers" + } + }, + { + "purl": "pkg:nuget/System.Diagnostics.TraceSource", + "extracted_requirement": "4.3.0", + "scope": "dependency", + "is_runtime": true, + "is_optional": false, + "is_resolved": false, + "resolved_package": {}, + "extra_data": { + "framework": ".NETStandard1.3", + "exclude": "Build,Analyzers" + } + }, + { + "purl": "pkg:nuget/System.Reflection.TypeExtensions", + "extracted_requirement": "4.3.0", + "scope": "dependency", + "is_runtime": true, + "is_optional": false, + "is_resolved": false, + "resolved_package": {}, + "extra_data": { + "framework": ".NETStandard1.3", + "exclude": "Build,Analyzers" + } + }, + { + "purl": "pkg:nuget/System.Xml.XmlDocument", + "extracted_requirement": "4.3.0", + "scope": "dependency", + "is_runtime": true, + "is_optional": false, + "is_resolved": false, + "resolved_package": {}, + "extra_data": { + "framework": ".NETStandard1.3", + "exclude": "Build,Analyzers" + } + }, + { + "purl": "pkg:nuget/System.Dynamic.Runtime", + "extracted_requirement": "4.3.0", + "scope": "dependency", + "is_runtime": true, + "is_optional": false, + "is_resolved": false, + "resolved_package": {}, + "extra_data": { + "framework": ".NETStandard1.3", + "exclude": "Build,Analyzers" + } + }, + { + "purl": "pkg:nuget/System.Reflection", + "extracted_requirement": "4.3.0", + "scope": "dependency", + "is_runtime": true, + "is_optional": false, + "is_resolved": false, + "resolved_package": {}, + "extra_data": { + "framework": ".NETStandard1.3", + "exclude": "Build,Analyzers" + } + }, + { + "purl": "pkg:nuget/System.Reflection.Emit", + "extracted_requirement": "4.3.0", + "scope": "dependency", + "is_runtime": true, + "is_optional": false, + "is_resolved": false, + "resolved_package": {}, + "extra_data": { + "framework": ".NETStandard1.3", + "exclude": "Build,Analyzers" + } + }, + { + "purl": "pkg:nuget/System.Collections.Specialized", + "extracted_requirement": "4.3.0", + "scope": "dependency", + "is_runtime": true, + "is_optional": false, + "is_resolved": false, + "resolved_package": {}, + "extra_data": { + "framework": ".NETStandard1.3", + "exclude": "Build,Analyzers" + } + }, + { + "purl": "pkg:nuget/System.ComponentModel", + "extracted_requirement": "4.3.0", + "scope": "dependency", + "is_runtime": true, + "is_optional": false, + "is_resolved": false, + "resolved_package": {}, + "extra_data": { + "framework": ".NETStandard1.3", + "exclude": "Build,Analyzers" + } + }, + { + "purl": "pkg:nuget/System.ComponentModel.TypeConverter", + "extracted_requirement": "4.3.0", + "scope": "dependency", + "is_runtime": true, + "is_optional": false, + "is_resolved": false, + "resolved_package": {}, + "extra_data": { + "framework": ".NETStandard1.3", + "exclude": "Build,Analyzers" + } + } + ], + "repository_homepage_url": "https://www.nuget.org/packages/Castle.Core/4.2.1", + "repository_download_url": "https://www.nuget.org/api/v2/package/Castle.Core/4.2.1", + "api_data_url": "https://api.nuget.org/v3/registration3/castle.core/4.2.1.json", + "datasource_id": "nuget_nupsec", + "purl": "pkg:nuget/Castle.Core@4.2.1" + } +] \ No newline at end of file diff --git a/tests/packagedcode/data/pypi/source-package/pip-22.0.4-pypi-package-only-expected.json b/tests/packagedcode/data/pypi/source-package/pip-22.0.4-pypi-package-only-expected.json new file mode 100644 index 00000000000..57199d08212 --- /dev/null +++ b/tests/packagedcode/data/pypi/source-package/pip-22.0.4-pypi-package-only-expected.json @@ -0,0 +1,821 @@ +{ + "packages": [], + "dependencies": [], + "files": [ + { + "path": "AUTHORS.txt", + "type": "file", + "package_data": [], + "for_packages": [], + "scan_errors": [] + }, + { + "path": "LICENSE.txt", + "type": "file", + "package_data": [], + "for_packages": [], + "scan_errors": [] + }, + { + "path": "MANIFEST.in", + "type": "file", + "package_data": [], + "for_packages": [], + "scan_errors": [] + }, + { + "path": "NEWS.rst", + "type": "file", + "package_data": [], + "for_packages": [], + "scan_errors": [] + }, + { + "path": "PKG-INFO", + "type": "file", + "package_data": [ + { + "type": "pypi", + "namespace": null, + "name": "pip", + "version": "22.0.4", + "qualifiers": {}, + "subpath": null, + "primary_language": "Python", + "description": "The PyPA recommended tool for installing Python packages.\npip - The Python Package Installer\n==================================\n\n.. image:: https://img.shields.io/pypi/v/pip.svg\n :target: https://pypi.org/project/pip/\n\n.. image:: https://readthedocs.org/projects/pip/badge/?version=latest\n :target: https://pip.pypa.io/en/latest\n\npip is the `package installer`_ for Python. You can use pip to install packages from the `Python Package Index`_ and other indexes.\n\nPlease take a look at our documentation for how to install and use pip:\n\n* `Installation`_\n* `Usage`_\n\nWe release updates regularly, with a new version every 3 months. Find more details in our documentation:\n\n* `Release notes`_\n* `Release process`_\n\nIn pip 20.3, we've `made a big improvement to the heart of pip`_; `learn more`_. We want your input, so `sign up for our user experience research studies`_ to help us do it right.\n\n**Note**: pip 21.0, in January 2021, removed Python 2 support, per pip's `Python 2 support policy`_. Please migrate to Python 3.\n\nIf you find bugs, need help, or want to talk to the developers, please use our mailing lists or chat rooms:\n\n* `Issue tracking`_\n* `Discourse channel`_\n* `User IRC`_\n\nIf you want to get involved head over to GitHub to get the source code, look at our development documentation and feel free to jump on the developer mailing lists and chat rooms:\n\n* `GitHub page`_\n* `Development documentation`_\n* `Development mailing list`_\n* `Development IRC`_\n\nCode of Conduct\n---------------\n\nEveryone interacting in the pip project's codebases, issue trackers, chat\nrooms, and mailing lists is expected to follow the `PSF Code of Conduct`_.\n\n.. _package installer: https://packaging.python.org/guides/tool-recommendations/\n.. _Python Package Index: https://pypi.org\n.. _Installation: https://pip.pypa.io/en/stable/installation/\n.. _Usage: https://pip.pypa.io/en/stable/\n.. _Release notes: https://pip.pypa.io/en/stable/news.html\n.. _Release process: https://pip.pypa.io/en/latest/development/release-process/\n.. _GitHub page: https://github.com/pypa/pip\n.. _Development documentation: https://pip.pypa.io/en/latest/development\n.. _made a big improvement to the heart of pip: https://pyfound.blogspot.com/2020/11/pip-20-3-new-resolver.html\n.. _learn more: https://pip.pypa.io/en/latest/user_guide/#changes-to-the-pip-dependency-resolver-in-20-3-2020\n.. _sign up for our user experience research studies: https://pyfound.blogspot.com/2020/03/new-pip-resolver-to-roll-out-this-year.html\n.. _Python 2 support policy: https://pip.pypa.io/en/latest/development/release-process/#python-2-support\n.. _Issue tracking: https://github.com/pypa/pip/issues\n.. _Discourse channel: https://discuss.python.org/c/packaging\n.. _Development mailing list: https://mail.python.org/mailman3/lists/distutils-sig.python.org/\n.. _User IRC: https://kiwiirc.com/nextclient/#ircs://irc.libera.chat:+6697/pypa\n.. _Development IRC: https://kiwiirc.com/nextclient/#ircs://irc.libera.chat:+6697/pypa-dev\n.. _PSF Code of Conduct: https://github.com/pypa/.github/blob/main/CODE_OF_CONDUCT.md", + "release_date": null, + "parties": [ + { + "type": "person", + "role": "author", + "name": "The pip developers", + "email": "distutils-sig@python.org", + "url": null + } + ], + "keywords": [ + "Development Status :: 5 - Production/Stable", + "Intended Audience :: Developers", + "Topic :: Software Development :: Build Tools", + "Programming Language :: Python", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3 :: Only", + "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: Implementation :: CPython", + "Programming Language :: Python :: Implementation :: PyPy" + ], + "homepage_url": "https://pip.pypa.io/", + "download_url": null, + "size": null, + "sha1": null, + "md5": null, + "sha256": null, + "sha512": null, + "bug_tracking_url": null, + "code_view_url": "https://github.com/pypa/pip", + "vcs_url": null, + "copyright": null, + "holder": null, + "declared_license_expression": null, + "declared_license_expression_spdx": null, + "license_detections": [], + "other_license_expression": null, + "other_license_expression_spdx": null, + "other_license_detections": [], + "extracted_license_statement": "license: MIT\nclassifiers:\n - 'License :: OSI Approved :: MIT License'\n", + "notice_text": null, + "source_packages": [], + "file_references": [], + "extra_data": { + "Documentation": "https://pip.pypa.io", + "Changelog": "https://pip.pypa.io/en/stable/news/" + }, + "dependencies": [], + "repository_homepage_url": "https://pypi.org/project/pip", + "repository_download_url": "https://pypi.org/packages/source/p/pip/pip-22.0.4.tar.gz", + "api_data_url": "https://pypi.org/pypi/pip/22.0.4/json", + "datasource_id": "pypi_sdist_pkginfo", + "purl": "pkg:pypi/pip@22.0.4" + } + ], + "for_packages": [], + "scan_errors": [] + }, + { + "path": "README.rst", + "type": "file", + "package_data": [], + "for_packages": [], + "scan_errors": [] + }, + { + "path": "docs", + "type": "directory", + "package_data": [], + "for_packages": [], + "scan_errors": [] + }, + { + "path": "docs/requirements.txt", + "type": "file", + "package_data": [ + { + "type": "pypi", + "namespace": null, + "name": null, + "version": null, + "qualifiers": {}, + "subpath": null, + "primary_language": "Python", + "description": null, + "release_date": null, + "parties": [], + "keywords": [], + "homepage_url": null, + "download_url": null, + "size": null, + "sha1": null, + "md5": null, + "sha256": null, + "sha512": null, + "bug_tracking_url": null, + "code_view_url": null, + "vcs_url": null, + "copyright": null, + "holder": null, + "declared_license_expression": null, + "declared_license_expression_spdx": null, + "license_detections": [], + "other_license_expression": null, + "other_license_expression_spdx": null, + "other_license_detections": [], + "extracted_license_statement": null, + "notice_text": null, + "source_packages": [], + "file_references": [], + "extra_data": {}, + "dependencies": [ + { + "purl": "pkg:pypi/sphinx", + "extracted_requirement": "sphinx~=4.2,!=4.4.0", + "scope": "install", + "is_runtime": true, + "is_optional": false, + "is_resolved": false, + "resolved_package": {}, + "extra_data": { + "is_editable": false, + "link": null, + "hash_options": [], + "is_constraint": false, + "is_archive": null, + "is_wheel": false, + "is_url": null, + "is_vcs_url": null, + "is_name_at_url": false, + "is_local_path": null + } + }, + { + "purl": "pkg:pypi/towncrier", + "extracted_requirement": "towncrier", + "scope": "install", + "is_runtime": true, + "is_optional": false, + "is_resolved": false, + "resolved_package": {}, + "extra_data": { + "is_editable": false, + "link": null, + "hash_options": [], + "is_constraint": false, + "is_archive": null, + "is_wheel": false, + "is_url": null, + "is_vcs_url": null, + "is_name_at_url": false, + "is_local_path": null + } + }, + { + "purl": "pkg:pypi/furo", + "extracted_requirement": "furo", + "scope": "install", + "is_runtime": true, + "is_optional": false, + "is_resolved": false, + "resolved_package": {}, + "extra_data": { + "is_editable": false, + "link": null, + "hash_options": [], + "is_constraint": false, + "is_archive": null, + "is_wheel": false, + "is_url": null, + "is_vcs_url": null, + "is_name_at_url": false, + "is_local_path": null + } + }, + { + "purl": "pkg:pypi/myst-parser", + "extracted_requirement": "myst_parser", + "scope": "install", + "is_runtime": true, + "is_optional": false, + "is_resolved": false, + "resolved_package": {}, + "extra_data": { + "is_editable": false, + "link": null, + "hash_options": [], + "is_constraint": false, + "is_archive": null, + "is_wheel": false, + "is_url": null, + "is_vcs_url": null, + "is_name_at_url": false, + "is_local_path": null + } + }, + { + "purl": "pkg:pypi/sphinx-copybutton", + "extracted_requirement": "sphinx-copybutton", + "scope": "install", + "is_runtime": true, + "is_optional": false, + "is_resolved": false, + "resolved_package": {}, + "extra_data": { + "is_editable": false, + "link": null, + "hash_options": [], + "is_constraint": false, + "is_archive": null, + "is_wheel": false, + "is_url": null, + "is_vcs_url": null, + "is_name_at_url": false, + "is_local_path": null + } + }, + { + "purl": "pkg:pypi/sphinx-inline-tabs", + "extracted_requirement": "sphinx-inline-tabs", + "scope": "install", + "is_runtime": true, + "is_optional": false, + "is_resolved": false, + "resolved_package": {}, + "extra_data": { + "is_editable": false, + "link": null, + "hash_options": [], + "is_constraint": false, + "is_archive": null, + "is_wheel": false, + "is_url": null, + "is_vcs_url": null, + "is_name_at_url": false, + "is_local_path": null + } + }, + { + "purl": "pkg:pypi/sphinxcontrib-towncrier", + "extracted_requirement": "sphinxcontrib-towncrier>=0.2.0a0", + "scope": "install", + "is_runtime": true, + "is_optional": false, + "is_resolved": false, + "resolved_package": {}, + "extra_data": { + "is_editable": false, + "link": null, + "hash_options": [], + "is_constraint": false, + "is_archive": null, + "is_wheel": false, + "is_url": null, + "is_vcs_url": null, + "is_name_at_url": false, + "is_local_path": null + } + }, + { + "purl": null, + "extracted_requirement": ".", + "scope": "install", + "is_runtime": true, + "is_optional": false, + "is_resolved": false, + "resolved_package": {}, + "extra_data": { + "is_editable": false, + "link": ".", + "hash_options": [], + "is_constraint": false, + "is_archive": false, + "is_wheel": null, + "is_url": false, + "is_vcs_url": false, + "is_name_at_url": false, + "is_local_path": true + } + } + ], + "repository_homepage_url": null, + "repository_download_url": null, + "api_data_url": null, + "datasource_id": "pip_requirements", + "purl": null + } + ], + "for_packages": [], + "scan_errors": [] + }, + { + "path": "pyproject.toml", + "type": "file", + "package_data": [ + { + "type": "pypi", + "namespace": null, + "name": null, + "version": null, + "qualifiers": {}, + "subpath": null, + "primary_language": "Python", + "description": null, + "release_date": null, + "parties": [], + "keywords": [], + "homepage_url": null, + "download_url": null, + "size": null, + "sha1": null, + "md5": null, + "sha256": null, + "sha512": null, + "bug_tracking_url": null, + "code_view_url": null, + "vcs_url": null, + "copyright": null, + "holder": null, + "declared_license_expression": null, + "declared_license_expression_spdx": null, + "license_detections": [], + "other_license_expression": null, + "other_license_expression_spdx": null, + "other_license_detections": [], + "extracted_license_statement": null, + "notice_text": null, + "source_packages": [], + "file_references": [], + "extra_data": {}, + "dependencies": [], + "repository_homepage_url": null, + "repository_download_url": null, + "api_data_url": null, + "datasource_id": "pypi_pyproject_toml", + "purl": null + } + ], + "for_packages": [], + "scan_errors": [] + }, + { + "path": "setup.cfg", + "type": "file", + "package_data": [ + { + "type": "pypi", + "namespace": null, + "name": null, + "version": null, + "qualifiers": {}, + "subpath": null, + "primary_language": "Python", + "description": null, + "release_date": null, + "parties": [], + "keywords": [], + "homepage_url": null, + "download_url": null, + "size": null, + "sha1": null, + "md5": null, + "sha256": null, + "sha512": null, + "bug_tracking_url": null, + "code_view_url": null, + "vcs_url": null, + "copyright": null, + "holder": null, + "declared_license_expression": null, + "declared_license_expression_spdx": null, + "license_detections": [], + "other_license_expression": null, + "other_license_expression_spdx": null, + "other_license_detections": [], + "extracted_license_statement": null, + "notice_text": null, + "source_packages": [], + "file_references": [], + "extra_data": {}, + "dependencies": [], + "repository_homepage_url": null, + "repository_download_url": null, + "api_data_url": null, + "datasource_id": "pypi_setup_cfg", + "purl": null + } + ], + "for_packages": [], + "scan_errors": [] + }, + { + "path": "setup.py", + "type": "file", + "package_data": [ + { + "type": "pypi", + "namespace": null, + "name": "pip", + "version": "22.0.4", + "qualifiers": {}, + "subpath": null, + "primary_language": "Python", + "description": "The PyPA recommended tool for installing Python packages.", + "release_date": null, + "parties": [ + { + "type": "person", + "role": "author", + "name": "The pip developers", + "email": "distutils-sig@python.org", + "url": null + } + ], + "keywords": [ + "Development Status :: 5 - Production/Stable", + "Intended Audience :: Developers", + "Topic :: Software Development :: Build Tools", + "Programming Language :: Python", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3 :: Only", + "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: Implementation :: CPython", + "Programming Language :: Python :: Implementation :: PyPy" + ], + "homepage_url": "https://pip.pypa.io/", + "download_url": null, + "size": null, + "sha1": null, + "md5": null, + "sha256": null, + "sha512": null, + "bug_tracking_url": null, + "code_view_url": "https://github.com/pypa/pip", + "vcs_url": null, + "copyright": null, + "holder": null, + "declared_license_expression": null, + "declared_license_expression_spdx": null, + "license_detections": [], + "other_license_expression": null, + "other_license_expression_spdx": null, + "other_license_detections": [], + "extracted_license_statement": "license: MIT\nclassifiers:\n - 'License :: OSI Approved :: MIT License'\n", + "notice_text": null, + "source_packages": [], + "file_references": [], + "extra_data": { + "Documentation": "https://pip.pypa.io", + "Changelog": "https://pip.pypa.io/en/stable/news/", + "python_requires": ">=3.7" + }, + "dependencies": [], + "repository_homepage_url": "https://pypi.org/project/pip", + "repository_download_url": "https://pypi.org/packages/source/p/pip/pip-22.0.4.tar.gz", + "api_data_url": "https://pypi.org/pypi/pip/22.0.4/json", + "datasource_id": "pypi_setup_py", + "purl": "pkg:pypi/pip@22.0.4" + } + ], + "for_packages": [], + "scan_errors": [] + }, + { + "path": "src", + "type": "directory", + "package_data": [], + "for_packages": [], + "scan_errors": [] + }, + { + "path": "src/pip", + "type": "directory", + "package_data": [], + "for_packages": [], + "scan_errors": [] + }, + { + "path": "src/pip.egg-info", + "type": "directory", + "package_data": [], + "for_packages": [], + "scan_errors": [] + }, + { + "path": "src/pip.egg-info/PKG-INFO", + "type": "file", + "package_data": [ + { + "type": "pypi", + "namespace": null, + "name": "pip", + "version": "22.0.4", + "qualifiers": {}, + "subpath": null, + "primary_language": "Python", + "description": "The PyPA recommended tool for installing Python packages.\npip - The Python Package Installer\n==================================\n\n.. image:: https://img.shields.io/pypi/v/pip.svg\n :target: https://pypi.org/project/pip/\n\n.. image:: https://readthedocs.org/projects/pip/badge/?version=latest\n :target: https://pip.pypa.io/en/latest\n\npip is the `package installer`_ for Python. You can use pip to install packages from the `Python Package Index`_ and other indexes.\n\nPlease take a look at our documentation for how to install and use pip:\n\n* `Installation`_\n* `Usage`_\n\nWe release updates regularly, with a new version every 3 months. Find more details in our documentation:\n\n* `Release notes`_\n* `Release process`_\n\nIn pip 20.3, we've `made a big improvement to the heart of pip`_; `learn more`_. We want your input, so `sign up for our user experience research studies`_ to help us do it right.\n\n**Note**: pip 21.0, in January 2021, removed Python 2 support, per pip's `Python 2 support policy`_. Please migrate to Python 3.\n\nIf you find bugs, need help, or want to talk to the developers, please use our mailing lists or chat rooms:\n\n* `Issue tracking`_\n* `Discourse channel`_\n* `User IRC`_\n\nIf you want to get involved head over to GitHub to get the source code, look at our development documentation and feel free to jump on the developer mailing lists and chat rooms:\n\n* `GitHub page`_\n* `Development documentation`_\n* `Development mailing list`_\n* `Development IRC`_\n\nCode of Conduct\n---------------\n\nEveryone interacting in the pip project's codebases, issue trackers, chat\nrooms, and mailing lists is expected to follow the `PSF Code of Conduct`_.\n\n.. _package installer: https://packaging.python.org/guides/tool-recommendations/\n.. _Python Package Index: https://pypi.org\n.. _Installation: https://pip.pypa.io/en/stable/installation/\n.. _Usage: https://pip.pypa.io/en/stable/\n.. _Release notes: https://pip.pypa.io/en/stable/news.html\n.. _Release process: https://pip.pypa.io/en/latest/development/release-process/\n.. _GitHub page: https://github.com/pypa/pip\n.. _Development documentation: https://pip.pypa.io/en/latest/development\n.. _made a big improvement to the heart of pip: https://pyfound.blogspot.com/2020/11/pip-20-3-new-resolver.html\n.. _learn more: https://pip.pypa.io/en/latest/user_guide/#changes-to-the-pip-dependency-resolver-in-20-3-2020\n.. _sign up for our user experience research studies: https://pyfound.blogspot.com/2020/03/new-pip-resolver-to-roll-out-this-year.html\n.. _Python 2 support policy: https://pip.pypa.io/en/latest/development/release-process/#python-2-support\n.. _Issue tracking: https://github.com/pypa/pip/issues\n.. _Discourse channel: https://discuss.python.org/c/packaging\n.. _Development mailing list: https://mail.python.org/mailman3/lists/distutils-sig.python.org/\n.. _User IRC: https://kiwiirc.com/nextclient/#ircs://irc.libera.chat:+6697/pypa\n.. _Development IRC: https://kiwiirc.com/nextclient/#ircs://irc.libera.chat:+6697/pypa-dev\n.. _PSF Code of Conduct: https://github.com/pypa/.github/blob/main/CODE_OF_CONDUCT.md", + "release_date": null, + "parties": [ + { + "type": "person", + "role": "author", + "name": "The pip developers", + "email": "distutils-sig@python.org", + "url": null + } + ], + "keywords": [ + "Development Status :: 5 - Production/Stable", + "Intended Audience :: Developers", + "Topic :: Software Development :: Build Tools", + "Programming Language :: Python", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3 :: Only", + "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: Implementation :: CPython", + "Programming Language :: Python :: Implementation :: PyPy" + ], + "homepage_url": "https://pip.pypa.io/", + "download_url": null, + "size": null, + "sha1": null, + "md5": null, + "sha256": null, + "sha512": null, + "bug_tracking_url": null, + "code_view_url": "https://github.com/pypa/pip", + "vcs_url": null, + "copyright": null, + "holder": null, + "declared_license_expression": null, + "declared_license_expression_spdx": null, + "license_detections": [], + "other_license_expression": null, + "other_license_expression_spdx": null, + "other_license_detections": [], + "extracted_license_statement": "license: MIT\nclassifiers:\n - 'License :: OSI Approved :: MIT License'\n", + "notice_text": null, + "source_packages": [], + "file_references": [ + { + "path": "AUTHORS.txt", + "size": null, + "sha1": null, + "md5": null, + "sha256": null, + "sha512": null, + "extra_data": {} + }, + { + "path": "LICENSE.txt", + "size": null, + "sha1": null, + "md5": null, + "sha256": null, + "sha512": null, + "extra_data": {} + }, + { + "path": "MANIFEST.in", + "size": null, + "sha1": null, + "md5": null, + "sha256": null, + "sha512": null, + "extra_data": {} + }, + { + "path": "NEWS.rst", + "size": null, + "sha1": null, + "md5": null, + "sha256": null, + "sha512": null, + "extra_data": {} + }, + { + "path": "README.rst", + "size": null, + "sha1": null, + "md5": null, + "sha256": null, + "sha512": null, + "extra_data": {} + }, + { + "path": "pyproject.toml", + "size": null, + "sha1": null, + "md5": null, + "sha256": null, + "sha512": null, + "extra_data": {} + }, + { + "path": "setup.cfg", + "size": null, + "sha1": null, + "md5": null, + "sha256": null, + "sha512": null, + "extra_data": {} + }, + { + "path": "setup.py", + "size": null, + "sha1": null, + "md5": null, + "sha256": null, + "sha512": null, + "extra_data": {} + }, + { + "path": "src/pip/__init__.py", + "size": null, + "sha1": null, + "md5": null, + "sha256": null, + "sha512": null, + "extra_data": {} + }, + { + "path": "src/pip/__main__.py", + "size": null, + "sha1": null, + "md5": null, + "sha256": null, + "sha512": null, + "extra_data": {} + }, + { + "path": "src/pip/py.typed", + "size": null, + "sha1": null, + "md5": null, + "sha256": null, + "sha512": null, + "extra_data": {} + }, + { + "path": "src/pip.egg-info/PKG-INFO", + "size": null, + "sha1": null, + "md5": null, + "sha256": null, + "sha512": null, + "extra_data": {} + }, + { + "path": "src/pip.egg-info/SOURCES.txt", + "size": null, + "sha1": null, + "md5": null, + "sha256": null, + "sha512": null, + "extra_data": {} + }, + { + "path": "src/pip.egg-info/dependency_links.txt", + "size": null, + "sha1": null, + "md5": null, + "sha256": null, + "sha512": null, + "extra_data": {} + }, + { + "path": "src/pip.egg-info/entry_points.txt", + "size": null, + "sha1": null, + "md5": null, + "sha256": null, + "sha512": null, + "extra_data": {} + }, + { + "path": "src/pip.egg-info/not-zip-safe", + "size": null, + "sha1": null, + "md5": null, + "sha256": null, + "sha512": null, + "extra_data": {} + }, + { + "path": "src/pip.egg-info/top_level.txt", + "size": null, + "sha1": null, + "md5": null, + "sha256": null, + "sha512": null, + "extra_data": {} + } + ], + "extra_data": { + "Documentation": "https://pip.pypa.io", + "Changelog": "https://pip.pypa.io/en/stable/news/" + }, + "dependencies": [], + "repository_homepage_url": "https://pypi.org/project/pip", + "repository_download_url": "https://pypi.org/packages/source/p/pip/pip-22.0.4.tar.gz", + "api_data_url": "https://pypi.org/pypi/pip/22.0.4/json", + "datasource_id": "pypi_editable_egg_pkginfo", + "purl": "pkg:pypi/pip@22.0.4" + } + ], + "for_packages": [], + "scan_errors": [] + }, + { + "path": "src/pip.egg-info/SOURCES.txt", + "type": "file", + "package_data": [], + "for_packages": [], + "scan_errors": [] + }, + { + "path": "src/pip.egg-info/dependency_links.txt", + "type": "file", + "package_data": [], + "for_packages": [], + "scan_errors": [] + }, + { + "path": "src/pip.egg-info/entry_points.txt", + "type": "file", + "package_data": [], + "for_packages": [], + "scan_errors": [] + }, + { + "path": "src/pip.egg-info/not-zip-safe", + "type": "file", + "package_data": [], + "for_packages": [], + "scan_errors": [] + }, + { + "path": "src/pip.egg-info/top_level.txt", + "type": "file", + "package_data": [], + "for_packages": [], + "scan_errors": [] + }, + { + "path": "src/pip/__init__.py", + "type": "file", + "package_data": [], + "for_packages": [], + "scan_errors": [] + }, + { + "path": "src/pip/__main__.py", + "type": "file", + "package_data": [], + "for_packages": [], + "scan_errors": [] + }, + { + "path": "src/pip/py.typed", + "type": "file", + "package_data": [], + "for_packages": [], + "scan_errors": [] + } + ] +} \ No newline at end of file diff --git a/tests/packagedcode/data/rpm/header/libproxy-bin-0.3.0-4.el6_3.x86_64.rpm-package-only-expected.json b/tests/packagedcode/data/rpm/header/libproxy-bin-0.3.0-4.el6_3.x86_64.rpm-package-only-expected.json new file mode 100644 index 00000000000..0c26c429ed8 --- /dev/null +++ b/tests/packagedcode/data/rpm/header/libproxy-bin-0.3.0-4.el6_3.x86_64.rpm-package-only-expected.json @@ -0,0 +1,54 @@ +[ + { + "type": "rpm", + "namespace": null, + "name": "libproxy-bin", + "version": "0.3.0-4.el6_3", + "qualifiers": {}, + "subpath": null, + "primary_language": null, + "description": "Binary to test libproxy\nThe libproxy-bin package contains the proxy binary for libproxy", + "release_date": null, + "parties": [ + { + "type": null, + "role": "vendor", + "name": "CentOS", + "email": null, + "url": null + } + ], + "keywords": [], + "homepage_url": "http://code.google.com/p/libproxy/", + "download_url": null, + "size": null, + "sha1": null, + "md5": null, + "sha256": null, + "sha512": null, + "bug_tracking_url": null, + "code_view_url": null, + "vcs_url": null, + "copyright": null, + "holder": null, + "declared_license_expression": null, + "declared_license_expression_spdx": null, + "license_detections": [], + "other_license_expression": null, + "other_license_expression_spdx": null, + "other_license_detections": [], + "extracted_license_statement": "LGPLv2+", + "notice_text": null, + "source_packages": [ + "pkg:rpm/libproxy@0.3.0-4.el6_3?arch=src" + ], + "file_references": [], + "extra_data": {}, + "dependencies": [], + "repository_homepage_url": null, + "repository_download_url": null, + "api_data_url": null, + "datasource_id": "rpm_archive", + "purl": "pkg:rpm/libproxy-bin@0.3.0-4.el6_3" + } +] \ No newline at end of file diff --git a/tests/packagedcode/data/rubygems/gemspec/oj.gemspec-package-only.expected.json b/tests/packagedcode/data/rubygems/gemspec/oj.gemspec-package-only.expected.json new file mode 100644 index 00000000000..50ba9bb793c --- /dev/null +++ b/tests/packagedcode/data/rubygems/gemspec/oj.gemspec-package-only.expected.json @@ -0,0 +1,100 @@ +[ + { + "type": "gem", + "namespace": null, + "name": "oj", + "version": "::Oj::VERSION", + "qualifiers": {}, + "subpath": null, + "primary_language": "Ruby", + "description": "A fast JSON parser and serializer.\nThe fastest JSON parser and object serializer.", + "release_date": null, + "parties": [ + { + "type": "person", + "role": "author", + "name": "Peter Ohler", + "email": null, + "url": null + }, + { + "type": "person", + "role": "author", + "name": null, + "email": "peter@ohler.com", + "url": null + } + ], + "keywords": [], + "homepage_url": "http://www.ohler.com/oj", + "download_url": "https://rubygems.org/downloads/oj-::Oj::VERSION.gem", + "size": null, + "sha1": null, + "md5": null, + "sha256": null, + "sha512": null, + "bug_tracking_url": null, + "code_view_url": null, + "vcs_url": null, + "copyright": null, + "holder": null, + "declared_license_expression": null, + "declared_license_expression_spdx": null, + "license_detections": [], + "other_license_expression": null, + "other_license_expression_spdx": null, + "other_license_detections": [], + "extracted_license_statement": null, + "notice_text": null, + "source_packages": [], + "file_references": [], + "extra_data": {}, + "dependencies": [ + { + "purl": "pkg:gem/rake-compiler", + "extracted_requirement": ">= 0.9, < 2.0", + "scope": "development", + "is_runtime": false, + "is_optional": true, + "is_resolved": false, + "resolved_package": {}, + "extra_data": {} + }, + { + "purl": "pkg:gem/minitest", + "extracted_requirement": "~> 5", + "scope": "development", + "is_runtime": false, + "is_optional": true, + "is_resolved": false, + "resolved_package": {}, + "extra_data": {} + }, + { + "purl": "pkg:gem/test-unit", + "extracted_requirement": "~> 3.0", + "scope": "development", + "is_runtime": false, + "is_optional": true, + "is_resolved": false, + "resolved_package": {}, + "extra_data": {} + }, + { + "purl": "pkg:gem/wwtd", + "extracted_requirement": "~> 0", + "scope": "development", + "is_runtime": false, + "is_optional": true, + "is_resolved": false, + "resolved_package": {}, + "extra_data": {} + } + ], + "repository_homepage_url": "https://rubygems.org/gems/oj/versions/::Oj::VERSION", + "repository_download_url": "https://rubygems.org/downloads/oj-::Oj::VERSION.gem", + "api_data_url": "https://rubygems.org/api/v2/rubygems/oj/versions/::Oj::VERSION.json", + "datasource_id": "gemspec", + "purl": "pkg:gem/oj@::Oj::VERSION" + } +] \ No newline at end of file diff --git a/tests/packagedcode/packages_test_utils.py b/tests/packagedcode/packages_test_utils.py index a989135f009..ba25c20b3fb 100644 --- a/tests/packagedcode/packages_test_utils.py +++ b/tests/packagedcode/packages_test_utils.py @@ -49,6 +49,7 @@ def check_packages_data( must_exist=True, remove_uuid=True, regen=REGEN_TEST_FIXTURES, + package_only=False, ): """ Helper to test a list of package_data objects against an expected JSON file. @@ -66,7 +67,8 @@ def check_packages_data( for package_uid in resource.for_packages ] resource.for_packages = normalized_package_uids - populate_license_fields(package_data) + if not package_only: + package_data.populate_license_fields() results.append(package_data.to_dict()) check_result_equals_expected_json( @@ -78,6 +80,7 @@ def check_packages_data( def populate_license_fields(package_data): if package_data.extracted_license_statement and not package_data.declared_license_expression: + from packagedcode import HANDLER_BY_DATASOURCE_ID handler = HANDLER_BY_DATASOURCE_ID[package_data.datasource_id] handler.populate_license_fields(package_data) diff --git a/tests/packagedcode/test_alpine.py b/tests/packagedcode/test_alpine.py index 435a5c96b42..43cb257b673 100644 --- a/tests/packagedcode/test_alpine.py +++ b/tests/packagedcode/test_alpine.py @@ -53,14 +53,14 @@ def test_parse_alpine_installed_db_full(self): def test_scan_system_package_end_to_end_installed_alpine(self): test_dir = self.extract_test_tar('alpine/rootfs/alpine-rootfs.tar.xz') test_dir = os.path.join(test_dir, 'alpine-rootfs') - expected_file = self.get_test_loc('alpine/rootfs/alpine-rootfs.tar.xz-expected.json', must_exist=False) + expected_file = self.get_test_loc('alpine/rootfs/alpine-rootfs.tar.xz-expected.json') result_file = self.get_temp_file('results.json') run_scan_click(['--system-package', test_dir, '--json-pp', result_file]) check_json_scan(expected_file, result_file, regen=REGEN_TEST_FIXTURES) def test_can_scan_installed_system_package_in_alpine_container_layer(self): test_dir = self.extract_test_tar('alpine/alpine-container-layer.tar.xz') - expected_file = self.get_test_loc('alpine/alpine-container-layer.tar.xz-scan-expected.json', must_exist=False) + expected_file = self.get_test_loc('alpine/alpine-container-layer.tar.xz-scan-expected.json') result_file = self.get_temp_file('results.json') run_scan_click(['--system-package', test_dir, '--json-pp', result_file]) check_json_scan(expected_file, result_file, regen=REGEN_TEST_FIXTURES) @@ -68,7 +68,7 @@ def test_can_scan_installed_system_package_in_alpine_container_layer(self): def test_can_get_installed_system_packages_with_license_from_alpine_container_layer(self): from packagedcode.plugin_package import get_installed_packages test_dir = self.extract_test_tar('alpine/alpine-container-layer.tar.xz') - expected_file = self.get_test_loc('alpine/alpine-container-layer.tar.xz-get-installed-expected.json', must_exist=False) + expected_file = self.get_test_loc('alpine/alpine-container-layer.tar.xz-get-installed-expected.json') results = list(get_installed_packages(test_dir)) self.check_packages_data(results, expected_file, remove_uuid=True, regen=REGEN_TEST_FIXTURES) diff --git a/tests/packagedcode/test_build_gradle.py b/tests/packagedcode/test_build_gradle.py index d22a473f1b4..90f0fa750c9 100644 --- a/tests/packagedcode/test_build_gradle.py +++ b/tests/packagedcode/test_build_gradle.py @@ -30,6 +30,13 @@ def test_end2end_scan_can_detect_build_gradle(self): run_scan_click(['--package', test_file, '--json-pp', result_file]) check_json_scan(expected_file, result_file, remove_uuid=True, regen=REGEN_TEST_FIXTURES) + def test_end2end_scan_can_detect_build_gradle_package_only(self): + test_file = self.get_test_loc('build_gradle/end2end/build.gradle') + expected_file = self.get_test_loc('build_gradle/end2end/build.gradle-package-only-expected.json') + result_file = self.get_temp_file('results.json') + run_scan_click(['--package-only', test_file, '--json-pp', result_file]) + check_json_scan(expected_file, result_file, regen=REGEN_TEST_FIXTURES) + def check_gradle_parse(location): packages_data = build_gradle.BuildGradleHandler.parse(location) diff --git a/tests/packagedcode/test_cargo.py b/tests/packagedcode/test_cargo.py index 5c25f13502f..ad7cbe9e631 100644 --- a/tests/packagedcode/test_cargo.py +++ b/tests/packagedcode/test_cargo.py @@ -109,16 +109,25 @@ def test_parse_cargo_lock_sample5(self): def test_scan_cli_works(self): test_file = self.get_test_loc('cargo/scan') - expected_file = self.get_test_loc('cargo/scan.expected.json', must_exist=False) + expected_file = self.get_test_loc('cargo/scan.expected.json') result_file = self.get_temp_file('results.json') run_scan_click(['--package', test_file, '--json', result_file]) check_json_scan( expected_file, result_file, remove_uuid=True, regen=REGEN_TEST_FIXTURES ) + def test_scan_cli_works_package_only(self): + test_file = self.get_test_loc('cargo/scan') + expected_file = self.get_test_loc('cargo/scan-package-only.expected.json') + result_file = self.get_temp_file('results.json') + run_scan_click(['--package-only', test_file, '--json', result_file]) + check_json_scan( + expected_file, result_file, remove_uuid=True, regen=REGEN_TEST_FIXTURES + ) + def test_scan_works_on_cargo_workspace(self): test_file = self.get_test_loc('cargo/cargo-with-workspace') - expected_file = self.get_test_loc('cargo/cargo-with-workspace.expected.json', must_exist=False) + expected_file = self.get_test_loc('cargo/cargo-with-workspace.expected.json') result_file = self.get_temp_file('results.json') run_scan_click(['--package', '--license', test_file, '--json', result_file]) check_json_scan( diff --git a/tests/packagedcode/test_chef.py b/tests/packagedcode/test_chef.py index bfa3d3a8808..ddfe47dc218 100644 --- a/tests/packagedcode/test_chef.py +++ b/tests/packagedcode/test_chef.py @@ -132,9 +132,18 @@ def test_build_package_code_view_url_and_bug_tracking_url(self): def test_scan_cli_works(self): test_file = self.get_test_loc('chef/package/') - expected_file = self.get_test_loc('chef/package.scan.expected.json', must_exist=False) + expected_file = self.get_test_loc('chef/package.scan.expected.json') result_file = self.get_temp_file('results.json') run_scan_click(['--package', test_file, '--json', result_file]) check_json_scan( expected_file, result_file, remove_uuid=True, regen=REGEN_TEST_FIXTURES ) + + def test_scan_cli_works_package_only(self): + test_file = self.get_test_loc('chef/package/') + expected_file = self.get_test_loc('chef/package-only.scan.expected.json') + result_file = self.get_temp_file('results.json') + run_scan_click(['--package-only', test_file, '--json', result_file]) + check_json_scan( + expected_file, result_file, remove_uuid=True, regen=REGEN_TEST_FIXTURES + ) diff --git a/tests/packagedcode/test_cocoapods.py b/tests/packagedcode/test_cocoapods.py index 0403671c393..0d1407b38d8 100644 --- a/tests/packagedcode/test_cocoapods.py +++ b/tests/packagedcode/test_cocoapods.py @@ -46,19 +46,19 @@ def test_cocoapods_can_parse_kmmWebSocket(self): def test_cocoapods_can_parse_LoadingShimmer(self): test_file = self.get_test_loc('cocoapods/podspec/LoadingShimmer.podspec') - expected_loc = self.get_test_loc('cocoapods/podspec/LoadingShimmer.podspec.expected.json', must_exist=False) + expected_loc = self.get_test_loc('cocoapods/podspec/LoadingShimmer.podspec.expected.json') packages = PodspecHandler.parse(test_file) self.check_packages_data(packages, expected_loc, regen=REGEN_TEST_FIXTURES) def test_cocoapods_can_parse_nanopb(self): test_file = self.get_test_loc('cocoapods/podspec/nanopb.podspec') - expected_loc = self.get_test_loc('cocoapods/podspec/nanopb.podspec.expected.json', must_exist=False) + expected_loc = self.get_test_loc('cocoapods/podspec/nanopb.podspec.expected.json') packages = PodspecHandler.parse(test_file) self.check_packages_data(packages, expected_loc, regen=REGEN_TEST_FIXTURES) def test_cocoapods_can_parse_PayTabsSDK(self): test_file = self.get_test_loc('cocoapods/podspec/PayTabsSDK.podspec') - expected_loc = self.get_test_loc('cocoapods/podspec/PayTabsSDK.podspec.expected.json', must_exist=False) + expected_loc = self.get_test_loc('cocoapods/podspec/PayTabsSDK.podspec.expected.json') packages = PodspecHandler.parse(test_file) self.check_packages_data(packages, expected_loc, regen=REGEN_TEST_FIXTURES) @@ -160,49 +160,56 @@ class TestCocoapodsEndToEndAssemble(PackageTester): def test_cocoapods_can_assemble_with_single_podspec(self): test_file = self.get_test_loc('cocoapods/assemble/single-podspec') - expected_file = self.get_test_loc('cocoapods/assemble/single-podspec-expected.json', must_exist=False) + expected_file = self.get_test_loc('cocoapods/assemble/single-podspec-expected.json') result_file = self.get_temp_file('results.json') run_scan_click(['--package', test_file, '--json', result_file]) check_json_scan(expected_file, result_file, remove_uuid=True, regen=REGEN_TEST_FIXTURES) def test_cocoapods_can_assemble_with_multiple_podspec(self): test_file = self.get_test_loc('cocoapods/assemble/multiple-podspec') - expected_file = self.get_test_loc('cocoapods/assemble/multiple-podspec-expected.json', must_exist=False) + expected_file = self.get_test_loc('cocoapods/assemble/multiple-podspec-expected.json') result_file = self.get_temp_file('results.json') run_scan_click(['--package', test_file, '--json', result_file]) check_json_scan(expected_file, result_file, remove_uuid=True, regen=REGEN_TEST_FIXTURES) def test_cocoapods_can_assemble_with_solo_podspec(self): test_file = self.get_test_loc('cocoapods/assemble/solo/RxDataSources.podspec') - expected_file = self.get_test_loc('cocoapods/assemble/solo/RxDataSources.podspec-expected.json', must_exist=False) + expected_file = self.get_test_loc('cocoapods/assemble/solo/RxDataSources.podspec-expected.json') result_file = self.get_temp_file('results.json') run_scan_click(['--package', test_file, '--json', result_file]) check_json_scan(expected_file, result_file, remove_uuid=True, regen=REGEN_TEST_FIXTURES) + def test_cocoapods_can_assemble_with_solo_podspec_package_only(self): + test_file = self.get_test_loc('cocoapods/assemble/solo/RxDataSources.podspec') + expected_file = self.get_test_loc('cocoapods/assemble/solo/RxDataSources-package-only.podspec-expected.json') + result_file = self.get_temp_file('results.json') + run_scan_click(['--package-only', test_file, '--json', result_file]) + check_json_scan(expected_file, result_file, remove_uuid=True, regen=REGEN_TEST_FIXTURES) + def test_cocoapods_can_assemble_with_solo_podfile(self): test_file = self.get_test_loc('cocoapods/assemble/solo/Podfile') - expected_file = self.get_test_loc('cocoapods/assemble/solo/Podfile-expected.json', must_exist=False) + expected_file = self.get_test_loc('cocoapods/assemble/solo/Podfile-expected.json') result_file = self.get_temp_file('results.json') run_scan_click(['--package', test_file, '--json', result_file]) check_json_scan(expected_file, result_file, remove_uuid=True, regen=REGEN_TEST_FIXTURES) def test_cocoapods_can_assemble_with_solo_podfile_lock(self): test_file = self.get_test_loc('cocoapods/assemble/solo/Podfile.lock') - expected_file = self.get_test_loc('cocoapods/assemble/solo/Podfile.lock-expected.json', must_exist=False) + expected_file = self.get_test_loc('cocoapods/assemble/solo/Podfile.lock-expected.json') result_file = self.get_temp_file('results.json') run_scan_click(['--package', test_file, '--json', result_file]) check_json_scan(expected_file, result_file, remove_uuid=True, regen=REGEN_TEST_FIXTURES) def test_cocoapods_can_assemble_with_many_podspecs_podfile_and_podfile_lock(self): test_file = self.get_test_loc('cocoapods/assemble/many-podspecs') - expected_file = self.get_test_loc('cocoapods/assemble/many-podspecs-expected.json', must_exist=False) + expected_file = self.get_test_loc('cocoapods/assemble/many-podspecs-expected.json') result_file = self.get_temp_file('results.json') run_scan_click(['--package', test_file, '--json', result_file]) check_json_scan(expected_file, result_file, remove_uuid=True, regen=REGEN_TEST_FIXTURES) def test_cocoapods_can_assemble_with_many_podspecs_podfile_and_podfile_lock_with_license(self): test_file = self.get_test_loc('cocoapods/assemble/many-podspecs') - expected_file = self.get_test_loc('cocoapods/assemble/many-podspecs-with-license-expected.json', must_exist=False) + expected_file = self.get_test_loc('cocoapods/assemble/many-podspecs-with-license-expected.json') result_file = self.get_temp_file('results.json') run_scan_click(['--package', '--license', test_file, '--json', result_file]) check_json_scan(expected_file, result_file, remove_uuid=True, regen=REGEN_TEST_FIXTURES) diff --git a/tests/packagedcode/test_debian.py b/tests/packagedcode/test_debian.py index 928a29e4f2f..d185a5c8c53 100644 --- a/tests/packagedcode/test_debian.py +++ b/tests/packagedcode/test_debian.py @@ -34,7 +34,7 @@ def test_scan_system_package_end_to_end_installed_debian_basic_rootfs(self): def test_can_scan_system_package_installed_debian_with_license_from_container_layer(self): test_dir = self.extract_test_tar('debian/debian-container-layer.tar.xz') - expected_file = self.get_test_loc('debian/debian-container-layer.tar.xz.scan-expected.json', must_exist=False) + expected_file = self.get_test_loc('debian/debian-container-layer.tar.xz.scan-expected.json') result_file = self.get_temp_file('results.json') run_scan_click(['--system-package', test_dir, '--json-pp', result_file]) check_json_scan(expected_file, result_file, regen=REGEN_TEST_FIXTURES) @@ -42,7 +42,7 @@ def test_can_scan_system_package_installed_debian_with_license_from_container_la def test_can_get_installed_system_packages_with_license_from_debian_container_layer(self): from packagedcode.plugin_package import get_installed_packages test_dir = self.extract_test_tar('debian/debian-container-layer.tar.xz') - expected_file = self.get_test_loc('debian/debian-container-layer.tar.xz.get-installed-expected.json', must_exist=False) + expected_file = self.get_test_loc('debian/debian-container-layer.tar.xz.get-installed-expected.json') results = list(get_installed_packages(test_dir)) self.check_packages_data(results, expected_file, remove_uuid=True, regen=REGEN_TEST_FIXTURES) @@ -70,6 +70,15 @@ def test_parse_status_file_basic(self): packages = list(debian.DebianInstalledStatusDatabaseHandler.parse(test_file)) self.check_packages_data(packages, expected_loc, regen=REGEN_TEST_FIXTURES) + def test_parse_status_file_basic_package_only(self): + test_file = self.get_test_loc('debian/basic/status') + expected_loc = self.get_test_loc('debian/basic/status-package-only.expected') + # specify ubuntu distro as this was the source of the test `status` file + packages = list(debian.DebianInstalledStatusDatabaseHandler.parse( + location=test_file, package_only=True, + )) + self.check_packages_data(packages, expected_loc, regen=REGEN_TEST_FIXTURES, package_only=True) + def test_parse_status_file_with_source_packages(self): test_file = self.get_test_loc('debian/status-with-source/status') expected_loc = self.get_test_loc('debian/status-with-source/status.expected') @@ -85,7 +94,7 @@ def test_parse_status_file_perl_error(self): @skipIf(on_windows, 'File names cannot contain colons on Windows') def test_scan_system_package_end_to_end_installed_debian(self): test_dir = self.extract_test_tar('debian/end-to-end.tgz') - expected_file = self.get_test_loc('debian/end-to-end.tgz.expected.json', must_exist=False) + expected_file = self.get_test_loc('debian/end-to-end.tgz.expected.json') result_file = self.get_temp_file('results.json') run_scan_click(['--system-package', test_dir, '--json-pp', result_file]) check_json_scan(expected_file, result_file, regen=REGEN_TEST_FIXTURES) @@ -137,7 +146,7 @@ def test_multi_arch_is_same(self): package_type=debian.DebianInstalledMd5sumFilelistHandler.default_package_type, ) - expected_loc = self.get_test_loc('debian/libatk-adaptor-amd64.md5sums.expected.json', must_exist=False) + expected_loc = self.get_test_loc('debian/libatk-adaptor-amd64.md5sums.expected.json') self.check_packages_data(results, expected_loc, must_exist=False, regen=REGEN_TEST_FIXTURES) def test_parse_debian_files_list_no_arch(self): @@ -148,7 +157,7 @@ def test_parse_debian_files_list_no_arch(self): package_type=debian.DebianInstalledMd5sumFilelistHandler.default_package_type, ) - expected_loc = self.get_test_loc('debian/files-md5sums/mokutil.md5sums.expected.json', must_exist=False) + expected_loc = self.get_test_loc('debian/files-md5sums/mokutil.md5sums.expected.json') self.check_packages_data(results, expected_loc, must_exist=False, regen=REGEN_TEST_FIXTURES) @skipIf(on_windows, 'File names cannot contain colons on Windows') @@ -167,7 +176,7 @@ def test_parse_debian_files_list_with_arch(self): package_type=debian.DebianInstalledMd5sumFilelistHandler.default_package_type, ) - expected_loc = self.get_test_loc('debian/files-md5sums/mokutil-amd64.md5sums.expected.json', must_exist=False) + expected_loc = self.get_test_loc('debian/files-md5sums/mokutil-amd64.md5sums.expected.json') self.check_packages_data(results, expected_loc, must_exist=False, regen=REGEN_TEST_FIXTURES) def test_build_package_data_from_package_filename_deb_does_not_crash_on_version(self): diff --git a/tests/packagedcode/test_freebsd.py b/tests/packagedcode/test_freebsd.py index 70280b89376..80b1d7c4ff3 100644 --- a/tests/packagedcode/test_freebsd.py +++ b/tests/packagedcode/test_freebsd.py @@ -58,6 +58,12 @@ def test_parse_basic(self): package = freebsd.CompactManifestHandler.parse(test_file) self.check_packages_data(package, expected_loc, regen=REGEN_TEST_FIXTURES) + def test_parse_basic_package_only(self): + test_file = self.get_test_loc('freebsd/basic/+COMPACT_MANIFEST') + expected_loc = self.get_test_loc('freebsd/basic/+COMPACT_MANIFEST-package-only.expected') + package = freebsd.CompactManifestHandler.parse(location=test_file, package_only=True) + self.check_packages_data(package, expected_loc, regen=REGEN_TEST_FIXTURES, package_only=True) + def test_parse_not_yaml(self): test_file = self.get_test_loc('freebsd/not_yaml/+COMPACT_MANIFEST') try: diff --git a/tests/packagedcode/test_maven.py b/tests/packagedcode/test_maven.py index 62349097ce4..0f5d64aed57 100644 --- a/tests/packagedcode/test_maven.py +++ b/tests/packagedcode/test_maven.py @@ -236,6 +236,13 @@ def test_maven_assembly_with_pom_and_manifest(self): run_scan_click(['--package', '--license', '--license-diagnostics', '--processes', '-1', test_dir, '--json', result_file]) check_json_scan(expected_file, result_file, remove_uuid=True, regen=REGEN_TEST_FIXTURES) + def test_maven_assembly_with_pom_and_manifest_package_only(self): + test_dir = self.get_test_loc('maven_misc/assemble/johnzon-jsonb-1.2.11') + result_file = self.get_temp_file('json') + expected_file = self.get_test_loc('maven_misc/assemble/johnzon-jsonb-1.2.11-package-only-expected.json') + run_scan_click(['--package-only', '--processes', '-1', test_dir, '--json', result_file]) + check_json_scan(expected_file, result_file, remove_uuid=True, regen=REGEN_TEST_FIXTURES) + def test_maven_assembly_with_pom_and_jar_manifest(self): test_dir = self.get_test_loc('maven_misc/assemble/numbers-1.7.4') result_file = self.get_temp_file('json') diff --git a/tests/packagedcode/test_npm.py b/tests/packagedcode/test_npm.py index 4bf9877011d..85c80c46c48 100644 --- a/tests/packagedcode/test_npm.py +++ b/tests/packagedcode/test_npm.py @@ -347,7 +347,7 @@ def test_vcs_repository_mapper_handles_version_on_gh(self): def test_npm_get_package_resources(self): test_file = self.get_test_loc('npm/get_package_resources') - expected_file = self.get_test_loc('npm/get_package_resources.scan.expected.json', must_exist=False) + expected_file = self.get_test_loc('npm/get_package_resources.scan.expected.json') result_file = self.get_temp_file('results.json') run_scan_click(['--package', test_file, '--json', result_file]) check_json_scan( @@ -356,16 +356,25 @@ def test_npm_get_package_resources(self): def test_scan_cli_works(self): test_file = self.get_test_loc('npm/scan-nested/scan') - expected_file = self.get_test_loc('npm/scan-nested/scan.expected.json', must_exist=False) + expected_file = self.get_test_loc('npm/scan-nested/scan.expected.json') result_file = self.get_temp_file('results.json') run_scan_click(['--package', test_file, '--json', result_file]) check_json_scan( expected_file, result_file, remove_uuid=True, regen=REGEN_TEST_FIXTURES ) + def test_scan_cli_works_package_only(self): + test_file = self.get_test_loc('npm/scan-nested/scan') + expected_file = self.get_test_loc('npm/scan-nested/scan-package-only.expected.json') + result_file = self.get_temp_file('results.json') + run_scan_click(['--package-only', test_file, '--json', result_file]) + check_json_scan( + expected_file, result_file, remove_uuid=True, regen=REGEN_TEST_FIXTURES + ) + def test_npm_electron_scan(self): test_file = self.get_test_loc('npm/electron/package') - expected_file = self.get_test_loc('npm/electron/package.expected.json', must_exist=False) + expected_file = self.get_test_loc('npm/electron/package.expected.json') result_file = self.get_temp_file('results.json') run_scan_click(['--package', test_file, '--json', result_file]) check_json_scan( @@ -374,7 +383,7 @@ def test_npm_electron_scan(self): def test_npm_scan_with_private_package_json(self): test_file = self.get_test_loc('npm/private/package.json') - expected_file = self.get_test_loc('npm/private/scan.expected.json', must_exist=False) + expected_file = self.get_test_loc('npm/private/scan.expected.json') result_file = self.get_temp_file('results.json') run_scan_click(['--package', test_file, '--json', result_file]) check_json_scan( @@ -383,7 +392,7 @@ def test_npm_scan_with_private_package_json(self): def test_npm_scan_with_private_package_json_and_yarn_lock(self): test_file = self.get_test_loc('npm/private-and-yarn/theia/') - expected_file = self.get_test_loc('npm/private-and-yarn/scan.expected.json', must_exist=False) + expected_file = self.get_test_loc('npm/private-and-yarn/scan.expected.json') result_file = self.get_temp_file('results.json') run_scan_click(['--package', test_file, '--json', result_file]) check_json_scan( diff --git a/tests/packagedcode/test_nuget.py b/tests/packagedcode/test_nuget.py index 37298a45c7e..647b3d1024e 100644 --- a/tests/packagedcode/test_nuget.py +++ b/tests/packagedcode/test_nuget.py @@ -56,3 +56,9 @@ def test_parse_as_package(self): package = nuget.NugetNuspecHandler.parse(test_file) expected_loc = self.get_test_loc('nuget/Castle.Core.nuspec.json.expected') self.check_packages_data(package, expected_loc, regen=REGEN_TEST_FIXTURES) + + def test_parse_as_package_only(self): + test_file = self.get_test_loc('nuget/Castle.Core.nuspec') + package = nuget.NugetNuspecHandler.parse(location=test_file, package_only=True) + expected_loc = self.get_test_loc('nuget/Castle.Core.nuspec-package-only.json.expected') + self.check_packages_data(package, expected_loc, regen=REGEN_TEST_FIXTURES, package_only=True) diff --git a/tests/packagedcode/test_plugin_package.py b/tests/packagedcode/test_plugin_package.py index bbe2216d4a3..2ca1bfe54b7 100644 --- a/tests/packagedcode/test_plugin_package.py +++ b/tests/packagedcode/test_plugin_package.py @@ -166,14 +166,14 @@ def test_package_command_scan_mum(self): def test_package_command_scan_pubspec_package(self): test_dir = self.get_test_loc('pubspec/specs/authors-pubspec.yaml') result_file = self.get_temp_file('json') - expected_file = self.get_test_loc('plugin/pubspec-expected.json', must_exist=False) + expected_file = self.get_test_loc('plugin/pubspec-expected.json') run_scan_click(['--package', '--strip-root', '--processes', '-1', test_dir, '--json', result_file]) check_json_scan(expected_file, result_file, remove_uuid=True, regen=REGEN_TEST_FIXTURES) def test_package_command_scan_pubspec_lock_package(self): test_dir = self.get_test_loc('pubspec/locks/dart-pubspec.lock') result_file = self.get_temp_file('json') - expected_file = self.get_test_loc('plugin/pubspec-lock-expected.json', must_exist=False) + expected_file = self.get_test_loc('plugin/pubspec-lock-expected.json') run_scan_click(['--package', '--strip-root', '--processes', '-1', test_dir, '--json', result_file]) check_json_scan(expected_file, result_file, remove_uuid=True, regen=REGEN_TEST_FIXTURES) diff --git a/tests/packagedcode/test_pubspec.py b/tests/packagedcode/test_pubspec.py index b87e5e18070..f0a5b6d5e25 100644 --- a/tests/packagedcode/test_pubspec.py +++ b/tests/packagedcode/test_pubspec.py @@ -30,7 +30,7 @@ def test_pubspec_yaml_is_package_data_file(self): def test_parse_lock(self): test_loc = self.get_test_loc('pubspec/mini-pubspec.lock') - expected_loc = self.get_test_loc('pubspec/mini-pubspec.lock-expected.json', must_exist=False) + expected_loc = self.get_test_loc('pubspec/mini-pubspec.lock-expected.json') package_data = pubspec.DartPubspecLockHandler.parse(test_loc) self.check_packages_data(package_data, expected_loc, regen=REGEN_TEST_FIXTURES) diff --git a/tests/packagedcode/test_pypi.py b/tests/packagedcode/test_pypi.py index 5020e28913b..b38e7e5b5ad 100644 --- a/tests/packagedcode/test_pypi.py +++ b/tests/packagedcode/test_pypi.py @@ -39,10 +39,17 @@ def test_package_scan_pypi_end_to_end_full_with_license(self): run_scan_click(['--package', '--license', '--strip-root', '--processes', '-1', test_dir, '--json', result_file]) check_json_scan(expected_file, result_file, remove_uuid=True, regen=REGEN_TEST_FIXTURES) + def test_package_scan_pypi_end_to_end_package_only(self): + test_dir = self.get_test_loc('pypi/source-package/pip-22.0.4/') + result_file = self.get_temp_file('json') + expected_file = self.get_test_loc('pypi/source-package/pip-22.0.4-pypi-package-only-expected.json') + run_scan_click(['--package-only', '--strip-root', '--processes', '-1', test_dir, '--json', result_file]) + check_json_scan(expected_file, result_file, remove_uuid=True, regen=REGEN_TEST_FIXTURES) + def test_package_scan_pypi_setup_py_end_to_end(self): test_dir = self.get_test_loc('pypi/source-package/pip-22.0.4/setup.py') result_file = self.get_temp_file('json') - expected_file = self.get_test_loc('pypi/source-package/pip-22.0.4-pypi-package-setup-expected.json', must_exist=False) + expected_file = self.get_test_loc('pypi/source-package/pip-22.0.4-pypi-package-setup-expected.json') run_scan_click(['--package', '--strip-root', '--processes', '-1', test_dir, '--json', result_file]) check_json_scan(expected_file, result_file, remove_uuid=True, regen=REGEN_TEST_FIXTURES) @@ -266,14 +273,14 @@ def test_parse_metadata_unpacked_sdist_metadata_v21(self): def test_can_parse_solo_metadata_from_command_line(self): test_file = self.get_test_loc('pypi/solo-metadata/PKG-INFO') - expected_file = self.get_test_loc('pypi/solo-metadata/expected.json', must_exist=False) + expected_file = self.get_test_loc('pypi/solo-metadata/expected.json') result_file = self.get_temp_file('results.json') run_scan_click(['--package', test_file, '--json', result_file]) check_json_scan(expected_file, result_file, remove_uuid=True, regen=REGEN_TEST_FIXTURES) def test_parse_metadata_prefer_pkg_info_from_egg_info_from_command_line(self): test_file = self.get_test_loc('pypi/unpacked_sdist/prefer-egg-info-pkg-info/celery') - expected_file = self.get_test_loc('pypi/unpacked_sdist/prefer-egg-info-pkg-info/celery-expected.json', must_exist=False) + expected_file = self.get_test_loc('pypi/unpacked_sdist/prefer-egg-info-pkg-info/celery-expected.json') result_file = self.get_temp_file('results.json') run_scan_click(['--package', test_file, '--json', result_file]) check_json_scan(expected_file, result_file, remove_uuid=True, regen=REGEN_TEST_FIXTURES) @@ -539,25 +546,25 @@ class TestPyPiSetupPyNames(PackageTester): def test_parse_setup_py_with_name(self): test_file = self.get_test_loc('pypi/setup.py-name-or-no-name/with_name-setup.py') package = pypi.PythonSetupPyHandler.parse(test_file) - expected_loc = self.get_test_loc('pypi/setup.py-name-or-no-name/with_name-setup.py.expected.json', must_exist=False) + expected_loc = self.get_test_loc('pypi/setup.py-name-or-no-name/with_name-setup.py.expected.json') self.check_packages_data(package, expected_loc, regen=REGEN_TEST_FIXTURES) def test_parse_setup_py_without_name(self): test_file = self.get_test_loc('pypi/setup.py-name-or-no-name/without_name-setup.py') package = pypi.PythonSetupPyHandler.parse(test_file) - expected_loc = self.get_test_loc('pypi/setup.py-name-or-no-name/without_name-setup.py.expected.json', must_exist=False) + expected_loc = self.get_test_loc('pypi/setup.py-name-or-no-name/without_name-setup.py.expected.json') self.check_packages_data(package, expected_loc, regen=REGEN_TEST_FIXTURES) def test_get_setup_py_args_with_name(self): test_file = self.get_test_loc('pypi/setup.py-name-or-no-name/with_name-setup.py') kwargs = pypi.get_setup_py_args(test_file) - expected_loc = self.get_test_loc('pypi/setup.py-name-or-no-name/with_name-setup.py.args.expected.json', must_exist=False) + expected_loc = self.get_test_loc('pypi/setup.py-name-or-no-name/with_name-setup.py.args.expected.json') check_result_equals_expected_json(kwargs, expected_loc, regen=REGEN_TEST_FIXTURES) def test_get_setup_py_args_without_name(self): test_file = self.get_test_loc('pypi/setup.py-name-or-no-name/without_name-setup.py') kwargs = pypi.get_setup_py_args(test_file) - expected_loc = self.get_test_loc('pypi/setup.py-name-or-no-name/without_name-setup.py.args.expected.json', must_exist=False) + expected_loc = self.get_test_loc('pypi/setup.py-name-or-no-name/without_name-setup.py.args.expected.json') check_result_equals_expected_json(kwargs, expected_loc, regen=REGEN_TEST_FIXTURES) diff --git a/tests/packagedcode/test_rpm.py b/tests/packagedcode/test_rpm.py index 56f4bfc5022..1baa3762a85 100644 --- a/tests/packagedcode/test_rpm.py +++ b/tests/packagedcode/test_rpm.py @@ -33,6 +33,17 @@ def test_parse_to_package(self): ) check_result_equals_expected_json(result, expected_loc, regen=REGEN_TEST_FIXTURES) + def test_parse_to_package_only(self): + test_file = self.get_test_loc('rpm/header/libproxy-bin-0.3.0-4.el6_3.x86_64.rpm') + package_datas = rpm.RpmArchiveHandler.parse(location=test_file, package_only=True) + result = [pd.to_dict() for pd in package_datas] + + expected_loc = self.get_test_loc( + 'rpm/header/libproxy-bin-0.3.0-4.el6_3.x86_64.rpm-package-only-expected.json', + must_exist=False, + ) + check_result_equals_expected_json(result, expected_loc, regen=REGEN_TEST_FIXTURES) + def test_pyrpm_basic(self): test_file = self.get_test_loc('rpm/header/python-glc-0.7.1-1.src.rpm') from packagedcode.pyrpm import RPM diff --git a/tests/packagedcode/test_rubygems.py b/tests/packagedcode/test_rubygems.py index 4dc8f26e1d1..af55f355ab7 100644 --- a/tests/packagedcode/test_rubygems.py +++ b/tests/packagedcode/test_rubygems.py @@ -66,6 +66,12 @@ def test_rubygems_oj_gemspec(self): packages = rubygems.GemspecHandler.parse(test_file) self.check_packages_data(packages, expected_loc, regen=REGEN_TEST_FIXTURES) + def test_rubygems_oj_gemspec_package_only(self): + test_file = self.get_test_loc('rubygems/gemspec/oj.gemspec') + expected_loc = self.get_test_loc('rubygems/gemspec/oj.gemspec-package-only.expected.json') + packages = rubygems.GemspecHandler.parse(location=test_file, package_only=True) + self.check_packages_data(packages, expected_loc, regen=REGEN_TEST_FIXTURES) + def test_rubygems_rubocop_gemspec(self): test_file = self.get_test_loc('rubygems/gemspec/rubocop.gemspec') expected_loc = self.get_test_loc('rubygems/gemspec/rubocop.gemspec.expected.json')