diff --git a/src/packagedcode/models.py b/src/packagedcode/models.py index 26c6b6d0c8c..86980158003 100644 --- a/src/packagedcode/models.py +++ b/src/packagedcode/models.py @@ -1186,7 +1186,7 @@ def assign_package_to_resources(cls, package, resource, codebase, package_adder= starting ``resource`` in the ``codebase``. This default implementation assigns the package to the whole - ``resource`` tree. Since ``resource`` is a file y default, this means + ``resource`` tree. Since ``resource`` is a file by default, this means that only the datafile ``resource`` is assigned to the ``package`` by default. diff --git a/src/packagedcode/pypi.py b/src/packagedcode/pypi.py index dcfe261d946..fec8575372e 100644 --- a/src/packagedcode/pypi.py +++ b/src/packagedcode/pypi.py @@ -18,6 +18,7 @@ import tempfile import zipfile from configparser import ConfigParser +from fnmatch import fnmatchcase from pathlib import Path from typing import NamedTuple @@ -83,6 +84,10 @@ class PythonEggPkgInfoFile(models.DatafileHandler): @classmethod def parse(cls, location, package_only=False): + """ + Parse package data from a PKG-INFO file and other manifests present in + neighboring files as needed when an installed layout is found. + """ yield parse_metadata( location=location, datasource_id=cls.datasource_id, @@ -108,6 +113,10 @@ class PythonEditableInstallationPkgInfoFile(models.DatafileHandler): @classmethod def parse(cls, location, package_only=False): + """ + Parse package data from a PKG-INFO file and other manifests present in + neighboring files as needed when an installed layout is found. + """ yield parse_metadata( location=location, datasource_id=cls.datasource_id, @@ -150,12 +159,11 @@ class BaseExtractedPythonLayout(models.DatafileHandler): def assemble(cls, package_data, resource, codebase, package_adder): # a source distribution can have many manifests datafile_name_patterns = ( - 'Pipfile.lock', - 'Pipfile', - ) + PipRequirementsFileHandler.path_patterns + PyprojectTomlHandler.path_patterns + PipfileHandler.path_patterns + PipfileLockHandler.path_patterns + + PipRequirementsFileHandler.path_patterns + PyprojectTomlHandler.path_patterns + ) - # TODO: we want PKG-INFO first, then (setup.py, setup.cfg), then pyproject.toml for poetry - # then we have the rest of the lock files (pipfile, pipfile.lock, etc.) + is_datafile_pypi = any(fnmatchcase(resource.path, pat) for pat in datafile_name_patterns) package_resource = None if resource.name == 'PKG-INFO': @@ -186,18 +194,21 @@ def assemble(cls, package_data, resource, codebase, package_adder): continue package_resource = child break - elif resource.name in datafile_name_patterns: + + elif is_datafile_pypi: if resource.has_parent(): siblings = resource.siblings(codebase) - package_resource = [r for r in siblings if r.name == 'PKG-INFO'] + package_resources = [r for r in siblings if r.name == 'PKG-INFO'] if package_resource: - package_resource = package_resource[0] + package_resource = package_resources[0] package = None if package_resource: pkg_data = package_resource.package_data[0] pkg_data = models.PackageData.from_dict(pkg_data) if pkg_data.purl: + # We yield only the package and the resource, and not dependencies because + # PKG-INFO also has the dependencies from package = create_package_from_package_data( package_data=pkg_data, datafile_path=package_resource.path @@ -207,11 +218,6 @@ def assemble(cls, package_data, resource, codebase, package_adder): package_adder(package.package_uid, package_resource, codebase) yield package_resource - yield from yield_dependencies_from_package_data( - package_data=pkg_data, - datafile_path=package_resource.path, - package_uid=package.package_uid - ) else: setup_resources = [] if resource.has_parent(): @@ -221,31 +227,50 @@ def assemble(cls, package_data, resource, codebase, package_adder): if r.name in ('setup.py', 'setup.cfg') and r.package_data ] - - setup_package_data = [ - (setup_resource, models.PackageData.from_dict(setup_resource.package_data[0])) - for setup_resource in setup_resources - ] - setup_package_data = sorted(setup_package_data, key=lambda s: bool(s[1].purl), reverse=True) - for setup_resource, setup_pkg_data in setup_package_data: - if setup_pkg_data.purl: - if not package: - package = create_package_from_package_data( + if setup_resources: + setup_package_data = [ + (setup_resource, models.PackageData.from_dict(setup_resource.package_data[0])) + for setup_resource in setup_resources + ] + setup_package_data = sorted(setup_package_data, key=lambda s: bool(s[1].purl), reverse=True) + for setup_resource, setup_pkg_data in setup_package_data: + if setup_pkg_data.purl: + if not package: + package = create_package_from_package_data( + package_data=setup_pkg_data, + datafile_path=setup_resource.path, + ) + yield package + package_resource = setup_resource + else: + package.update(setup_pkg_data, setup_resource.path) + if package: + for setup_resource, setup_pkg_data in setup_package_data: + package_adder(package.package_uid, setup_resource, codebase) + yield setup_resource + + yield from yield_dependencies_from_package_data( package_data=setup_pkg_data, datafile_path=setup_resource.path, + package_uid=package.package_uid ) - yield package - package_resource = setup_resource - else: - package.update(setup_pkg_data, setup_resource.path) - if package: - for setup_resource, setup_pkg_data in setup_package_data: - package_adder(package.package_uid, setup_resource, codebase) - yield setup_resource + else: + package_resource = resource + pkg_data = package_resource.package_data[0] + pkg_data = models.PackageData.from_dict(pkg_data) + if pkg_data.purl: + package = create_package_from_package_data( + package_data=pkg_data, + datafile_path=package_resource.path + ) + yield package + + package_adder(package.package_uid, package_resource, codebase) + yield package_resource yield from yield_dependencies_from_package_data( - package_data=setup_pkg_data, - datafile_path=setup_resource.path, + package_data=pkg_data, + datafile_path=package_resource.path, package_uid=package.package_uid ) @@ -275,12 +300,20 @@ def assemble(cls, package_data, resource, codebase, package_adder): else: package_uid = None + # Yield dependencies from sibling manifests if package_resource: for sibling in package_resource.siblings(codebase): - if sibling and sibling.name in datafile_name_patterns: + if not sibling: + continue + + is_sibling_pypi_manifest = any( + fnmatchcase(sibling.path, pat) + for pat in datafile_name_patterns + ) + if is_sibling_pypi_manifest: yield from yield_dependencies_from_package_resource( resource=sibling, - package_uid=package_uid + package_uid=package_uid, ) if package_uid and package_uid not in sibling.for_packages: @@ -981,6 +1014,10 @@ def parse_metadata(location, datasource_id, package_type, package_only=False): if license_file: extra_data['license_file'] = license_file + # FIXME: We are getting dependencies from other sibling files, this is duplicated + # data at the package_data level, is this necessary? We also have the entire dependency + # relationships here at requires.txt present in ``.egg-info`` should we store these + # nicely? dependencies = get_dist_dependencies(dist) file_references = list(get_file_references(dist)) @@ -1240,6 +1277,8 @@ def parse(cls, location, package_only=False): with open(location) as f: parser.read_file(f) + extra_data = {} + for section in parser.values(): if section.name == 'options': scope_by_sub_section = { @@ -1255,22 +1294,10 @@ def parse(cls, location, package_only=False): reqs = list(get_requirement_from_section(section=section, sub_section=sub_section)) dependent_packages.extend(cls.parse_reqs(reqs, scope)) continue + + # This is not a dependency, merely a required python version python_requires_specifier = section[sub_section] - purl = PackageURL( - type="generic", - name="python", - ) - resolved_purl = get_resolved_purl(purl=purl, specifiers=SpecifierSet(python_requires_specifier)) - dependent_packages.append( - models.DependentPackage( - purl=str(resolved_purl.purl), - scope=scope, - is_runtime=True, - is_optional=False, - is_resolved=resolved_purl.is_resolved, - extracted_requirement=f"python_requires{python_requires_specifier}", - ) - ) + extra_data["python_requires"] = python_requires_specifier if section.name == "options.extras_require": for sub_section in section: diff --git a/tests/formattedcode/data/common/manifests-expected.json b/tests/formattedcode/data/common/manifests-expected.json index 730bafeb8ae..aaaba0440fd 100644 --- a/tests/formattedcode/data/common/manifests-expected.json +++ b/tests/formattedcode/data/common/manifests-expected.json @@ -273,6 +273,117 @@ "npm_package_json" ], "purl": "pkg:npm/angular-compare-validator@0.1.1" + }, + { + "type": "pypi", + "namespace": null, + "name": "bluepyopt", + "version": null, + "qualifiers": {}, + "subpath": null, + "primary_language": "Python", + "description": "Bluebrain Python Optimisation Library (bluepyopt)", + "release_date": null, + "parties": [ + { + "type": "person", + "role": "author", + "name": "BlueBrain Project, EPFL", + "email": "werner.vangeit@epfl.ch", + "url": null + } + ], + "keywords": [ + "optimisation", + "neuroscience", + "BlueBrainProject", + "Development Status :: 5 - Production/Stable", + "Environment :: Console", + "Programming Language :: Python :: 3 :: Only", + "Operating System :: POSIX", + "Topic :: Scientific/Engineering", + "Topic :: Utilities" + ], + "homepage_url": "https://github.com/BlueBrain/BluePyOpt", + "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": "lgpl-3.0", + "declared_license_expression_spdx": "LGPL-3.0-only", + "license_detections": [ + { + "license_expression": "lgpl-3.0", + "license_expression_spdx": "LGPL-3.0-only", + "matches": [ + { + "license_expression": "lgpl-3.0", + "spdx_license_expression": "LGPL-3.0-only", + "from_file": "manifests/pypi/bluepyopt_setup.py", + "start_line": 1, + "end_line": 1, + "matcher": "1-hash", + "score": 100.0, + "matched_length": 1, + "match_coverage": 100.0, + "rule_relevance": 100, + "rule_identifier": "lgpl-3.0_29.RULE", + "rule_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/rules/lgpl-3.0_29.RULE", + "matched_text": "LGPLv3" + } + ], + "identifier": "lgpl_3_0-38174920-e8ed-7bda-41ec-94df7380b7d5" + }, + { + "license_expression": "lgpl-3.0", + "license_expression_spdx": "LGPL-3.0-only", + "matches": [ + { + "license_expression": "lgpl-3.0", + "spdx_license_expression": "LGPL-3.0-only", + "from_file": "manifests/pypi/bluepyopt_setup.py", + "start_line": 1, + "end_line": 1, + "matcher": "1-hash", + "score": 100.0, + "matched_length": 10, + "match_coverage": 100.0, + "rule_relevance": 100, + "rule_identifier": "pypi_gnu_lesser_general_public_license_v3.RULE", + "rule_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/rules/pypi_gnu_lesser_general_public_license_v3.RULE", + "matched_text": "- 'License :: OSI Approved :: GNU Lesser General Public License v3 (LGPLv3)'" + } + ], + "identifier": "lgpl_3_0-272571eb-5e68-95b6-ddb0-71de2d8df321" + } + ], + "other_license_expression": null, + "other_license_expression_spdx": null, + "other_license_detections": [], + "extracted_license_statement": "license: LGPLv3\nclassifiers:\n - 'License :: OSI Approved :: GNU Lesser General Public License v3 (LGPLv3)'\n", + "notice_text": null, + "source_packages": [], + "is_private": false, + "is_virtual": false, + "extra_data": {}, + "repository_homepage_url": "https://pypi.org/project/bluepyopt", + "repository_download_url": null, + "api_data_url": "https://pypi.org/pypi/bluepyopt/json", + "package_uid": "pkg:pypi/bluepyopt?uuid=fixed-uid-done-for-testing-5642512d1758", + "datafile_paths": [ + "manifests/pypi/bluepyopt_setup.py" + ], + "datasource_ids": [ + "pypi_setup_py" + ], + "purl": "pkg:pypi/bluepyopt" } ], "dependencies": [ @@ -500,6 +611,171 @@ "for_package_uid": "pkg:npm/angular-compare-validator@0.1.1?uuid=fixed-uid-done-for-testing-5642512d1758", "datafile_path": "manifests/npm-license-string/package.json", "datasource_id": "npm_package_json" + }, + { + "purl": "pkg:pypi/numpy", + "extracted_requirement": ">=1.6", + "scope": "install", + "is_runtime": true, + "is_optional": false, + "is_resolved": false, + "is_direct": true, + "resolved_package": {}, + "extra_data": {}, + "dependency_uid": "pkg:pypi/numpy?uuid=fixed-uid-done-for-testing-5642512d1758", + "for_package_uid": "pkg:pypi/bluepyopt?uuid=fixed-uid-done-for-testing-5642512d1758", + "datafile_path": "manifests/pypi/bluepyopt_setup.py", + "datasource_id": "pypi_setup_py" + }, + { + "purl": "pkg:pypi/pandas", + "extracted_requirement": ">=0.18", + "scope": "install", + "is_runtime": true, + "is_optional": false, + "is_resolved": false, + "is_direct": true, + "resolved_package": {}, + "extra_data": {}, + "dependency_uid": "pkg:pypi/pandas?uuid=fixed-uid-done-for-testing-5642512d1758", + "for_package_uid": "pkg:pypi/bluepyopt?uuid=fixed-uid-done-for-testing-5642512d1758", + "datafile_path": "manifests/pypi/bluepyopt_setup.py", + "datasource_id": "pypi_setup_py" + }, + { + "purl": "pkg:pypi/deap", + "extracted_requirement": null, + "scope": "install", + "is_runtime": true, + "is_optional": false, + "is_resolved": false, + "is_direct": true, + "resolved_package": {}, + "extra_data": {}, + "dependency_uid": "pkg:pypi/deap?uuid=fixed-uid-done-for-testing-5642512d1758", + "for_package_uid": "pkg:pypi/bluepyopt?uuid=fixed-uid-done-for-testing-5642512d1758", + "datafile_path": "manifests/pypi/bluepyopt_setup.py", + "datasource_id": "pypi_setup_py" + }, + { + "purl": "pkg:pypi/efel", + "extracted_requirement": ">=2.13", + "scope": "install", + "is_runtime": true, + "is_optional": false, + "is_resolved": false, + "is_direct": true, + "resolved_package": {}, + "extra_data": {}, + "dependency_uid": "pkg:pypi/efel?uuid=fixed-uid-done-for-testing-5642512d1758", + "for_package_uid": "pkg:pypi/bluepyopt?uuid=fixed-uid-done-for-testing-5642512d1758", + "datafile_path": "manifests/pypi/bluepyopt_setup.py", + "datasource_id": "pypi_setup_py" + }, + { + "purl": "pkg:pypi/ipyparallel", + "extracted_requirement": null, + "scope": "install", + "is_runtime": true, + "is_optional": false, + "is_resolved": false, + "is_direct": true, + "resolved_package": {}, + "extra_data": {}, + "dependency_uid": "pkg:pypi/ipyparallel?uuid=fixed-uid-done-for-testing-5642512d1758", + "for_package_uid": "pkg:pypi/bluepyopt?uuid=fixed-uid-done-for-testing-5642512d1758", + "datafile_path": "manifests/pypi/bluepyopt_setup.py", + "datasource_id": "pypi_setup_py" + }, + { + "purl": "pkg:pypi/pickleshare", + "extracted_requirement": ">=0.7.3", + "scope": "install", + "is_runtime": true, + "is_optional": false, + "is_resolved": false, + "is_direct": true, + "resolved_package": {}, + "extra_data": {}, + "dependency_uid": "pkg:pypi/pickleshare?uuid=fixed-uid-done-for-testing-5642512d1758", + "for_package_uid": "pkg:pypi/bluepyopt?uuid=fixed-uid-done-for-testing-5642512d1758", + "datafile_path": "manifests/pypi/bluepyopt_setup.py", + "datasource_id": "pypi_setup_py" + }, + { + "purl": "pkg:pypi/jinja2", + "extracted_requirement": ">=2.8", + "scope": "install", + "is_runtime": true, + "is_optional": false, + "is_resolved": false, + "is_direct": true, + "resolved_package": {}, + "extra_data": {}, + "dependency_uid": "pkg:pypi/jinja2?uuid=fixed-uid-done-for-testing-5642512d1758", + "for_package_uid": "pkg:pypi/bluepyopt?uuid=fixed-uid-done-for-testing-5642512d1758", + "datafile_path": "manifests/pypi/bluepyopt_setup.py", + "datasource_id": "pypi_setup_py" + }, + { + "purl": "pkg:pypi/future", + "extracted_requirement": null, + "scope": "install", + "is_runtime": true, + "is_optional": false, + "is_resolved": false, + "is_direct": true, + "resolved_package": {}, + "extra_data": {}, + "dependency_uid": "pkg:pypi/future?uuid=fixed-uid-done-for-testing-5642512d1758", + "for_package_uid": "pkg:pypi/bluepyopt?uuid=fixed-uid-done-for-testing-5642512d1758", + "datafile_path": "manifests/pypi/bluepyopt_setup.py", + "datasource_id": "pypi_setup_py" + }, + { + "purl": "pkg:pypi/pebble", + "extracted_requirement": ">=4.3.10", + "scope": "install", + "is_runtime": true, + "is_optional": false, + "is_resolved": false, + "is_direct": true, + "resolved_package": {}, + "extra_data": {}, + "dependency_uid": "pkg:pypi/pebble?uuid=fixed-uid-done-for-testing-5642512d1758", + "for_package_uid": "pkg:pypi/bluepyopt?uuid=fixed-uid-done-for-testing-5642512d1758", + "datafile_path": "manifests/pypi/bluepyopt_setup.py", + "datasource_id": "pypi_setup_py" + }, + { + "purl": "pkg:pypi/scoop", + "extracted_requirement": ">=0.7", + "scope": "all", + "is_runtime": true, + "is_optional": false, + "is_resolved": false, + "is_direct": true, + "resolved_package": {}, + "extra_data": {}, + "dependency_uid": "pkg:pypi/scoop?uuid=fixed-uid-done-for-testing-5642512d1758", + "for_package_uid": "pkg:pypi/bluepyopt?uuid=fixed-uid-done-for-testing-5642512d1758", + "datafile_path": "manifests/pypi/bluepyopt_setup.py", + "datasource_id": "pypi_setup_py" + }, + { + "purl": "pkg:pypi/scoop", + "extracted_requirement": ">=0.7", + "scope": "scoop", + "is_runtime": true, + "is_optional": false, + "is_resolved": false, + "is_direct": true, + "resolved_package": {}, + "extra_data": {}, + "dependency_uid": "pkg:pypi/scoop?uuid=fixed-uid-done-for-testing-5642512d1758", + "for_package_uid": "pkg:pypi/bluepyopt?uuid=fixed-uid-done-for-testing-5642512d1758", + "datafile_path": "manifests/pypi/bluepyopt_setup.py", + "datasource_id": "pypi_setup_py" } ], "license_detections": [ @@ -1822,7 +2098,9 @@ "purl": "pkg:pypi/bluepyopt" } ], - "for_packages": [], + "for_packages": [ + "pkg:pypi/bluepyopt?uuid=fixed-uid-done-for-testing-5642512d1758" + ], "detected_license_expression": "lgpl-3.0", "detected_license_expression_spdx": "LGPL-3.0-only", "license_detections": [ diff --git a/tests/formattedcode/data/common/manifests-expected.jsonlines b/tests/formattedcode/data/common/manifests-expected.jsonlines index 960021483b9..8bc764b159c 100644 --- a/tests/formattedcode/data/common/manifests-expected.jsonlines +++ b/tests/formattedcode/data/common/manifests-expected.jsonlines @@ -20,9 +20,9 @@ "system_environment": { "operating_system": "linux", "cpu_architecture": "64", - "platform": "Linux-5.15.0-112-generic-x86_64-with-glibc2.35", - "platform_version": "#122-Ubuntu SMP Thu May 23 07:48:21 UTC 2024", - "python_version": "3.10.12 (main, Nov 20 2023, 15:14:05) [GCC 11.4.0]" + "platform": "Linux-5.15.0-116-generic-x86_64-with-glibc2.35", + "platform_version": "#126-Ubuntu SMP Mon Jul 1 10:14:24 UTC 2024", + "python_version": "3.10.12 (main, Mar 22 2024, 16:50:05) [GCC 11.4.0]" }, "spdx_license_list_version": "3.24", "files_count": 4 @@ -305,6 +305,117 @@ "npm_package_json" ], "purl": "pkg:npm/angular-compare-validator@0.1.1" + }, + { + "type": "pypi", + "namespace": null, + "name": "bluepyopt", + "version": null, + "qualifiers": {}, + "subpath": null, + "primary_language": "Python", + "description": "Bluebrain Python Optimisation Library (bluepyopt)", + "release_date": null, + "parties": [ + { + "type": "person", + "role": "author", + "name": "BlueBrain Project, EPFL", + "email": "werner.vangeit@epfl.ch", + "url": null + } + ], + "keywords": [ + "optimisation", + "neuroscience", + "BlueBrainProject", + "Development Status :: 5 - Production/Stable", + "Environment :: Console", + "Programming Language :: Python :: 3 :: Only", + "Operating System :: POSIX", + "Topic :: Scientific/Engineering", + "Topic :: Utilities" + ], + "homepage_url": "https://github.com/BlueBrain/BluePyOpt", + "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": "lgpl-3.0", + "declared_license_expression_spdx": "LGPL-3.0-only", + "license_detections": [ + { + "license_expression": "lgpl-3.0", + "license_expression_spdx": "LGPL-3.0-only", + "matches": [ + { + "license_expression": "lgpl-3.0", + "spdx_license_expression": "LGPL-3.0-only", + "from_file": "manifests/pypi/bluepyopt_setup.py", + "start_line": 1, + "end_line": 1, + "matcher": "1-hash", + "score": 100.0, + "matched_length": 1, + "match_coverage": 100.0, + "rule_relevance": 100, + "rule_identifier": "lgpl-3.0_29.RULE", + "rule_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/rules/lgpl-3.0_29.RULE", + "matched_text": "LGPLv3" + } + ], + "identifier": "lgpl_3_0-38174920-e8ed-7bda-41ec-94df7380b7d5" + }, + { + "license_expression": "lgpl-3.0", + "license_expression_spdx": "LGPL-3.0-only", + "matches": [ + { + "license_expression": "lgpl-3.0", + "spdx_license_expression": "LGPL-3.0-only", + "from_file": "manifests/pypi/bluepyopt_setup.py", + "start_line": 1, + "end_line": 1, + "matcher": "1-hash", + "score": 100.0, + "matched_length": 10, + "match_coverage": 100.0, + "rule_relevance": 100, + "rule_identifier": "pypi_gnu_lesser_general_public_license_v3.RULE", + "rule_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/rules/pypi_gnu_lesser_general_public_license_v3.RULE", + "matched_text": "- 'License :: OSI Approved :: GNU Lesser General Public License v3 (LGPLv3)'" + } + ], + "identifier": "lgpl_3_0-272571eb-5e68-95b6-ddb0-71de2d8df321" + } + ], + "other_license_expression": null, + "other_license_expression_spdx": null, + "other_license_detections": [], + "extracted_license_statement": "license: LGPLv3\nclassifiers:\n - 'License :: OSI Approved :: GNU Lesser General Public License v3 (LGPLv3)'\n", + "notice_text": null, + "source_packages": [], + "is_private": false, + "is_virtual": false, + "extra_data": {}, + "repository_homepage_url": "https://pypi.org/project/bluepyopt", + "repository_download_url": null, + "api_data_url": "https://pypi.org/pypi/bluepyopt/json", + "package_uid": "pkg:pypi/bluepyopt?uuid=fixed-uid-done-for-testing-5642512d1758", + "datafile_paths": [ + "manifests/pypi/bluepyopt_setup.py" + ], + "datasource_ids": [ + "pypi_setup_py" + ], + "purl": "pkg:pypi/bluepyopt" } ] }, @@ -534,6 +645,171 @@ "for_package_uid": "pkg:npm/angular-compare-validator@0.1.1?uuid=fixed-uid-done-for-testing-5642512d1758", "datafile_path": "manifests/npm-license-string/package.json", "datasource_id": "npm_package_json" + }, + { + "purl": "pkg:pypi/numpy", + "extracted_requirement": ">=1.6", + "scope": "install", + "is_runtime": true, + "is_optional": false, + "is_resolved": false, + "is_direct": true, + "resolved_package": {}, + "extra_data": {}, + "dependency_uid": "pkg:pypi/numpy?uuid=fixed-uid-done-for-testing-5642512d1758", + "for_package_uid": "pkg:pypi/bluepyopt?uuid=fixed-uid-done-for-testing-5642512d1758", + "datafile_path": "manifests/pypi/bluepyopt_setup.py", + "datasource_id": "pypi_setup_py" + }, + { + "purl": "pkg:pypi/pandas", + "extracted_requirement": ">=0.18", + "scope": "install", + "is_runtime": true, + "is_optional": false, + "is_resolved": false, + "is_direct": true, + "resolved_package": {}, + "extra_data": {}, + "dependency_uid": "pkg:pypi/pandas?uuid=fixed-uid-done-for-testing-5642512d1758", + "for_package_uid": "pkg:pypi/bluepyopt?uuid=fixed-uid-done-for-testing-5642512d1758", + "datafile_path": "manifests/pypi/bluepyopt_setup.py", + "datasource_id": "pypi_setup_py" + }, + { + "purl": "pkg:pypi/deap", + "extracted_requirement": null, + "scope": "install", + "is_runtime": true, + "is_optional": false, + "is_resolved": false, + "is_direct": true, + "resolved_package": {}, + "extra_data": {}, + "dependency_uid": "pkg:pypi/deap?uuid=fixed-uid-done-for-testing-5642512d1758", + "for_package_uid": "pkg:pypi/bluepyopt?uuid=fixed-uid-done-for-testing-5642512d1758", + "datafile_path": "manifests/pypi/bluepyopt_setup.py", + "datasource_id": "pypi_setup_py" + }, + { + "purl": "pkg:pypi/efel", + "extracted_requirement": ">=2.13", + "scope": "install", + "is_runtime": true, + "is_optional": false, + "is_resolved": false, + "is_direct": true, + "resolved_package": {}, + "extra_data": {}, + "dependency_uid": "pkg:pypi/efel?uuid=fixed-uid-done-for-testing-5642512d1758", + "for_package_uid": "pkg:pypi/bluepyopt?uuid=fixed-uid-done-for-testing-5642512d1758", + "datafile_path": "manifests/pypi/bluepyopt_setup.py", + "datasource_id": "pypi_setup_py" + }, + { + "purl": "pkg:pypi/ipyparallel", + "extracted_requirement": null, + "scope": "install", + "is_runtime": true, + "is_optional": false, + "is_resolved": false, + "is_direct": true, + "resolved_package": {}, + "extra_data": {}, + "dependency_uid": "pkg:pypi/ipyparallel?uuid=fixed-uid-done-for-testing-5642512d1758", + "for_package_uid": "pkg:pypi/bluepyopt?uuid=fixed-uid-done-for-testing-5642512d1758", + "datafile_path": "manifests/pypi/bluepyopt_setup.py", + "datasource_id": "pypi_setup_py" + }, + { + "purl": "pkg:pypi/pickleshare", + "extracted_requirement": ">=0.7.3", + "scope": "install", + "is_runtime": true, + "is_optional": false, + "is_resolved": false, + "is_direct": true, + "resolved_package": {}, + "extra_data": {}, + "dependency_uid": "pkg:pypi/pickleshare?uuid=fixed-uid-done-for-testing-5642512d1758", + "for_package_uid": "pkg:pypi/bluepyopt?uuid=fixed-uid-done-for-testing-5642512d1758", + "datafile_path": "manifests/pypi/bluepyopt_setup.py", + "datasource_id": "pypi_setup_py" + }, + { + "purl": "pkg:pypi/jinja2", + "extracted_requirement": ">=2.8", + "scope": "install", + "is_runtime": true, + "is_optional": false, + "is_resolved": false, + "is_direct": true, + "resolved_package": {}, + "extra_data": {}, + "dependency_uid": "pkg:pypi/jinja2?uuid=fixed-uid-done-for-testing-5642512d1758", + "for_package_uid": "pkg:pypi/bluepyopt?uuid=fixed-uid-done-for-testing-5642512d1758", + "datafile_path": "manifests/pypi/bluepyopt_setup.py", + "datasource_id": "pypi_setup_py" + }, + { + "purl": "pkg:pypi/future", + "extracted_requirement": null, + "scope": "install", + "is_runtime": true, + "is_optional": false, + "is_resolved": false, + "is_direct": true, + "resolved_package": {}, + "extra_data": {}, + "dependency_uid": "pkg:pypi/future?uuid=fixed-uid-done-for-testing-5642512d1758", + "for_package_uid": "pkg:pypi/bluepyopt?uuid=fixed-uid-done-for-testing-5642512d1758", + "datafile_path": "manifests/pypi/bluepyopt_setup.py", + "datasource_id": "pypi_setup_py" + }, + { + "purl": "pkg:pypi/pebble", + "extracted_requirement": ">=4.3.10", + "scope": "install", + "is_runtime": true, + "is_optional": false, + "is_resolved": false, + "is_direct": true, + "resolved_package": {}, + "extra_data": {}, + "dependency_uid": "pkg:pypi/pebble?uuid=fixed-uid-done-for-testing-5642512d1758", + "for_package_uid": "pkg:pypi/bluepyopt?uuid=fixed-uid-done-for-testing-5642512d1758", + "datafile_path": "manifests/pypi/bluepyopt_setup.py", + "datasource_id": "pypi_setup_py" + }, + { + "purl": "pkg:pypi/scoop", + "extracted_requirement": ">=0.7", + "scope": "all", + "is_runtime": true, + "is_optional": false, + "is_resolved": false, + "is_direct": true, + "resolved_package": {}, + "extra_data": {}, + "dependency_uid": "pkg:pypi/scoop?uuid=fixed-uid-done-for-testing-5642512d1758", + "for_package_uid": "pkg:pypi/bluepyopt?uuid=fixed-uid-done-for-testing-5642512d1758", + "datafile_path": "manifests/pypi/bluepyopt_setup.py", + "datasource_id": "pypi_setup_py" + }, + { + "purl": "pkg:pypi/scoop", + "extracted_requirement": ">=0.7", + "scope": "scoop", + "is_runtime": true, + "is_optional": false, + "is_resolved": false, + "is_direct": true, + "resolved_package": {}, + "extra_data": {}, + "dependency_uid": "pkg:pypi/scoop?uuid=fixed-uid-done-for-testing-5642512d1758", + "for_package_uid": "pkg:pypi/bluepyopt?uuid=fixed-uid-done-for-testing-5642512d1758", + "datafile_path": "manifests/pypi/bluepyopt_setup.py", + "datasource_id": "pypi_setup_py" } ] }, @@ -1892,7 +2168,9 @@ "purl": "pkg:pypi/bluepyopt" } ], - "for_packages": [], + "for_packages": [ + "pkg:pypi/bluepyopt?uuid=fixed-uid-done-for-testing-5642512d1758" + ], "detected_license_expression": "lgpl-3.0", "detected_license_expression_spdx": "LGPL-3.0-only", "license_detections": [ diff --git a/tests/formattedcode/data/common/manifests-expected.yaml b/tests/formattedcode/data/common/manifests-expected.yaml index 5b74788a162..74f74b17eee 100644 --- a/tests/formattedcode/data/common/manifests-expected.yaml +++ b/tests/formattedcode/data/common/manifests-expected.yaml @@ -29,13 +29,13 @@ headers: system_environment: operating_system: linux cpu_architecture: 64 - platform: Linux-5.15.0-112-generic-x86_64-with-glibc2.35 - platform_version: '#122-Ubuntu SMP Thu May 23 07:48:21 UTC 2024' - python_version: 3.10.12 (main, Nov 20 2023, 15:14:05) [GCC 11.4.0] + platform: Linux-5.15.0-116-generic-x86_64-with-glibc2.35 + platform_version: '#126-Ubuntu SMP Mon Jul 1 10:14:24 UTC 2024' + python_version: 3.10.12 (main, Mar 22 2024, 16:50:05) [GCC 11.4.0] spdx_license_list_version: '3.24' files_count: 4 summary: - declared_license_expression: apache-2.0 AND cddl-1.0 AND mit + declared_license_expression: apache-2.0 AND cddl-1.0 AND lgpl-3.0 AND mit license_clarity_score: score: '0' declared_license: no @@ -44,7 +44,7 @@ summary: declared_copyrights: no conflicting_license_categories: no ambiguous_compound_licensing: yes - declared_holder: + declared_holder: EPFL/Blue Brain Project primary_language: Python other_license_expressions: - value: lgpl-3.0 @@ -58,8 +58,6 @@ summary: other_holders: - value: count: 3 - - value: EPFL/Blue Brain Project - count: 1 other_languages: [] packages: - type: maven @@ -298,6 +296,102 @@ packages: datasource_ids: - npm_package_json purl: pkg:npm/angular-compare-validator@0.1.1 + - type: pypi + namespace: + name: bluepyopt + version: + qualifiers: {} + subpath: + primary_language: Python + description: Bluebrain Python Optimisation Library (bluepyopt) + release_date: + parties: + - type: person + role: author + name: BlueBrain Project, EPFL + email: werner.vangeit@epfl.ch + url: + keywords: + - optimisation + - neuroscience + - BlueBrainProject + - 'Development Status :: 5 - Production/Stable' + - 'Environment :: Console' + - 'Programming Language :: Python :: 3 :: Only' + - 'Operating System :: POSIX' + - 'Topic :: Scientific/Engineering' + - 'Topic :: Utilities' + homepage_url: https://github.com/BlueBrain/BluePyOpt + download_url: + size: + sha1: + md5: + sha256: + sha512: + bug_tracking_url: + code_view_url: + vcs_url: + copyright: + holder: + declared_license_expression: lgpl-3.0 + declared_license_expression_spdx: LGPL-3.0-only + license_detections: + - license_expression: lgpl-3.0 + license_expression_spdx: LGPL-3.0-only + matches: + - license_expression: lgpl-3.0 + spdx_license_expression: LGPL-3.0-only + from_file: manifests/pypi/bluepyopt_setup.py + start_line: 1 + end_line: 1 + matcher: 1-hash + score: '100.0' + matched_length: 1 + match_coverage: '100.0' + rule_relevance: 100 + rule_identifier: lgpl-3.0_29.RULE + rule_url: https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/rules/lgpl-3.0_29.RULE + matched_text: LGPLv3 + identifier: lgpl_3_0-38174920-e8ed-7bda-41ec-94df7380b7d5 + - license_expression: lgpl-3.0 + license_expression_spdx: LGPL-3.0-only + matches: + - license_expression: lgpl-3.0 + spdx_license_expression: LGPL-3.0-only + from_file: manifests/pypi/bluepyopt_setup.py + start_line: 1 + end_line: 1 + matcher: 1-hash + score: '100.0' + matched_length: 10 + match_coverage: '100.0' + rule_relevance: 100 + rule_identifier: pypi_gnu_lesser_general_public_license_v3.RULE + rule_url: https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/rules/pypi_gnu_lesser_general_public_license_v3.RULE + matched_text: '- ''License :: OSI Approved :: GNU Lesser General Public License + v3 (LGPLv3)''' + identifier: lgpl_3_0-272571eb-5e68-95b6-ddb0-71de2d8df321 + other_license_expression: + other_license_expression_spdx: + other_license_detections: [] + extracted_license_statement: | + license: LGPLv3 + classifiers: + - 'License :: OSI Approved :: GNU Lesser General Public License v3 (LGPLv3)' + notice_text: + source_packages: [] + is_private: no + is_virtual: no + extra_data: {} + repository_homepage_url: https://pypi.org/project/bluepyopt + repository_download_url: + api_data_url: https://pypi.org/pypi/bluepyopt/json + package_uid: pkg:pypi/bluepyopt?uuid=fixed-uid-done-for-testing-5642512d1758 + datafile_paths: + - manifests/pypi/bluepyopt_setup.py + datasource_ids: + - pypi_setup_py + purl: pkg:pypi/bluepyopt dependencies: - purl: pkg:npm/bluebird extracted_requirement: ^2.9.30 @@ -494,6 +588,149 @@ dependencies: for_package_uid: pkg:npm/angular-compare-validator@0.1.1?uuid=fixed-uid-done-for-testing-5642512d1758 datafile_path: manifests/npm-license-string/package.json datasource_id: npm_package_json + - purl: pkg:pypi/numpy + extracted_requirement: '>=1.6' + scope: install + is_runtime: yes + is_optional: no + is_resolved: no + is_direct: yes + resolved_package: {} + extra_data: {} + dependency_uid: pkg:pypi/numpy?uuid=fixed-uid-done-for-testing-5642512d1758 + for_package_uid: pkg:pypi/bluepyopt?uuid=fixed-uid-done-for-testing-5642512d1758 + datafile_path: manifests/pypi/bluepyopt_setup.py + datasource_id: pypi_setup_py + - purl: pkg:pypi/pandas + extracted_requirement: '>=0.18' + scope: install + is_runtime: yes + is_optional: no + is_resolved: no + is_direct: yes + resolved_package: {} + extra_data: {} + dependency_uid: pkg:pypi/pandas?uuid=fixed-uid-done-for-testing-5642512d1758 + for_package_uid: pkg:pypi/bluepyopt?uuid=fixed-uid-done-for-testing-5642512d1758 + datafile_path: manifests/pypi/bluepyopt_setup.py + datasource_id: pypi_setup_py + - purl: pkg:pypi/deap + extracted_requirement: + scope: install + is_runtime: yes + is_optional: no + is_resolved: no + is_direct: yes + resolved_package: {} + extra_data: {} + dependency_uid: pkg:pypi/deap?uuid=fixed-uid-done-for-testing-5642512d1758 + for_package_uid: pkg:pypi/bluepyopt?uuid=fixed-uid-done-for-testing-5642512d1758 + datafile_path: manifests/pypi/bluepyopt_setup.py + datasource_id: pypi_setup_py + - purl: pkg:pypi/efel + extracted_requirement: '>=2.13' + scope: install + is_runtime: yes + is_optional: no + is_resolved: no + is_direct: yes + resolved_package: {} + extra_data: {} + dependency_uid: pkg:pypi/efel?uuid=fixed-uid-done-for-testing-5642512d1758 + for_package_uid: pkg:pypi/bluepyopt?uuid=fixed-uid-done-for-testing-5642512d1758 + datafile_path: manifests/pypi/bluepyopt_setup.py + datasource_id: pypi_setup_py + - purl: pkg:pypi/ipyparallel + extracted_requirement: + scope: install + is_runtime: yes + is_optional: no + is_resolved: no + is_direct: yes + resolved_package: {} + extra_data: {} + dependency_uid: pkg:pypi/ipyparallel?uuid=fixed-uid-done-for-testing-5642512d1758 + for_package_uid: pkg:pypi/bluepyopt?uuid=fixed-uid-done-for-testing-5642512d1758 + datafile_path: manifests/pypi/bluepyopt_setup.py + datasource_id: pypi_setup_py + - purl: pkg:pypi/pickleshare + extracted_requirement: '>=0.7.3' + scope: install + is_runtime: yes + is_optional: no + is_resolved: no + is_direct: yes + resolved_package: {} + extra_data: {} + dependency_uid: pkg:pypi/pickleshare?uuid=fixed-uid-done-for-testing-5642512d1758 + for_package_uid: pkg:pypi/bluepyopt?uuid=fixed-uid-done-for-testing-5642512d1758 + datafile_path: manifests/pypi/bluepyopt_setup.py + datasource_id: pypi_setup_py + - purl: pkg:pypi/jinja2 + extracted_requirement: '>=2.8' + scope: install + is_runtime: yes + is_optional: no + is_resolved: no + is_direct: yes + resolved_package: {} + extra_data: {} + dependency_uid: pkg:pypi/jinja2?uuid=fixed-uid-done-for-testing-5642512d1758 + for_package_uid: pkg:pypi/bluepyopt?uuid=fixed-uid-done-for-testing-5642512d1758 + datafile_path: manifests/pypi/bluepyopt_setup.py + datasource_id: pypi_setup_py + - purl: pkg:pypi/future + extracted_requirement: + scope: install + is_runtime: yes + is_optional: no + is_resolved: no + is_direct: yes + resolved_package: {} + extra_data: {} + dependency_uid: pkg:pypi/future?uuid=fixed-uid-done-for-testing-5642512d1758 + for_package_uid: pkg:pypi/bluepyopt?uuid=fixed-uid-done-for-testing-5642512d1758 + datafile_path: manifests/pypi/bluepyopt_setup.py + datasource_id: pypi_setup_py + - purl: pkg:pypi/pebble + extracted_requirement: '>=4.3.10' + scope: install + is_runtime: yes + is_optional: no + is_resolved: no + is_direct: yes + resolved_package: {} + extra_data: {} + dependency_uid: pkg:pypi/pebble?uuid=fixed-uid-done-for-testing-5642512d1758 + for_package_uid: pkg:pypi/bluepyopt?uuid=fixed-uid-done-for-testing-5642512d1758 + datafile_path: manifests/pypi/bluepyopt_setup.py + datasource_id: pypi_setup_py + - purl: pkg:pypi/scoop + extracted_requirement: '>=0.7' + scope: all + is_runtime: yes + is_optional: no + is_resolved: no + is_direct: yes + resolved_package: {} + extra_data: {} + dependency_uid: pkg:pypi/scoop?uuid=fixed-uid-done-for-testing-5642512d1758 + for_package_uid: pkg:pypi/bluepyopt?uuid=fixed-uid-done-for-testing-5642512d1758 + datafile_path: manifests/pypi/bluepyopt_setup.py + datasource_id: pypi_setup_py + - purl: pkg:pypi/scoop + extracted_requirement: '>=0.7' + scope: scoop + is_runtime: yes + is_optional: no + is_resolved: no + is_direct: yes + resolved_package: {} + extra_data: {} + dependency_uid: pkg:pypi/scoop?uuid=fixed-uid-done-for-testing-5642512d1758 + for_package_uid: pkg:pypi/bluepyopt?uuid=fixed-uid-done-for-testing-5642512d1758 + datafile_path: manifests/pypi/bluepyopt_setup.py + datasource_id: pypi_setup_py license_detections: - identifier: apache_2_0-d66ab77d-a5cc-7104-e702-dc7df61fe9e8 license_expression: apache-2.0 @@ -1518,6 +1755,31 @@ license_rule_references: You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + - license_expression: lgpl-3.0 + identifier: lgpl-3.0_29.RULE + language: en + rule_url: https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/rules/lgpl-3.0_29.RULE + is_license_text: no + is_license_notice: no + is_license_reference: yes + is_license_tag: no + is_license_intro: no + is_license_clue: no + is_continuous: no + is_builtin: yes + is_from_license: no + is_synthetic: no + length: 1 + relevance: 100 + minimum_coverage: 100 + referenced_filenames: [] + notes: + ignorable_copyrights: [] + ignorable_holders: [] + ignorable_authors: [] + ignorable_urls: [] + ignorable_emails: [] + text: LGPLv3 - license_expression: unknown-license-reference identifier: license-intro_72.RULE language: en @@ -2666,7 +2928,8 @@ files: api_data_url: https://pypi.org/pypi/bluepyopt/json datasource_id: pypi_setup_py purl: pkg:pypi/bluepyopt - for_packages: [] + for_packages: + - pkg:pypi/bluepyopt?uuid=fixed-uid-done-for-testing-5642512d1758 is_legal: no is_manifest: no is_readme: no diff --git a/tests/packagedcode/data/instance/python-package-instance-expected-with-test-manifests-with-license.json b/tests/packagedcode/data/instance/python-package-instance-expected-with-test-manifests-with-license.json index 03bc4b3ab26..a83bb482bb7 100644 --- a/tests/packagedcode/data/instance/python-package-instance-expected-with-test-manifests-with-license.json +++ b/tests/packagedcode/data/instance/python-package-instance-expected-with-test-manifests-with-license.json @@ -550,17 +550,6 @@ "is_virtual": false, "extra_data": {}, "dependencies": [ - { - "purl": "pkg:generic/python", - "extracted_requirement": "python_requires>=3.6", - "scope": "python", - "is_runtime": true, - "is_optional": false, - "is_resolved": false, - "is_direct": true, - "resolved_package": {}, - "extra_data": {} - }, { "purl": "pkg:pypi/pytest", "extracted_requirement": "pytest>=4.6", diff --git a/tests/packagedcode/data/instance/python-package-instance-expected-with-test-manifests.json b/tests/packagedcode/data/instance/python-package-instance-expected-with-test-manifests.json index 1881cade819..316cede7806 100644 --- a/tests/packagedcode/data/instance/python-package-instance-expected-with-test-manifests.json +++ b/tests/packagedcode/data/instance/python-package-instance-expected-with-test-manifests.json @@ -314,17 +314,6 @@ "is_virtual": false, "extra_data": {}, "dependencies": [ - { - "purl": "pkg:generic/python", - "extracted_requirement": "python_requires>=3.6", - "scope": "python", - "is_runtime": true, - "is_optional": false, - "is_resolved": false, - "is_direct": true, - "resolved_package": {}, - "extra_data": {} - }, { "purl": "pkg:pypi/pytest", "extracted_requirement": "pytest>=4.6", diff --git a/tests/packagedcode/data/instance/python-package-instance-expected-with-uuid.json b/tests/packagedcode/data/instance/python-package-instance-expected-with-uuid.json index 6b7c95f57c9..527a1d6ef17 100644 --- a/tests/packagedcode/data/instance/python-package-instance-expected-with-uuid.json +++ b/tests/packagedcode/data/instance/python-package-instance-expected-with-uuid.json @@ -81,21 +81,6 @@ } ], "dependencies": [ - { - "purl": "pkg:generic/python", - "extracted_requirement": "python_requires>= 3.7", - "scope": "python", - "is_runtime": true, - "is_optional": false, - "is_resolved": false, - "is_direct": true, - "resolved_package": {}, - "extra_data": {}, - "dependency_uid": "pkg:generic/python?uuid=fixed-uid-done-for-testing-5642512d1758", - "for_package_uid": "pkg:pypi/click@attr:%20click.__version__?uuid=fixed-uid-done-for-testing-5642512d1758", - "datafile_path": "setup.cfg", - "datasource_id": "pypi_setup_cfg" - }, { "purl": "pkg:pypi/colorama", "extracted_requirement": null, @@ -220,19 +205,7 @@ "is_private": false, "is_virtual": false, "extra_data": {}, - "dependencies": [ - { - "purl": "pkg:generic/python", - "extracted_requirement": "python_requires>= 3.7", - "scope": "python", - "is_runtime": true, - "is_optional": false, - "is_resolved": false, - "is_direct": true, - "resolved_package": {}, - "extra_data": {} - } - ], + "dependencies": [], "repository_homepage_url": null, "repository_download_url": null, "api_data_url": null, diff --git a/tests/packagedcode/data/instance/python-package-instance-expected.json b/tests/packagedcode/data/instance/python-package-instance-expected.json index 6b7c95f57c9..527a1d6ef17 100644 --- a/tests/packagedcode/data/instance/python-package-instance-expected.json +++ b/tests/packagedcode/data/instance/python-package-instance-expected.json @@ -81,21 +81,6 @@ } ], "dependencies": [ - { - "purl": "pkg:generic/python", - "extracted_requirement": "python_requires>= 3.7", - "scope": "python", - "is_runtime": true, - "is_optional": false, - "is_resolved": false, - "is_direct": true, - "resolved_package": {}, - "extra_data": {}, - "dependency_uid": "pkg:generic/python?uuid=fixed-uid-done-for-testing-5642512d1758", - "for_package_uid": "pkg:pypi/click@attr:%20click.__version__?uuid=fixed-uid-done-for-testing-5642512d1758", - "datafile_path": "setup.cfg", - "datasource_id": "pypi_setup_cfg" - }, { "purl": "pkg:pypi/colorama", "extracted_requirement": null, @@ -220,19 +205,7 @@ "is_private": false, "is_virtual": false, "extra_data": {}, - "dependencies": [ - { - "purl": "pkg:generic/python", - "extracted_requirement": "python_requires>= 3.7", - "scope": "python", - "is_runtime": true, - "is_optional": false, - "is_resolved": false, - "is_direct": true, - "resolved_package": {}, - "extra_data": {} - } - ], + "dependencies": [], "repository_homepage_url": null, "repository_download_url": null, "api_data_url": null, diff --git a/tests/packagedcode/data/instance/python-package-instance-with-license-expected.json b/tests/packagedcode/data/instance/python-package-instance-with-license-expected.json index 573c9c12da8..c7451cff7a4 100644 --- a/tests/packagedcode/data/instance/python-package-instance-with-license-expected.json +++ b/tests/packagedcode/data/instance/python-package-instance-with-license-expected.json @@ -98,21 +98,6 @@ } ], "dependencies": [ - { - "purl": "pkg:generic/python", - "extracted_requirement": "python_requires>= 3.7", - "scope": "python", - "is_runtime": true, - "is_optional": false, - "is_resolved": false, - "is_direct": true, - "resolved_package": {}, - "extra_data": {}, - "dependency_uid": "pkg:generic/python?uuid=fixed-uid-done-for-testing-5642512d1758", - "for_package_uid": "pkg:pypi/click@attr:%20click.__version__?uuid=fixed-uid-done-for-testing-5642512d1758", - "datafile_path": "setup.cfg", - "datasource_id": "pypi_setup_cfg" - }, { "purl": "pkg:pypi/colorama", "extracted_requirement": null, @@ -413,19 +398,7 @@ "is_private": false, "is_virtual": false, "extra_data": {}, - "dependencies": [ - { - "purl": "pkg:generic/python", - "extracted_requirement": "python_requires>= 3.7", - "scope": "python", - "is_runtime": true, - "is_optional": false, - "is_resolved": false, - "is_direct": true, - "resolved_package": {}, - "extra_data": {} - } - ], + "dependencies": [], "repository_homepage_url": null, "repository_download_url": null, "api_data_url": null, diff --git a/tests/packagedcode/data/pypi/setup.cfg/wheel-0.34.2/setup.cfg-expected.json b/tests/packagedcode/data/pypi/setup.cfg/wheel-0.34.2/setup.cfg-expected.json index 1e875274ff8..9e61c90ff70 100644 --- a/tests/packagedcode/data/pypi/setup.cfg/wheel-0.34.2/setup.cfg-expected.json +++ b/tests/packagedcode/data/pypi/setup.cfg/wheel-0.34.2/setup.cfg-expected.json @@ -79,17 +79,6 @@ "resolved_package": {}, "extra_data": {} }, - { - "purl": "pkg:generic/python", - "extracted_requirement": "python_requires>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*", - "scope": "python", - "is_runtime": true, - "is_optional": false, - "is_resolved": false, - "is_direct": true, - "resolved_package": {}, - "extra_data": {} - }, { "purl": "pkg:pypi/pytest", "extracted_requirement": "pytest>=3.0.0", diff --git a/tests/packagedcode/data/pypi/unpacked_sdist/prefer-egg-info-pkg-info/celery-expected.json b/tests/packagedcode/data/pypi/unpacked_sdist/prefer-egg-info-pkg-info/celery-expected.json index dcf38dcda11..66098a665ff 100644 --- a/tests/packagedcode/data/pypi/unpacked_sdist/prefer-egg-info-pkg-info/celery-expected.json +++ b/tests/packagedcode/data/pypi/unpacked_sdist/prefer-egg-info-pkg-info/celery-expected.json @@ -125,127 +125,215 @@ "dependencies": [ { "purl": "pkg:pypi/pytz", - "extracted_requirement": ">=2021.3", + "extracted_requirement": "pytz>=2021.3", "scope": "install", "is_runtime": true, "is_optional": false, "is_resolved": false, "is_direct": true, "resolved_package": {}, - "extra_data": {}, + "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 + }, "dependency_uid": "pkg:pypi/pytz?uuid=fixed-uid-done-for-testing-5642512d1758", "for_package_uid": "pkg:pypi/celery@5.2.7?uuid=fixed-uid-done-for-testing-5642512d1758", - "datafile_path": "celery/celery.egg-info/PKG-INFO", - "datasource_id": "pypi_editable_egg_pkginfo" + "datafile_path": "celery/celery.egg-info/requires.txt", + "datasource_id": "pip_requirements" }, { "purl": "pkg:pypi/billiard", - "extracted_requirement": "<4.0,>=3.6.4.0", + "extracted_requirement": "billiard>=3.6.4.0,<4.0", "scope": "install", "is_runtime": true, "is_optional": false, "is_resolved": false, "is_direct": true, "resolved_package": {}, - "extra_data": {}, + "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 + }, "dependency_uid": "pkg:pypi/billiard?uuid=fixed-uid-done-for-testing-5642512d1758", "for_package_uid": "pkg:pypi/celery@5.2.7?uuid=fixed-uid-done-for-testing-5642512d1758", - "datafile_path": "celery/celery.egg-info/PKG-INFO", - "datasource_id": "pypi_editable_egg_pkginfo" + "datafile_path": "celery/celery.egg-info/requires.txt", + "datasource_id": "pip_requirements" }, { "purl": "pkg:pypi/kombu", - "extracted_requirement": "<6.0,>=5.2.3", + "extracted_requirement": "kombu>=5.2.3,<6.0", "scope": "install", "is_runtime": true, "is_optional": false, "is_resolved": false, "is_direct": true, "resolved_package": {}, - "extra_data": {}, + "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 + }, "dependency_uid": "pkg:pypi/kombu?uuid=fixed-uid-done-for-testing-5642512d1758", "for_package_uid": "pkg:pypi/celery@5.2.7?uuid=fixed-uid-done-for-testing-5642512d1758", - "datafile_path": "celery/celery.egg-info/PKG-INFO", - "datasource_id": "pypi_editable_egg_pkginfo" + "datafile_path": "celery/celery.egg-info/requires.txt", + "datasource_id": "pip_requirements" }, { "purl": "pkg:pypi/vine", - "extracted_requirement": "<6.0,>=5.0.0", + "extracted_requirement": "vine>=5.0.0,<6.0", "scope": "install", "is_runtime": true, "is_optional": false, "is_resolved": false, "is_direct": true, "resolved_package": {}, - "extra_data": {}, + "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 + }, "dependency_uid": "pkg:pypi/vine?uuid=fixed-uid-done-for-testing-5642512d1758", "for_package_uid": "pkg:pypi/celery@5.2.7?uuid=fixed-uid-done-for-testing-5642512d1758", - "datafile_path": "celery/celery.egg-info/PKG-INFO", - "datasource_id": "pypi_editable_egg_pkginfo" + "datafile_path": "celery/celery.egg-info/requires.txt", + "datasource_id": "pip_requirements" }, { "purl": "pkg:pypi/click", - "extracted_requirement": "<9.0,>=8.0.3", + "extracted_requirement": "click>=8.0.3,<9.0", "scope": "install", "is_runtime": true, "is_optional": false, "is_resolved": false, "is_direct": true, "resolved_package": {}, - "extra_data": {}, + "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 + }, "dependency_uid": "pkg:pypi/click?uuid=fixed-uid-done-for-testing-5642512d1758", "for_package_uid": "pkg:pypi/celery@5.2.7?uuid=fixed-uid-done-for-testing-5642512d1758", - "datafile_path": "celery/celery.egg-info/PKG-INFO", - "datasource_id": "pypi_editable_egg_pkginfo" + "datafile_path": "celery/celery.egg-info/requires.txt", + "datasource_id": "pip_requirements" }, { "purl": "pkg:pypi/click-didyoumean", - "extracted_requirement": ">=0.0.3", + "extracted_requirement": "click-didyoumean>=0.0.3", "scope": "install", "is_runtime": true, "is_optional": false, "is_resolved": false, "is_direct": true, "resolved_package": {}, - "extra_data": {}, + "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 + }, "dependency_uid": "pkg:pypi/click-didyoumean?uuid=fixed-uid-done-for-testing-5642512d1758", "for_package_uid": "pkg:pypi/celery@5.2.7?uuid=fixed-uid-done-for-testing-5642512d1758", - "datafile_path": "celery/celery.egg-info/PKG-INFO", - "datasource_id": "pypi_editable_egg_pkginfo" + "datafile_path": "celery/celery.egg-info/requires.txt", + "datasource_id": "pip_requirements" }, { "purl": "pkg:pypi/click-repl", - "extracted_requirement": ">=0.2.0", + "extracted_requirement": "click-repl>=0.2.0", "scope": "install", "is_runtime": true, "is_optional": false, "is_resolved": false, "is_direct": true, "resolved_package": {}, - "extra_data": {}, + "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 + }, "dependency_uid": "pkg:pypi/click-repl?uuid=fixed-uid-done-for-testing-5642512d1758", "for_package_uid": "pkg:pypi/celery@5.2.7?uuid=fixed-uid-done-for-testing-5642512d1758", - "datafile_path": "celery/celery.egg-info/PKG-INFO", - "datasource_id": "pypi_editable_egg_pkginfo" + "datafile_path": "celery/celery.egg-info/requires.txt", + "datasource_id": "pip_requirements" }, { "purl": "pkg:pypi/click-plugins", - "extracted_requirement": ">=1.1.1", + "extracted_requirement": "click-plugins>=1.1.1", "scope": "install", "is_runtime": true, "is_optional": false, "is_resolved": false, "is_direct": true, "resolved_package": {}, - "extra_data": {}, + "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 + }, "dependency_uid": "pkg:pypi/click-plugins?uuid=fixed-uid-done-for-testing-5642512d1758", "for_package_uid": "pkg:pypi/celery@5.2.7?uuid=fixed-uid-done-for-testing-5642512d1758", - "datafile_path": "celery/celery.egg-info/PKG-INFO", - "datasource_id": "pypi_editable_egg_pkginfo" + "datafile_path": "celery/celery.egg-info/requires.txt", + "datasource_id": "pip_requirements" }, { "purl": "pkg:pypi/importlib-metadata", - "extracted_requirement": ">=1.4.0", + "extracted_requirement": "importlib-metadata>=1.4.0", "scope": "install", "is_runtime": true, "is_optional": false, @@ -253,507 +341,879 @@ "is_direct": true, "resolved_package": {}, "extra_data": { - "python_version": "< 3.8" + "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 }, "dependency_uid": "pkg:pypi/importlib-metadata?uuid=fixed-uid-done-for-testing-5642512d1758", "for_package_uid": "pkg:pypi/celery@5.2.7?uuid=fixed-uid-done-for-testing-5642512d1758", - "datafile_path": "celery/celery.egg-info/PKG-INFO", - "datasource_id": "pypi_editable_egg_pkginfo" + "datafile_path": "celery/celery.egg-info/requires.txt", + "datasource_id": "pip_requirements" }, { "purl": "pkg:pypi/pyarango", - "extracted_requirement": ">=1.3.2", - "scope": "arangodb", + "extracted_requirement": "pyArango>=1.3.2", + "scope": "install", "is_runtime": true, - "is_optional": true, + "is_optional": false, "is_resolved": false, "is_direct": true, "resolved_package": {}, - "extra_data": {}, + "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 + }, "dependency_uid": "pkg:pypi/pyarango?uuid=fixed-uid-done-for-testing-5642512d1758", "for_package_uid": "pkg:pypi/celery@5.2.7?uuid=fixed-uid-done-for-testing-5642512d1758", - "datafile_path": "celery/celery.egg-info/PKG-INFO", - "datasource_id": "pypi_editable_egg_pkginfo" + "datafile_path": "celery/celery.egg-info/requires.txt", + "datasource_id": "pip_requirements" }, { "purl": "pkg:pypi/cryptography", - "extracted_requirement": null, - "scope": "auth", + "extracted_requirement": "cryptography", + "scope": "install", "is_runtime": true, - "is_optional": true, + "is_optional": false, "is_resolved": false, "is_direct": true, "resolved_package": {}, - "extra_data": {}, + "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 + }, "dependency_uid": "pkg:pypi/cryptography?uuid=fixed-uid-done-for-testing-5642512d1758", "for_package_uid": "pkg:pypi/celery@5.2.7?uuid=fixed-uid-done-for-testing-5642512d1758", - "datafile_path": "celery/celery.egg-info/PKG-INFO", - "datasource_id": "pypi_editable_egg_pkginfo" + "datafile_path": "celery/celery.egg-info/requires.txt", + "datasource_id": "pip_requirements" }, { "purl": "pkg:pypi/azure-storage-blob@12.9.0", - "extracted_requirement": "==12.9.0", - "scope": "azureblockblob", + "extracted_requirement": "azure-storage-blob==12.9.0", + "scope": "install", "is_runtime": true, - "is_optional": true, + "is_optional": false, "is_resolved": true, "is_direct": true, "resolved_package": {}, - "extra_data": {}, + "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 + }, "dependency_uid": "pkg:pypi/azure-storage-blob@12.9.0?uuid=fixed-uid-done-for-testing-5642512d1758", "for_package_uid": "pkg:pypi/celery@5.2.7?uuid=fixed-uid-done-for-testing-5642512d1758", - "datafile_path": "celery/celery.egg-info/PKG-INFO", - "datasource_id": "pypi_editable_egg_pkginfo" + "datafile_path": "celery/celery.egg-info/requires.txt", + "datasource_id": "pip_requirements" }, { "purl": "pkg:pypi/brotli", - "extracted_requirement": ">=1.0.0", - "scope": "brotli", + "extracted_requirement": "brotli>=1.0.0", + "scope": "install", "is_runtime": true, - "is_optional": true, + "is_optional": false, "is_resolved": false, "is_direct": true, "resolved_package": {}, - "extra_data": {}, + "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 + }, "dependency_uid": "pkg:pypi/brotli?uuid=fixed-uid-done-for-testing-5642512d1758", "for_package_uid": "pkg:pypi/celery@5.2.7?uuid=fixed-uid-done-for-testing-5642512d1758", - "datafile_path": "celery/celery.egg-info/PKG-INFO", - "datasource_id": "pypi_editable_egg_pkginfo" + "datafile_path": "celery/celery.egg-info/requires.txt", + "datasource_id": "pip_requirements" }, { "purl": "pkg:pypi/brotlipy", - "extracted_requirement": ">=0.7.0", - "scope": "brotli", + "extracted_requirement": "brotlipy>=0.7.0", + "scope": "install", "is_runtime": true, - "is_optional": true, + "is_optional": false, "is_resolved": false, "is_direct": true, "resolved_package": {}, - "extra_data": {}, + "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 + }, "dependency_uid": "pkg:pypi/brotlipy?uuid=fixed-uid-done-for-testing-5642512d1758", "for_package_uid": "pkg:pypi/celery@5.2.7?uuid=fixed-uid-done-for-testing-5642512d1758", - "datafile_path": "celery/celery.egg-info/PKG-INFO", - "datasource_id": "pypi_editable_egg_pkginfo" + "datafile_path": "celery/celery.egg-info/requires.txt", + "datasource_id": "pip_requirements" }, { "purl": "pkg:pypi/cassandra-driver", - "extracted_requirement": "<3.21.0", - "scope": "cassandra", + "extracted_requirement": "cassandra-driver<3.21.0", + "scope": "install", "is_runtime": true, - "is_optional": true, + "is_optional": false, "is_resolved": false, "is_direct": true, "resolved_package": {}, - "extra_data": {}, + "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 + }, "dependency_uid": "pkg:pypi/cassandra-driver?uuid=fixed-uid-done-for-testing-5642512d1758", "for_package_uid": "pkg:pypi/celery@5.2.7?uuid=fixed-uid-done-for-testing-5642512d1758", - "datafile_path": "celery/celery.egg-info/PKG-INFO", - "datasource_id": "pypi_editable_egg_pkginfo" + "datafile_path": "celery/celery.egg-info/requires.txt", + "datasource_id": "pip_requirements" }, { "purl": "pkg:pypi/python-consul2", - "extracted_requirement": null, - "scope": "consul", + "extracted_requirement": "python-consul2", + "scope": "install", "is_runtime": true, - "is_optional": true, + "is_optional": false, "is_resolved": false, "is_direct": true, "resolved_package": {}, - "extra_data": {}, + "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 + }, "dependency_uid": "pkg:pypi/python-consul2?uuid=fixed-uid-done-for-testing-5642512d1758", "for_package_uid": "pkg:pypi/celery@5.2.7?uuid=fixed-uid-done-for-testing-5642512d1758", - "datafile_path": "celery/celery.egg-info/PKG-INFO", - "datasource_id": "pypi_editable_egg_pkginfo" + "datafile_path": "celery/celery.egg-info/requires.txt", + "datasource_id": "pip_requirements" }, { "purl": "pkg:pypi/pydocumentdb@2.3.2", - "extracted_requirement": "==2.3.2", - "scope": "cosmosdbsql", + "extracted_requirement": "pydocumentdb==2.3.2", + "scope": "install", "is_runtime": true, - "is_optional": true, + "is_optional": false, "is_resolved": true, "is_direct": true, "resolved_package": {}, - "extra_data": {}, + "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 + }, "dependency_uid": "pkg:pypi/pydocumentdb@2.3.2?uuid=fixed-uid-done-for-testing-5642512d1758", "for_package_uid": "pkg:pypi/celery@5.2.7?uuid=fixed-uid-done-for-testing-5642512d1758", - "datafile_path": "celery/celery.egg-info/PKG-INFO", - "datasource_id": "pypi_editable_egg_pkginfo" + "datafile_path": "celery/celery.egg-info/requires.txt", + "datasource_id": "pip_requirements" }, { "purl": "pkg:pypi/couchbase", - "extracted_requirement": ">=3.0.0", - "scope": "couchbase", + "extracted_requirement": "couchbase>=3.0.0", + "scope": "install", "is_runtime": true, - "is_optional": true, + "is_optional": false, "is_resolved": false, "is_direct": true, "resolved_package": {}, - "extra_data": {}, + "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 + }, "dependency_uid": "pkg:pypi/couchbase?uuid=fixed-uid-done-for-testing-5642512d1758", "for_package_uid": "pkg:pypi/celery@5.2.7?uuid=fixed-uid-done-for-testing-5642512d1758", - "datafile_path": "celery/celery.egg-info/PKG-INFO", - "datasource_id": "pypi_editable_egg_pkginfo" + "datafile_path": "celery/celery.egg-info/requires.txt", + "datasource_id": "pip_requirements" }, { "purl": "pkg:pypi/pycouchdb", - "extracted_requirement": null, - "scope": "couchdb", + "extracted_requirement": "pycouchdb", + "scope": "install", "is_runtime": true, - "is_optional": true, + "is_optional": false, "is_resolved": false, "is_direct": true, "resolved_package": {}, - "extra_data": {}, + "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 + }, "dependency_uid": "pkg:pypi/pycouchdb?uuid=fixed-uid-done-for-testing-5642512d1758", "for_package_uid": "pkg:pypi/celery@5.2.7?uuid=fixed-uid-done-for-testing-5642512d1758", - "datafile_path": "celery/celery.egg-info/PKG-INFO", - "datasource_id": "pypi_editable_egg_pkginfo" + "datafile_path": "celery/celery.egg-info/requires.txt", + "datasource_id": "pip_requirements" }, { "purl": "pkg:pypi/django", - "extracted_requirement": ">=1.11", - "scope": "django", + "extracted_requirement": "Django>=1.11", + "scope": "install", "is_runtime": true, - "is_optional": true, + "is_optional": false, "is_resolved": false, "is_direct": true, "resolved_package": {}, - "extra_data": {}, + "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 + }, "dependency_uid": "pkg:pypi/django?uuid=fixed-uid-done-for-testing-5642512d1758", "for_package_uid": "pkg:pypi/celery@5.2.7?uuid=fixed-uid-done-for-testing-5642512d1758", - "datafile_path": "celery/celery.egg-info/PKG-INFO", - "datasource_id": "pypi_editable_egg_pkginfo" + "datafile_path": "celery/celery.egg-info/requires.txt", + "datasource_id": "pip_requirements" }, { "purl": "pkg:pypi/boto3", - "extracted_requirement": ">=1.9.178", - "scope": "dynamodb", + "extracted_requirement": "boto3>=1.9.178", + "scope": "install", "is_runtime": true, - "is_optional": true, + "is_optional": false, "is_resolved": false, "is_direct": true, "resolved_package": {}, - "extra_data": {}, + "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 + }, "dependency_uid": "pkg:pypi/boto3?uuid=fixed-uid-done-for-testing-5642512d1758", "for_package_uid": "pkg:pypi/celery@5.2.7?uuid=fixed-uid-done-for-testing-5642512d1758", - "datafile_path": "celery/celery.egg-info/PKG-INFO", - "datasource_id": "pypi_editable_egg_pkginfo" + "datafile_path": "celery/celery.egg-info/requires.txt", + "datasource_id": "pip_requirements" }, { "purl": "pkg:pypi/elasticsearch", - "extracted_requirement": null, - "scope": "elasticsearch", + "extracted_requirement": "elasticsearch", + "scope": "install", "is_runtime": true, - "is_optional": true, + "is_optional": false, "is_resolved": false, "is_direct": true, "resolved_package": {}, - "extra_data": {}, + "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 + }, "dependency_uid": "pkg:pypi/elasticsearch?uuid=fixed-uid-done-for-testing-5642512d1758", "for_package_uid": "pkg:pypi/celery@5.2.7?uuid=fixed-uid-done-for-testing-5642512d1758", - "datafile_path": "celery/celery.egg-info/PKG-INFO", - "datasource_id": "pypi_editable_egg_pkginfo" + "datafile_path": "celery/celery.egg-info/requires.txt", + "datasource_id": "pip_requirements" }, { "purl": "pkg:pypi/eventlet", - "extracted_requirement": ">=0.32.0", - "scope": "eventlet", + "extracted_requirement": "eventlet>=0.32.0", + "scope": "install", "is_runtime": true, - "is_optional": true, + "is_optional": false, "is_resolved": false, "is_direct": true, "resolved_package": {}, - "extra_data": {}, + "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 + }, "dependency_uid": "pkg:pypi/eventlet?uuid=fixed-uid-done-for-testing-5642512d1758", "for_package_uid": "pkg:pypi/celery@5.2.7?uuid=fixed-uid-done-for-testing-5642512d1758", - "datafile_path": "celery/celery.egg-info/PKG-INFO", - "datasource_id": "pypi_editable_egg_pkginfo" + "datafile_path": "celery/celery.egg-info/requires.txt", + "datasource_id": "pip_requirements" }, { "purl": "pkg:pypi/gevent", - "extracted_requirement": ">=1.5.0", - "scope": "gevent", + "extracted_requirement": "gevent>=1.5.0", + "scope": "install", "is_runtime": true, - "is_optional": true, + "is_optional": false, "is_resolved": false, "is_direct": true, "resolved_package": {}, - "extra_data": {}, + "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 + }, "dependency_uid": "pkg:pypi/gevent?uuid=fixed-uid-done-for-testing-5642512d1758", "for_package_uid": "pkg:pypi/celery@5.2.7?uuid=fixed-uid-done-for-testing-5642512d1758", - "datafile_path": "celery/celery.egg-info/PKG-INFO", - "datasource_id": "pypi_editable_egg_pkginfo" + "datafile_path": "celery/celery.egg-info/requires.txt", + "datasource_id": "pip_requirements" }, { "purl": "pkg:pypi/librabbitmq", - "extracted_requirement": ">=1.5.0", - "scope": "librabbitmq", + "extracted_requirement": "librabbitmq>=1.5.0", + "scope": "install", "is_runtime": true, - "is_optional": true, + "is_optional": false, "is_resolved": false, "is_direct": true, "resolved_package": {}, - "extra_data": {}, + "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 + }, "dependency_uid": "pkg:pypi/librabbitmq?uuid=fixed-uid-done-for-testing-5642512d1758", "for_package_uid": "pkg:pypi/celery@5.2.7?uuid=fixed-uid-done-for-testing-5642512d1758", - "datafile_path": "celery/celery.egg-info/PKG-INFO", - "datasource_id": "pypi_editable_egg_pkginfo" + "datafile_path": "celery/celery.egg-info/requires.txt", + "datasource_id": "pip_requirements" }, { "purl": "pkg:pypi/pylibmc", - "extracted_requirement": null, - "scope": "memcache", + "extracted_requirement": "pylibmc", + "scope": "install", "is_runtime": true, - "is_optional": true, + "is_optional": false, "is_resolved": false, "is_direct": true, "resolved_package": {}, - "extra_data": {}, + "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 + }, "dependency_uid": "pkg:pypi/pylibmc?uuid=fixed-uid-done-for-testing-5642512d1758", "for_package_uid": "pkg:pypi/celery@5.2.7?uuid=fixed-uid-done-for-testing-5642512d1758", - "datafile_path": "celery/celery.egg-info/PKG-INFO", - "datasource_id": "pypi_editable_egg_pkginfo" + "datafile_path": "celery/celery.egg-info/requires.txt", + "datasource_id": "pip_requirements" }, { "purl": "pkg:pypi/pymongo", - "extracted_requirement": ">=3.11.1", - "scope": "mongodb", + "extracted_requirement": "pymongo[srv]>=3.11.1", + "scope": "install", "is_runtime": true, - "is_optional": true, + "is_optional": false, "is_resolved": false, "is_direct": true, "resolved_package": {}, - "extra_data": {}, + "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 + }, "dependency_uid": "pkg:pypi/pymongo?uuid=fixed-uid-done-for-testing-5642512d1758", "for_package_uid": "pkg:pypi/celery@5.2.7?uuid=fixed-uid-done-for-testing-5642512d1758", - "datafile_path": "celery/celery.egg-info/PKG-INFO", - "datasource_id": "pypi_editable_egg_pkginfo" + "datafile_path": "celery/celery.egg-info/requires.txt", + "datasource_id": "pip_requirements" }, { "purl": "pkg:pypi/msgpack", - "extracted_requirement": null, - "scope": "msgpack", + "extracted_requirement": "msgpack", + "scope": "install", "is_runtime": true, - "is_optional": true, + "is_optional": false, "is_resolved": false, "is_direct": true, "resolved_package": {}, - "extra_data": {}, + "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 + }, "dependency_uid": "pkg:pypi/msgpack?uuid=fixed-uid-done-for-testing-5642512d1758", "for_package_uid": "pkg:pypi/celery@5.2.7?uuid=fixed-uid-done-for-testing-5642512d1758", - "datafile_path": "celery/celery.egg-info/PKG-INFO", - "datasource_id": "pypi_editable_egg_pkginfo" + "datafile_path": "celery/celery.egg-info/requires.txt", + "datasource_id": "pip_requirements" }, { "purl": "pkg:pypi/python-memcached", - "extracted_requirement": null, - "scope": "pymemcache", + "extracted_requirement": "python-memcached", + "scope": "install", "is_runtime": true, - "is_optional": true, + "is_optional": false, "is_resolved": false, "is_direct": true, "resolved_package": {}, - "extra_data": {}, + "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 + }, "dependency_uid": "pkg:pypi/python-memcached?uuid=fixed-uid-done-for-testing-5642512d1758", "for_package_uid": "pkg:pypi/celery@5.2.7?uuid=fixed-uid-done-for-testing-5642512d1758", - "datafile_path": "celery/celery.egg-info/PKG-INFO", - "datasource_id": "pypi_editable_egg_pkginfo" + "datafile_path": "celery/celery.egg-info/requires.txt", + "datasource_id": "pip_requirements" }, { "purl": "pkg:pypi/pyro4", - "extracted_requirement": null, - "scope": "pyro", + "extracted_requirement": "pyro4", + "scope": "install", "is_runtime": true, - "is_optional": true, + "is_optional": false, "is_resolved": false, "is_direct": true, "resolved_package": {}, - "extra_data": {}, + "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 + }, "dependency_uid": "pkg:pypi/pyro4?uuid=fixed-uid-done-for-testing-5642512d1758", "for_package_uid": "pkg:pypi/celery@5.2.7?uuid=fixed-uid-done-for-testing-5642512d1758", - "datafile_path": "celery/celery.egg-info/PKG-INFO", - "datasource_id": "pypi_editable_egg_pkginfo" + "datafile_path": "celery/celery.egg-info/requires.txt", + "datasource_id": "pip_requirements" }, { "purl": "pkg:pypi/pytest-celery", - "extracted_requirement": null, - "scope": "pytest", + "extracted_requirement": "pytest-celery", + "scope": "install", "is_runtime": true, - "is_optional": true, + "is_optional": false, "is_resolved": false, "is_direct": true, "resolved_package": {}, - "extra_data": {}, + "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 + }, "dependency_uid": "pkg:pypi/pytest-celery?uuid=fixed-uid-done-for-testing-5642512d1758", "for_package_uid": "pkg:pypi/celery@5.2.7?uuid=fixed-uid-done-for-testing-5642512d1758", - "datafile_path": "celery/celery.egg-info/PKG-INFO", - "datasource_id": "pypi_editable_egg_pkginfo" + "datafile_path": "celery/celery.egg-info/requires.txt", + "datasource_id": "pip_requirements" }, { "purl": "pkg:pypi/redis", - "extracted_requirement": "!=4.0.0,!=4.0.1,>=3.4.1", - "scope": "redis", + "extracted_requirement": "redis>=3.4.1,!=4.0.0,!=4.0.1", + "scope": "install", "is_runtime": true, - "is_optional": true, + "is_optional": false, "is_resolved": false, "is_direct": true, "resolved_package": {}, - "extra_data": {}, + "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 + }, "dependency_uid": "pkg:pypi/redis?uuid=fixed-uid-done-for-testing-5642512d1758", "for_package_uid": "pkg:pypi/celery@5.2.7?uuid=fixed-uid-done-for-testing-5642512d1758", - "datafile_path": "celery/celery.egg-info/PKG-INFO", - "datasource_id": "pypi_editable_egg_pkginfo" + "datafile_path": "celery/celery.egg-info/requires.txt", + "datasource_id": "pip_requirements" }, { "purl": "pkg:pypi/boto3", - "extracted_requirement": ">=1.9.125", - "scope": "s3", + "extracted_requirement": "boto3>=1.9.125", + "scope": "install", "is_runtime": true, - "is_optional": true, + "is_optional": false, "is_resolved": false, "is_direct": true, "resolved_package": {}, - "extra_data": {}, + "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 + }, "dependency_uid": "pkg:pypi/boto3?uuid=fixed-uid-done-for-testing-5642512d1758", "for_package_uid": "pkg:pypi/celery@5.2.7?uuid=fixed-uid-done-for-testing-5642512d1758", - "datafile_path": "celery/celery.egg-info/PKG-INFO", - "datasource_id": "pypi_editable_egg_pkginfo" + "datafile_path": "celery/celery.egg-info/requires.txt", + "datasource_id": "pip_requirements" }, { "purl": "pkg:pypi/softlayer-messaging", - "extracted_requirement": ">=1.0.3", - "scope": "slmq", + "extracted_requirement": "softlayer_messaging>=1.0.3", + "scope": "install", "is_runtime": true, - "is_optional": true, + "is_optional": false, "is_resolved": false, "is_direct": true, "resolved_package": {}, - "extra_data": {}, + "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 + }, "dependency_uid": "pkg:pypi/softlayer-messaging?uuid=fixed-uid-done-for-testing-5642512d1758", "for_package_uid": "pkg:pypi/celery@5.2.7?uuid=fixed-uid-done-for-testing-5642512d1758", - "datafile_path": "celery/celery.egg-info/PKG-INFO", - "datasource_id": "pypi_editable_egg_pkginfo" + "datafile_path": "celery/celery.egg-info/requires.txt", + "datasource_id": "pip_requirements" }, { "purl": "pkg:pypi/ephem", - "extracted_requirement": null, - "scope": "solar", + "extracted_requirement": "ephem", + "scope": "install", "is_runtime": true, - "is_optional": true, + "is_optional": false, "is_resolved": false, "is_direct": true, "resolved_package": {}, - "extra_data": {}, + "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 + }, "dependency_uid": "pkg:pypi/ephem?uuid=fixed-uid-done-for-testing-5642512d1758", "for_package_uid": "pkg:pypi/celery@5.2.7?uuid=fixed-uid-done-for-testing-5642512d1758", - "datafile_path": "celery/celery.egg-info/PKG-INFO", - "datasource_id": "pypi_editable_egg_pkginfo" + "datafile_path": "celery/celery.egg-info/requires.txt", + "datasource_id": "pip_requirements" }, { "purl": "pkg:pypi/sqlalchemy", - "extracted_requirement": null, - "scope": "sqlalchemy", + "extracted_requirement": "sqlalchemy", + "scope": "install", "is_runtime": true, - "is_optional": true, + "is_optional": false, "is_resolved": false, "is_direct": true, "resolved_package": {}, - "extra_data": {}, + "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 + }, "dependency_uid": "pkg:pypi/sqlalchemy?uuid=fixed-uid-done-for-testing-5642512d1758", "for_package_uid": "pkg:pypi/celery@5.2.7?uuid=fixed-uid-done-for-testing-5642512d1758", - "datafile_path": "celery/celery.egg-info/PKG-INFO", - "datasource_id": "pypi_editable_egg_pkginfo" + "datafile_path": "celery/celery.egg-info/requires.txt", + "datasource_id": "pip_requirements" }, { "purl": "pkg:pypi/kombu", - "extracted_requirement": null, - "scope": "sqs", + "extracted_requirement": "kombu[sqs]", + "scope": "install", "is_runtime": true, - "is_optional": true, + "is_optional": false, "is_resolved": false, "is_direct": true, "resolved_package": {}, - "extra_data": {}, + "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 + }, "dependency_uid": "pkg:pypi/kombu?uuid=fixed-uid-done-for-testing-5642512d1758", "for_package_uid": "pkg:pypi/celery@5.2.7?uuid=fixed-uid-done-for-testing-5642512d1758", - "datafile_path": "celery/celery.egg-info/PKG-INFO", - "datasource_id": "pypi_editable_egg_pkginfo" + "datafile_path": "celery/celery.egg-info/requires.txt", + "datasource_id": "pip_requirements" }, { "purl": "pkg:pypi/tblib", - "extracted_requirement": ">=1.3.0", - "scope": "tblib", + "extracted_requirement": "tblib>=1.3.0", + "scope": "install", "is_runtime": true, - "is_optional": true, + "is_optional": false, "is_resolved": false, "is_direct": true, "resolved_package": {}, - "extra_data": {}, + "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 + }, "dependency_uid": "pkg:pypi/tblib?uuid=fixed-uid-done-for-testing-5642512d1758", "for_package_uid": "pkg:pypi/celery@5.2.7?uuid=fixed-uid-done-for-testing-5642512d1758", - "datafile_path": "celery/celery.egg-info/PKG-INFO", - "datasource_id": "pypi_editable_egg_pkginfo" + "datafile_path": "celery/celery.egg-info/requires.txt", + "datasource_id": "pip_requirements" }, { "purl": "pkg:pypi/tblib", - "extracted_requirement": ">=1.5.0", - "scope": "tblib", + "extracted_requirement": "tblib>=1.5.0", + "scope": "install", "is_runtime": true, - "is_optional": true, + "is_optional": false, "is_resolved": false, "is_direct": true, "resolved_package": {}, - "extra_data": {}, + "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 + }, "dependency_uid": "pkg:pypi/tblib?uuid=fixed-uid-done-for-testing-5642512d1758", "for_package_uid": "pkg:pypi/celery@5.2.7?uuid=fixed-uid-done-for-testing-5642512d1758", - "datafile_path": "celery/celery.egg-info/PKG-INFO", - "datasource_id": "pypi_editable_egg_pkginfo" + "datafile_path": "celery/celery.egg-info/requires.txt", + "datasource_id": "pip_requirements" }, { "purl": "pkg:pypi/pyyaml", - "extracted_requirement": ">=3.10", - "scope": "yaml", + "extracted_requirement": "PyYAML>=3.10", + "scope": "install", "is_runtime": true, - "is_optional": true, + "is_optional": false, "is_resolved": false, "is_direct": true, "resolved_package": {}, - "extra_data": {}, + "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 + }, "dependency_uid": "pkg:pypi/pyyaml?uuid=fixed-uid-done-for-testing-5642512d1758", "for_package_uid": "pkg:pypi/celery@5.2.7?uuid=fixed-uid-done-for-testing-5642512d1758", - "datafile_path": "celery/celery.egg-info/PKG-INFO", - "datasource_id": "pypi_editable_egg_pkginfo" + "datafile_path": "celery/celery.egg-info/requires.txt", + "datasource_id": "pip_requirements" }, { "purl": "pkg:pypi/kazoo", - "extracted_requirement": ">=1.3.1", - "scope": "zookeeper", + "extracted_requirement": "kazoo>=1.3.1", + "scope": "install", "is_runtime": true, - "is_optional": true, + "is_optional": false, "is_resolved": false, "is_direct": true, "resolved_package": {}, - "extra_data": {}, + "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 + }, "dependency_uid": "pkg:pypi/kazoo?uuid=fixed-uid-done-for-testing-5642512d1758", "for_package_uid": "pkg:pypi/celery@5.2.7?uuid=fixed-uid-done-for-testing-5642512d1758", - "datafile_path": "celery/celery.egg-info/PKG-INFO", - "datasource_id": "pypi_editable_egg_pkginfo" + "datafile_path": "celery/celery.egg-info/requires.txt", + "datasource_id": "pip_requirements" }, { "purl": "pkg:pypi/zstandard", - "extracted_requirement": null, - "scope": "zstd", + "extracted_requirement": "zstandard", + "scope": "install", "is_runtime": true, - "is_optional": true, + "is_optional": false, "is_resolved": false, "is_direct": true, "resolved_package": {}, - "extra_data": {}, + "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 + }, "dependency_uid": "pkg:pypi/zstandard?uuid=fixed-uid-done-for-testing-5642512d1758", "for_package_uid": "pkg:pypi/celery@5.2.7?uuid=fixed-uid-done-for-testing-5642512d1758", - "datafile_path": "celery/celery.egg-info/PKG-INFO", - "datasource_id": "pypi_editable_egg_pkginfo" + "datafile_path": "celery/celery.egg-info/requires.txt", + "datasource_id": "pip_requirements" } ], "files": [ diff --git a/tests/packagedcode/test_pypi.py b/tests/packagedcode/test_pypi.py index 7164214dd95..37bd2043275 100644 --- a/tests/packagedcode/test_pypi.py +++ b/tests/packagedcode/test_pypi.py @@ -296,7 +296,7 @@ def test_parse_metadata_prefer_pkg_info_from_egg_info_from_command_line(self): # `celery/celery.egg-info/PKG-INFO` vc = VirtualCodebase(location=result_file) for dep in vc.attributes.dependencies: - assert dep['datafile_path'] == 'celery/celery.egg-info/PKG-INFO' + assert dep['datafile_path'] == 'celery/celery.egg-info/requires.txt' for pkg in vc.attributes.packages: for path in pkg['datafile_paths']: assert path == 'celery/celery.egg-info/PKG-INFO' diff --git a/tests/summarycode/data/summary/embedded_packages/bunkerweb.expected.json b/tests/summarycode/data/summary/embedded_packages/bunkerweb.expected.json new file mode 100644 index 00000000000..66801f6ebe5 --- /dev/null +++ b/tests/summarycode/data/summary/embedded_packages/bunkerweb.expected.json @@ -0,0 +1,890 @@ +{ + "summary": { + "declared_license_expression": "mit", + "license_clarity_score": { + "score": 100, + "declared_license": true, + "identification_precision": true, + "has_license_text": true, + "declared_copyrights": true, + "conflicting_license_categories": false, + "ambiguous_compound_licensing": false + }, + "declared_holder": "Nick Galbreath", + "primary_language": "Python", + "other_license_expressions": [ + { + "value": "bsd-new", + "count": 3 + }, + { + "value": null, + "count": 1 + } + ], + "other_holders": [ + { + "value": null, + "count": 1 + } + ], + "other_languages": [] + }, + "packages": [ + { + "type": "pypi", + "namespace": null, + "name": "BunkerWeb", + "version": "1.5.8", + "qualifiers": {}, + "subpath": null, + "primary_language": "Python", + "description": "Make your web services secure by default !", + "release_date": null, + "parties": [ + { + "type": "person", + "role": "author", + "name": "Bunkerity", + "email": "contact@bunkerity.com", + "url": null + } + ], + "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": "mit", + "declared_license_expression_spdx": "MIT", + "license_detections": [ + { + "license_expression": "mit", + "license_expression_spdx": "MIT", + "matches": [ + { + "license_expression": "mit", + "spdx_license_expression": "MIT", + "from_file": "bunkerweb/LICENSE.md", + "start_line": 4, + "end_line": 21, + "matcher": "2-aho", + "score": 100.0, + "matched_length": 161, + "match_coverage": 100.0, + "rule_relevance": 100, + "rule_identifier": "mit.LICENSE", + "rule_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/licenses/mit.LICENSE" + } + ], + "identifier": "mit-cacd5c0c-204a-85c2-affc-e4c125b2492a" + } + ], + "other_license_expression": null, + "other_license_expression_spdx": null, + "other_license_detections": [], + "extracted_license_statement": null, + "notice_text": null, + "source_packages": [], + "is_private": false, + "is_virtual": false, + "extra_data": {}, + "repository_homepage_url": "https://pypi.org/project/BunkerWeb", + "repository_download_url": "https://pypi.org/packages/source/B/BunkerWeb/BunkerWeb-1.5.8.tar.gz", + "api_data_url": "https://pypi.org/pypi/BunkerWeb/1.5.8/json", + "package_uid": "pkg:pypi/bunkerweb@1.5.8?uuid=fixed-uid-done-for-testing-5642512d1758", + "datafile_paths": [ + "bunkerweb/pyproject.toml" + ], + "datasource_ids": [ + "pypi_pyproject_toml" + ], + "purl": "pkg:pypi/bunkerweb@1.5.8" + } + ], + "dependencies": [], + "license_detections": [ + { + "identifier": "bsd_new-f4e99f86-00ab-18d9-a65d-a3a12767dcf5", + "license_expression": "bsd-new", + "license_expression_spdx": "BSD-3-Clause", + "detection_count": 2, + "reference_matches": [ + { + "license_expression": "bsd-new", + "license_expression_spdx": "BSD-3-Clause", + "from_file": "bunkerweb/deps/libinjection/setup.py", + "start_line": 41, + "end_line": 41, + "matcher": "2-aho", + "score": 99.0, + "matched_length": 5, + "match_coverage": 100.0, + "rule_relevance": 99, + "rule_identifier": "pypi_bsd_license.RULE", + "rule_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/rules/pypi_bsd_license.RULE" + } + ] + }, + { + "identifier": "bsd_new-90c8b089-2f85-4a93-d0c8-a411247c6395", + "license_expression": "bsd-new", + "license_expression_spdx": "BSD-3-Clause", + "detection_count": 1, + "reference_matches": [ + { + "license_expression": "bsd-new", + "license_expression_spdx": "BSD-3-Clause", + "from_file": "bunkerweb/deps/libinjection/setup.py", + "start_line": 6, + "end_line": 6, + "matcher": "2-aho", + "score": 99.0, + "matched_length": 2, + "match_coverage": 100.0, + "rule_relevance": 99, + "rule_identifier": "bsd-new_26.RULE", + "rule_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/rules/bsd-new_26.RULE" + }, + { + "license_expression": "unknown-license-reference", + "license_expression_spdx": "LicenseRef-scancode-unknown-license-reference", + "from_file": "bunkerweb/deps/libinjection/setup.py", + "start_line": 6, + "end_line": 6, + "matcher": "2-aho", + "score": 100.0, + "matched_length": 3, + "match_coverage": 100.0, + "rule_relevance": 100, + "rule_identifier": "unknown-license-reference_98.RULE", + "rule_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/rules/unknown-license-reference_98.RULE" + }, + { + "license_expression": "bsd-new", + "license_expression_spdx": "BSD-3-Clause", + "from_file": "bunkerweb/deps/libinjection/COPYING.txt", + "start_line": 4, + "end_line": 29, + "matcher": "2-aho", + "score": 100.0, + "matched_length": 216, + "match_coverage": 100.0, + "rule_relevance": 100, + "rule_identifier": "bsd-new_105.RULE", + "rule_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/rules/bsd-new_105.RULE" + }, + { + "license_expression": "bsd-new", + "license_expression_spdx": "BSD-3-Clause", + "from_file": "bunkerweb/deps/libinjection/COPYING.txt", + "start_line": 32, + "end_line": 32, + "matcher": "2-aho", + "score": 100.0, + "matched_length": 7, + "match_coverage": 100.0, + "rule_relevance": 100, + "rule_identifier": "bsd-new_226.RULE", + "rule_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/rules/bsd-new_226.RULE" + } + ] + }, + { + "identifier": "bsd_new-99f77058-447d-ca1d-7b17-8e92d1a664e4", + "license_expression": "bsd-new", + "license_expression_spdx": "BSD-3-Clause", + "detection_count": 1, + "reference_matches": [ + { + "license_expression": "bsd-new", + "license_expression_spdx": "BSD-3-Clause", + "from_file": "bunkerweb/deps/libinjection/COPYING.txt", + "start_line": 4, + "end_line": 29, + "matcher": "2-aho", + "score": 100.0, + "matched_length": 216, + "match_coverage": 100.0, + "rule_relevance": 100, + "rule_identifier": "bsd-new_105.RULE", + "rule_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/rules/bsd-new_105.RULE" + }, + { + "license_expression": "bsd-new", + "license_expression_spdx": "BSD-3-Clause", + "from_file": "bunkerweb/deps/libinjection/COPYING.txt", + "start_line": 32, + "end_line": 32, + "matcher": "2-aho", + "score": 100.0, + "matched_length": 7, + "match_coverage": 100.0, + "rule_relevance": 100, + "rule_identifier": "bsd-new_226.RULE", + "rule_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/rules/bsd-new_226.RULE" + } + ] + }, + { + "identifier": "mit-cacd5c0c-204a-85c2-affc-e4c125b2492a", + "license_expression": "mit", + "license_expression_spdx": "MIT", + "detection_count": 2, + "reference_matches": [ + { + "license_expression": "mit", + "license_expression_spdx": "MIT", + "from_file": "bunkerweb/LICENSE.md", + "start_line": 4, + "end_line": 21, + "matcher": "2-aho", + "score": 100.0, + "matched_length": 161, + "match_coverage": 100.0, + "rule_relevance": 100, + "rule_identifier": "mit.LICENSE", + "rule_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/licenses/mit.LICENSE" + } + ] + } + ], + "files": [ + { + "path": "bunkerweb", + "type": "directory", + "name": "bunkerweb", + "base_name": "bunkerweb", + "extension": "", + "size": 0, + "sha1": null, + "md5": null, + "sha256": null, + "mime_type": null, + "file_type": null, + "programming_language": null, + "is_binary": false, + "is_text": false, + "is_archive": false, + "is_media": false, + "is_source": false, + "is_script": false, + "package_data": [], + "for_packages": [], + "is_legal": false, + "is_manifest": false, + "is_readme": false, + "is_top_level": true, + "is_key_file": false, + "detected_license_expression": null, + "detected_license_expression_spdx": null, + "license_detections": [], + "license_clues": [], + "percentage_of_license_text": 0, + "copyrights": [], + "holders": [], + "authors": [], + "files_count": 4, + "dirs_count": 2, + "size_count": 4405, + "scan_errors": [] + }, + { + "path": "bunkerweb/LICENSE.md", + "type": "file", + "name": "LICENSE.md", + "base_name": "LICENSE", + "extension": ".md", + "size": 1084, + "sha1": "242b333ee88b352d41d2aafe9994a9f77de370f1", + "md5": "caa29ac8cda378ef687072b0b1c8c0e4", + "sha256": "9a5ef97962dd0750ed94f1ee3aa029136aa2a06586026b179730a777f50c8702", + "mime_type": "text/plain", + "file_type": "ASCII text", + "programming_language": null, + "is_binary": false, + "is_text": true, + "is_archive": false, + "is_media": false, + "is_source": false, + "is_script": false, + "package_data": [], + "for_packages": [ + "pkg:pypi/bunkerweb@1.5.8?uuid=fixed-uid-done-for-testing-5642512d1758" + ], + "is_legal": true, + "is_manifest": false, + "is_readme": false, + "is_top_level": true, + "is_key_file": true, + "detected_license_expression": "mit", + "detected_license_expression_spdx": "MIT", + "license_detections": [ + { + "license_expression": "mit", + "license_expression_spdx": "MIT", + "matches": [ + { + "license_expression": "mit", + "spdx_license_expression": "MIT", + "from_file": "bunkerweb/LICENSE.md", + "start_line": 4, + "end_line": 21, + "matcher": "2-aho", + "score": 100.0, + "matched_length": 161, + "match_coverage": 100.0, + "rule_relevance": 100, + "rule_identifier": "mit.LICENSE", + "rule_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/licenses/mit.LICENSE" + } + ], + "identifier": "mit-cacd5c0c-204a-85c2-affc-e4c125b2492a" + } + ], + "license_clues": [], + "percentage_of_license_text": 94.71, + "copyrights": [ + { + "copyright": "Copyright (c) 2012-2016, Nick Galbreath", + "start_line": 1, + "end_line": 1 + } + ], + "holders": [ + { + "holder": "Nick Galbreath", + "start_line": 1, + "end_line": 1 + } + ], + "authors": [], + "files_count": 0, + "dirs_count": 0, + "size_count": 0, + "scan_errors": [] + }, + { + "path": "bunkerweb/deps", + "type": "directory", + "name": "deps", + "base_name": "deps", + "extension": "", + "size": 0, + "sha1": null, + "md5": null, + "sha256": null, + "mime_type": null, + "file_type": null, + "programming_language": null, + "is_binary": false, + "is_text": false, + "is_archive": false, + "is_media": false, + "is_source": false, + "is_script": false, + "package_data": [], + "for_packages": [], + "is_legal": false, + "is_manifest": false, + "is_readme": false, + "is_top_level": true, + "is_key_file": false, + "detected_license_expression": null, + "detected_license_expression_spdx": null, + "license_detections": [], + "license_clues": [], + "percentage_of_license_text": 0, + "copyrights": [], + "holders": [], + "authors": [], + "files_count": 2, + "dirs_count": 1, + "size_count": 2998, + "scan_errors": [] + }, + { + "path": "bunkerweb/deps/libinjection", + "type": "directory", + "name": "libinjection", + "base_name": "libinjection", + "extension": "", + "size": 0, + "sha1": null, + "md5": null, + "sha256": null, + "mime_type": null, + "file_type": null, + "programming_language": null, + "is_binary": false, + "is_text": false, + "is_archive": false, + "is_media": false, + "is_source": false, + "is_script": false, + "package_data": [], + "for_packages": [], + "is_legal": false, + "is_manifest": false, + "is_readme": false, + "is_top_level": false, + "is_key_file": false, + "detected_license_expression": null, + "detected_license_expression_spdx": null, + "license_detections": [], + "license_clues": [], + "percentage_of_license_text": 0, + "copyrights": [], + "holders": [], + "authors": [], + "files_count": 2, + "dirs_count": 0, + "size_count": 2998, + "scan_errors": [] + }, + { + "path": "bunkerweb/deps/libinjection/COPYING.txt", + "type": "file", + "name": "COPYING.txt", + "base_name": "COPYING", + "extension": ".txt", + "size": 1574, + "sha1": "16eb1fced5e1f443e68b3ff36f3328ac8f31d893", + "md5": "2493d74f84f74417cd51943cb1141a42", + "sha256": "88ef2e3f1383c20ad745a60edbce61fe510eda64e6b09a0e833c3660c9386810", + "mime_type": "text/plain", + "file_type": "ASCII text", + "programming_language": null, + "is_binary": false, + "is_text": true, + "is_archive": false, + "is_media": false, + "is_source": false, + "is_script": false, + "package_data": [], + "for_packages": [ + "pkg:pypi/bunkerweb@1.5.8?uuid=fixed-uid-done-for-testing-5642512d1758" + ], + "is_legal": true, + "is_manifest": false, + "is_readme": false, + "is_top_level": false, + "is_key_file": false, + "detected_license_expression": "bsd-new", + "detected_license_expression_spdx": "BSD-3-Clause", + "license_detections": [ + { + "license_expression": "bsd-new", + "license_expression_spdx": "BSD-3-Clause", + "matches": [ + { + "license_expression": "bsd-new", + "spdx_license_expression": "BSD-3-Clause", + "from_file": "bunkerweb/deps/libinjection/COPYING.txt", + "start_line": 4, + "end_line": 29, + "matcher": "2-aho", + "score": 100.0, + "matched_length": 216, + "match_coverage": 100.0, + "rule_relevance": 100, + "rule_identifier": "bsd-new_105.RULE", + "rule_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/rules/bsd-new_105.RULE" + }, + { + "license_expression": "bsd-new", + "spdx_license_expression": "BSD-3-Clause", + "from_file": "bunkerweb/deps/libinjection/COPYING.txt", + "start_line": 32, + "end_line": 32, + "matcher": "2-aho", + "score": 100.0, + "matched_length": 7, + "match_coverage": 100.0, + "rule_relevance": 100, + "rule_identifier": "bsd-new_226.RULE", + "rule_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/rules/bsd-new_226.RULE" + } + ], + "identifier": "bsd_new-99f77058-447d-ca1d-7b17-8e92d1a664e4" + } + ], + "license_clues": [], + "percentage_of_license_text": 94.09, + "copyrights": [ + { + "copyright": "Copyright (c) 2012-2016, Nick Galbreath", + "start_line": 1, + "end_line": 1 + } + ], + "holders": [ + { + "holder": "Nick Galbreath", + "start_line": 1, + "end_line": 1 + } + ], + "authors": [], + "files_count": 0, + "dirs_count": 0, + "size_count": 0, + "scan_errors": [] + }, + { + "path": "bunkerweb/deps/libinjection/setup.py", + "type": "file", + "name": "setup.py", + "base_name": "setup", + "extension": ".py", + "size": 1424, + "sha1": "a56c141912506e2eb94bfa164687131ff21fb298", + "md5": "ea7cba7d908eaa03a5b49b245b8119ef", + "sha256": "d61b7ebe3ebdb52e4e1ffe8ae28313ea7560ab619f9f0b211f6cd988d849f907", + "mime_type": "text/plain", + "file_type": "Python script, ASCII text executable", + "programming_language": "Python", + "is_binary": false, + "is_text": true, + "is_archive": false, + "is_media": false, + "is_source": true, + "is_script": true, + "package_data": [ + { + "type": "pypi", + "namespace": null, + "name": "libinjection", + "version": "3.9.1", + "qualifiers": {}, + "subpath": null, + "primary_language": "Python", + "description": "Wrapper around libinjection c-code to detect sqli", + "release_date": null, + "parties": [ + { + "type": "person", + "role": "author", + "name": "Nick Galbreath", + "email": "nickg@client9.com", + "url": null + } + ], + "keywords": [ + "Intended Audience :: Developers", + "Topic :: Database", + "Topic :: Security", + "Operating System :: OS Independent", + "Development Status :: 3 - Alpha", + "Topic :: Internet :: Log Analysis", + "Topic :: Internet :: WWW/HTTP" + ], + "homepage_url": "https://libinjection.client9.com/", + "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": "bsd-new", + "declared_license_expression_spdx": "BSD-3-Clause", + "license_detections": [ + { + "license_expression": "bsd-new", + "license_expression_spdx": "BSD-3-Clause", + "matches": [ + { + "license_expression": "bsd-new", + "spdx_license_expression": "BSD-3-Clause", + "from_file": "bunkerweb/deps/libinjection/setup.py", + "start_line": 1, + "end_line": 1, + "matcher": "1-hash", + "score": 99.0, + "matched_length": 5, + "match_coverage": 100.0, + "rule_relevance": 99, + "rule_identifier": "pypi_bsd_license.RULE", + "rule_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/rules/pypi_bsd_license.RULE", + "matched_text": "- 'License :: OSI Approved :: BSD License'" + } + ], + "identifier": "bsd_new-f4e99f86-00ab-18d9-a65d-a3a12767dcf5" + } + ], + "other_license_expression": null, + "other_license_expression_spdx": null, + "other_license_detections": [], + "extracted_license_statement": "classifiers:\n - 'License :: OSI Approved :: BSD License'\n", + "notice_text": null, + "source_packages": [], + "file_references": [], + "is_private": false, + "is_virtual": false, + "extra_data": {}, + "dependencies": [], + "repository_homepage_url": "https://pypi.org/project/libinjection", + "repository_download_url": "https://pypi.org/packages/source/l/libinjection/libinjection-3.9.1.tar.gz", + "api_data_url": "https://pypi.org/pypi/libinjection/3.9.1/json", + "datasource_id": "pypi_setup_py", + "purl": "pkg:pypi/libinjection@3.9.1" + } + ], + "for_packages": [ + "pkg:pypi/bunkerweb@1.5.8?uuid=fixed-uid-done-for-testing-5642512d1758" + ], + "is_legal": false, + "is_manifest": false, + "is_readme": false, + "is_top_level": false, + "is_key_file": false, + "detected_license_expression": "bsd-new", + "detected_license_expression_spdx": "BSD-3-Clause", + "license_detections": [ + { + "license_expression": "bsd-new", + "license_expression_spdx": "BSD-3-Clause", + "matches": [ + { + "license_expression": "bsd-new", + "spdx_license_expression": "BSD-3-Clause", + "from_file": "bunkerweb/deps/libinjection/setup.py", + "start_line": 6, + "end_line": 6, + "matcher": "2-aho", + "score": 99.0, + "matched_length": 2, + "match_coverage": 100.0, + "rule_relevance": 99, + "rule_identifier": "bsd-new_26.RULE", + "rule_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/rules/bsd-new_26.RULE" + }, + { + "license_expression": "unknown-license-reference", + "spdx_license_expression": "LicenseRef-scancode-unknown-license-reference", + "from_file": "bunkerweb/deps/libinjection/setup.py", + "start_line": 6, + "end_line": 6, + "matcher": "2-aho", + "score": 100.0, + "matched_length": 3, + "match_coverage": 100.0, + "rule_relevance": 100, + "rule_identifier": "unknown-license-reference_98.RULE", + "rule_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/rules/unknown-license-reference_98.RULE" + }, + { + "license_expression": "bsd-new", + "spdx_license_expression": "BSD-3-Clause", + "from_file": "bunkerweb/deps/libinjection/COPYING.txt", + "start_line": 4, + "end_line": 29, + "matcher": "2-aho", + "score": 100.0, + "matched_length": 216, + "match_coverage": 100.0, + "rule_relevance": 100, + "rule_identifier": "bsd-new_105.RULE", + "rule_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/rules/bsd-new_105.RULE" + }, + { + "license_expression": "bsd-new", + "spdx_license_expression": "BSD-3-Clause", + "from_file": "bunkerweb/deps/libinjection/COPYING.txt", + "start_line": 32, + "end_line": 32, + "matcher": "2-aho", + "score": 100.0, + "matched_length": 7, + "match_coverage": 100.0, + "rule_relevance": 100, + "rule_identifier": "bsd-new_226.RULE", + "rule_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/rules/bsd-new_226.RULE" + } + ], + "identifier": "bsd_new-90c8b089-2f85-4a93-d0c8-a411247c6395", + "detection_log": [ + "unknown-reference-to-local-file" + ] + }, + { + "license_expression": "bsd-new", + "license_expression_spdx": "BSD-3-Clause", + "matches": [ + { + "license_expression": "bsd-new", + "spdx_license_expression": "BSD-3-Clause", + "from_file": "bunkerweb/deps/libinjection/setup.py", + "start_line": 41, + "end_line": 41, + "matcher": "2-aho", + "score": 99.0, + "matched_length": 5, + "match_coverage": 100.0, + "rule_relevance": 99, + "rule_identifier": "pypi_bsd_license.RULE", + "rule_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/rules/pypi_bsd_license.RULE" + } + ], + "identifier": "bsd_new-f4e99f86-00ab-18d9-a65d-a3a12767dcf5" + } + ], + "license_clues": [], + "percentage_of_license_text": 7.58, + "copyrights": [ + { + "copyright": "Copyright 2012, 2013, 2014 Nick Galbreath nickg@client9.com", + "start_line": 4, + "end_line": 5 + } + ], + "holders": [ + { + "holder": "Nick Galbreath", + "start_line": 4, + "end_line": 4 + } + ], + "authors": [ + { + "author": "Nick Galbreath", + "start_line": 31, + "end_line": 31 + } + ], + "files_count": 0, + "dirs_count": 0, + "size_count": 0, + "scan_errors": [] + }, + { + "path": "bunkerweb/pyproject.toml", + "type": "file", + "name": "pyproject.toml", + "base_name": "pyproject", + "extension": ".toml", + "size": 323, + "sha1": "e97ff042e27bc5be29abf6483ea57c3abfbfba83", + "md5": "bef2744dd896358a9e799e90cb890883", + "sha256": "2e71a200631f19ee4ebaf8a3c0efe859aa3eeef35adba95268282147ad7b8253", + "mime_type": "text/plain", + "file_type": "ASCII text", + "programming_language": null, + "is_binary": false, + "is_text": true, + "is_archive": false, + "is_media": false, + "is_source": false, + "is_script": false, + "package_data": [ + { + "type": "pypi", + "namespace": null, + "name": "BunkerWeb", + "version": "1.5.8", + "qualifiers": {}, + "subpath": null, + "primary_language": "Python", + "description": "Make your web services secure by default !", + "release_date": null, + "parties": [ + { + "type": "person", + "role": "author", + "name": "Bunkerity", + "email": "contact@bunkerity.com", + "url": null + } + ], + "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": "mit", + "declared_license_expression_spdx": "MIT", + "license_detections": [ + { + "license_expression": "mit", + "license_expression_spdx": "MIT", + "matches": [ + { + "license_expression": "mit", + "spdx_license_expression": "MIT", + "from_file": "bunkerweb/LICENSE.md", + "start_line": 4, + "end_line": 21, + "matcher": "2-aho", + "score": 100.0, + "matched_length": 161, + "match_coverage": 100.0, + "rule_relevance": 100, + "rule_identifier": "mit.LICENSE", + "rule_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/licenses/mit.LICENSE" + } + ], + "identifier": "mit-cacd5c0c-204a-85c2-affc-e4c125b2492a" + } + ], + "other_license_expression": null, + "other_license_expression_spdx": null, + "other_license_detections": [], + "extracted_license_statement": null, + "notice_text": null, + "source_packages": [], + "file_references": [], + "is_private": false, + "is_virtual": false, + "extra_data": {}, + "dependencies": [], + "repository_homepage_url": "https://pypi.org/project/BunkerWeb", + "repository_download_url": "https://pypi.org/packages/source/B/BunkerWeb/BunkerWeb-1.5.8.tar.gz", + "api_data_url": "https://pypi.org/pypi/BunkerWeb/1.5.8/json", + "datasource_id": "pypi_pyproject_toml", + "purl": "pkg:pypi/bunkerweb@1.5.8" + } + ], + "for_packages": [ + "pkg:pypi/bunkerweb@1.5.8?uuid=fixed-uid-done-for-testing-5642512d1758" + ], + "is_legal": false, + "is_manifest": false, + "is_readme": false, + "is_top_level": false, + "is_key_file": false, + "detected_license_expression": null, + "detected_license_expression_spdx": null, + "license_detections": [], + "license_clues": [], + "percentage_of_license_text": 0, + "copyrights": [], + "holders": [], + "authors": [], + "files_count": 0, + "dirs_count": 0, + "size_count": 0, + "scan_errors": [] + } + ] +} \ No newline at end of file diff --git a/tests/summarycode/data/summary/embedded_packages/bunkerweb/LICENSE.md b/tests/summarycode/data/summary/embedded_packages/bunkerweb/LICENSE.md new file mode 100644 index 00000000000..8d45d9625d3 --- /dev/null +++ b/tests/summarycode/data/summary/embedded_packages/bunkerweb/LICENSE.md @@ -0,0 +1,21 @@ +Copyright (c) 2012-2016, Nick Galbreath +All rights reserved. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/tests/summarycode/data/summary/embedded_packages/bunkerweb/deps/libinjection/COPYING.txt b/tests/summarycode/data/summary/embedded_packages/bunkerweb/deps/libinjection/COPYING.txt new file mode 100644 index 00000000000..35edb2a6aed --- /dev/null +++ b/tests/summarycode/data/summary/embedded_packages/bunkerweb/deps/libinjection/COPYING.txt @@ -0,0 +1,32 @@ +Copyright (c) 2012-2016, Nick Galbreath +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + +1. Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. + +3. Neither the name of the copyright holder nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +https://github.com/client9/libinjection +http://opensource.org/licenses/BSD-3-Clause \ No newline at end of file diff --git a/tests/summarycode/data/summary/embedded_packages/bunkerweb/deps/libinjection/setup.py b/tests/summarycode/data/summary/embedded_packages/bunkerweb/deps/libinjection/setup.py new file mode 100644 index 00000000000..10a8f54333e --- /dev/null +++ b/tests/summarycode/data/summary/embedded_packages/bunkerweb/deps/libinjection/setup.py @@ -0,0 +1,49 @@ +""" +libinjection module for python + + Copyright 2012, 2013, 2014 Nick Galbreath + nickg@client9.com + BSD License -- see COPYING.txt for details +""" +try: + from setuptools import setup, Extension +except ImportError: + from distutils.core import setup, Extension + +MODULE = Extension( + '_libinjection', [ + 'libinjection/libinjection_wrap.c', + 'libinjection/libinjection_sqli.c', + 'libinjection/libinjection_html5.c', + 'libinjection/libinjection_xss.c' + ], + swig_opts=['-Wextra', '-builtin'], + define_macros = [], + include_dirs = [], + libraries = [], + library_dirs = [], + ) + +setup ( + name = 'libinjection', + version = '3.9.1', + description = 'Wrapper around libinjection c-code to detect sqli', + author = 'Nick Galbreath', + author_email = 'nickg@client9.com', + url = 'https://libinjection.client9.com/', + ext_modules = [MODULE], + packages = ['libinjection'], + long_description = ''' +wrapper around libinjection +''', + classifiers = [ + 'Intended Audience :: Developers', + 'License :: OSI Approved :: BSD License', + 'Topic :: Database', + 'Topic :: Security', + 'Operating System :: OS Independent', + 'Development Status :: 3 - Alpha', + 'Topic :: Internet :: Log Analysis', + 'Topic :: Internet :: WWW/HTTP' + ] + ) \ No newline at end of file diff --git a/tests/summarycode/data/summary/embedded_packages/bunkerweb/pyproject.toml b/tests/summarycode/data/summary/embedded_packages/bunkerweb/pyproject.toml new file mode 100644 index 00000000000..6a2fa300d5a --- /dev/null +++ b/tests/summarycode/data/summary/embedded_packages/bunkerweb/pyproject.toml @@ -0,0 +1,19 @@ +[project] +name = "BunkerWeb" +description = "Make your web services secure by default !" +version = "1.5.8" +authors = [ + { name = "Bunkerity", email = "contact@bunkerity.com" } +] + +[tool.black] +line-length = 160 +include = '\.pyi?$' +exclude = ''' +/( + | \.git + | src/deps/src + | src/common/core/modsecurity + | env +)/ +''' diff --git a/tests/summarycode/data/todo/todo_present/incomplete-setup-cfg-expected.json b/tests/summarycode/data/todo/todo_present/incomplete-setup-cfg-expected.json index 2a9073e967a..41aa25c6f43 100644 --- a/tests/summarycode/data/todo/todo_present/incomplete-setup-cfg-expected.json +++ b/tests/summarycode/data/todo/todo_present/incomplete-setup-cfg-expected.json @@ -44,19 +44,7 @@ "is_private": false, "is_virtual": false, "extra_data": {}, - "dependencies": [ - { - "purl": "pkg:generic/python", - "extracted_requirement": "python_requires>=3.7", - "scope": "python", - "is_runtime": true, - "is_optional": false, - "is_resolved": false, - "is_direct": true, - "resolved_package": {}, - "extra_data": {} - } - ], + "dependencies": [], "repository_homepage_url": null, "repository_download_url": null, "api_data_url": null, @@ -107,19 +95,7 @@ "is_private": false, "is_virtual": false, "extra_data": {}, - "dependencies": [ - { - "purl": "pkg:generic/python", - "extracted_requirement": "python_requires>=3.7", - "scope": "python", - "is_runtime": true, - "is_optional": false, - "is_resolved": false, - "is_direct": true, - "resolved_package": {}, - "extra_data": {} - } - ], + "dependencies": [], "repository_homepage_url": null, "repository_download_url": null, "api_data_url": null, diff --git a/tests/summarycode/test_summarizer.py b/tests/summarycode/test_summarizer.py index 4be0380906c..0e695c79845 100644 --- a/tests/summarycode/test_summarizer.py +++ b/tests/summarycode/test_summarizer.py @@ -124,6 +124,18 @@ def test_summary_multiple_package_data(self): ]) check_json_scan(expected_file, result_file, remove_uuid=True, remove_file_date=True, regen=REGEN_TEST_FIXTURES) + def test_summary_root_package_with_embedded_packages(self): + test_dir = self.get_test_loc('summary/embedded_packages/bunkerweb') + result_file = self.get_temp_file('json') + expected_file = self.get_test_loc('summary/embedded_packages/bunkerweb.expected.json') + run_scan_click([ + '-clip', + '--summary', + '--classify', + '--json-pp', result_file, test_dir + ]) + check_json_scan(expected_file, result_file, remove_uuid=True, remove_file_date=True, regen=REGEN_TEST_FIXTURES) + def test_summary_use_holder_from_package_resource(self): test_dir = self.get_test_loc('summary/use_holder_from_package_resource/codebase') result_file = self.get_temp_file('json')