From 5b31186aba7fbd3c08cc33a92616facafeff916e Mon Sep 17 00:00:00 2001 From: anuragpandey1rkt-cmyk Date: Fri, 20 Feb 2026 23:06:14 +0530 Subject: [PATCH 1/4] Add handler for PEP-751 pylock.toml Signed-off-by: anuragpandey1rkt-cmyk --- src/packagedcode/__init__.py | 1 + src/packagedcode/pypi.py | 96 ++++++++ .../packagedcode/data/pypi/pylock/pylock.toml | 22 ++ .../pypi/pylock/pylock.toml-expected.json | 0 .../data/pypi/pylock/pylock.toml.expected | 224 ++++++++++++++++++ tests/packagedcode/test_pypi.py | 10 + 6 files changed, 353 insertions(+) create mode 100644 tests/packagedcode/data/pypi/pylock/pylock.toml create mode 100644 tests/packagedcode/data/pypi/pylock/pylock.toml-expected.json create mode 100644 tests/packagedcode/data/pypi/pylock/pylock.toml.expected diff --git a/src/packagedcode/__init__.py b/src/packagedcode/__init__.py index d3c48b6e259..66de54ae33f 100644 --- a/src/packagedcode/__init__.py +++ b/src/packagedcode/__init__.py @@ -172,6 +172,7 @@ # pypi.PypiSdistArchiveHandler, pypi.PypiWheelHandler, pypi.PyprojectTomlHandler, + pypi.PylockTomlHandler, pypi.PoetryPyprojectTomlHandler, pypi.PoetryLockHandler, pypi.PythonEditableInstallationPkgInfoFile, diff --git a/src/packagedcode/pypi.py b/src/packagedcode/pypi.py index b5588ed7ca9..c259c0452ac 100644 --- a/src/packagedcode/pypi.py +++ b/src/packagedcode/pypi.py @@ -597,6 +597,102 @@ def assemble(cls, package_data, resource, codebase, package_adder): yield lock_file +class PylockTomlHandler(models.DatafileHandler): + datasource_id = 'pypi_pylock_toml' + path_patterns = ('*pylock.toml',) + default_package_type = 'pypi' + default_primary_language = 'Python' + description = 'Python pylock.toml' + documentation_url = 'https://peps.python.org/pep-0751/' + + @classmethod + def parse(cls, location, package_only=False): + yield cls.build_package(location, package_only=package_only) + + @classmethod + def build_package(cls, location, package_only=False): + import tomllib + from packageurl import PackageURL + + with open(location, 'rb') as fp: + try: + lock_data = tomllib.load(fp) + except Exception as e: + logger_debug(f'PylockTomlHandler.parse: Error parsing TOML: {e}') + return None + + packages = lock_data.get('packages', []) + dependencies = [] + + for pkg in packages: + name = pkg.get('name') + version = pkg.get('version') + + deps = pkg.get('dependencies', []) + dependencies_for_resolved = [] + for dep in deps: + dep_name = dep.get('name') + if not dep_name: + continue + dep_purl = PackageURL( + type=cls.default_package_type, + name=dep_name, + ) + dependent_pkg = models.DependentPackage( + purl=dep_purl.to_string(), + scope='dependencies', + is_runtime=True, + is_optional=False, + is_direct=True, + is_pinned=False, + ) + dependencies_for_resolved.append(dependent_pkg.to_dict()) + + pkg_purl = PackageURL( + type=cls.default_package_type, + name=name, + version=version, + ) + + package_data = dict( + datasource_id=cls.datasource_id, + type=cls.default_package_type, + primary_language='Python', + name=name, + version=version, + is_virtual=True, + dependencies=dependencies_for_resolved, + ) + resolved_package = models.PackageData.from_data(package_data, package_only) + + dependency = models.DependentPackage( + purl=resolved_package.purl, + extracted_requirement=None, # In theory, pylock doesn't directly specify version specs in dependencies, they map directly to resolved names + scope='dependencies', + is_runtime=True, + is_optional=False, + is_direct=False, + is_pinned=True, # It is a locked package + resolved_package=resolved_package.to_dict(), + ) + dependencies.append(dependency.to_dict()) + + extra_data = {} + if lock_data.get('lock-version'): + extra_data['lock_version'] = lock_data.get('lock-version') + if lock_data.get('requires-python'): + extra_data['requires_python'] = lock_data.get('requires-python') + + env_package_data = dict( + datasource_id=cls.datasource_id, + type=cls.default_package_type, + primary_language=cls.default_primary_language, + name='pylock-environment', + dependencies=dependencies, + extra_data=extra_data, + ) + return models.PackageData.from_data(env_package_data, package_only) + class PoetryPyprojectTomlHandler(BasePoetryPythonLayout): datasource_id = 'pypi_poetry_pyproject_toml' path_patterns = ('*pyproject.toml',) diff --git a/tests/packagedcode/data/pypi/pylock/pylock.toml b/tests/packagedcode/data/pypi/pylock/pylock.toml new file mode 100644 index 00000000000..720524051d3 --- /dev/null +++ b/tests/packagedcode/data/pypi/pylock/pylock.toml @@ -0,0 +1,22 @@ +lock-version = '1.0' +environments = ["sys_platform == 'win32'", "sys_platform == 'linux'"] +requires-python = '==3.12' +created-by = 'mousebender' + +[[packages]] +name = 'attrs' +version = '25.1.0' +requires-python = '>=3.8' + +[[packages]] +name = 'cattrs' +version = '24.1.2' +requires-python = '>=3.8' +dependencies = [ + {name = 'attrs'}, +] + +[[packages]] +name = 'numpy' +version = '2.2.3' +requires-python = '>=3.10' diff --git a/tests/packagedcode/data/pypi/pylock/pylock.toml-expected.json b/tests/packagedcode/data/pypi/pylock/pylock.toml-expected.json new file mode 100644 index 00000000000..e69de29bb2d diff --git a/tests/packagedcode/data/pypi/pylock/pylock.toml.expected b/tests/packagedcode/data/pypi/pylock/pylock.toml.expected new file mode 100644 index 00000000000..02deff05f13 --- /dev/null +++ b/tests/packagedcode/data/pypi/pylock/pylock.toml.expected @@ -0,0 +1,224 @@ +[ + { + "type": "pypi", + "namespace": null, + "name": "pylock-environment", + "version": null, + "qualifiers": {}, + "subpath": null, + "primary_language": "Python", + "description": null, + "release_date": null, + "parties": [], + "keywords": [], + "homepage_url": null, + "download_url": null, + "size": null, + "sha1": null, + "md5": null, + "sha256": null, + "sha512": null, + "bug_tracking_url": null, + "code_view_url": null, + "vcs_url": null, + "copyright": null, + "holder": null, + "declared_license_expression": null, + "declared_license_expression_spdx": null, + "license_detections": [], + "other_license_expression": null, + "other_license_expression_spdx": null, + "other_license_detections": [], + "extracted_license_statement": null, + "notice_text": null, + "source_packages": [], + "file_references": [], + "is_private": false, + "is_virtual": false, + "extra_data": { + "lock_version": "1.0", + "requires_python": "==3.12" + }, + "dependencies": [ + { + "purl": "pkg:pypi/attrs@25.1.0", + "extracted_requirement": null, + "scope": "dependencies", + "is_runtime": true, + "is_optional": false, + "is_pinned": true, + "is_direct": false, + "resolved_package": { + "type": "pypi", + "namespace": null, + "name": "attrs", + "version": "25.1.0", + "qualifiers": {}, + "subpath": null, + "primary_language": "Python", + "description": null, + "release_date": null, + "parties": [], + "keywords": [], + "homepage_url": null, + "download_url": null, + "size": null, + "sha1": null, + "md5": null, + "sha256": null, + "sha512": null, + "bug_tracking_url": null, + "code_view_url": null, + "vcs_url": null, + "copyright": null, + "holder": null, + "declared_license_expression": null, + "declared_license_expression_spdx": null, + "license_detections": [], + "other_license_expression": null, + "other_license_expression_spdx": null, + "other_license_detections": [], + "extracted_license_statement": null, + "notice_text": null, + "source_packages": [], + "file_references": [], + "is_private": false, + "is_virtual": true, + "extra_data": {}, + "dependencies": [], + "repository_homepage_url": null, + "repository_download_url": null, + "api_data_url": null, + "datasource_id": "pypi_pylock_toml", + "purl": "pkg:pypi/attrs@25.1.0" + }, + "extra_data": {} + }, + { + "purl": "pkg:pypi/cattrs@24.1.2", + "extracted_requirement": null, + "scope": "dependencies", + "is_runtime": true, + "is_optional": false, + "is_pinned": true, + "is_direct": false, + "resolved_package": { + "type": "pypi", + "namespace": null, + "name": "cattrs", + "version": "24.1.2", + "qualifiers": {}, + "subpath": null, + "primary_language": "Python", + "description": null, + "release_date": null, + "parties": [], + "keywords": [], + "homepage_url": null, + "download_url": null, + "size": null, + "sha1": null, + "md5": null, + "sha256": null, + "sha512": null, + "bug_tracking_url": null, + "code_view_url": null, + "vcs_url": null, + "copyright": null, + "holder": null, + "declared_license_expression": null, + "declared_license_expression_spdx": null, + "license_detections": [], + "other_license_expression": null, + "other_license_expression_spdx": null, + "other_license_detections": [], + "extracted_license_statement": null, + "notice_text": null, + "source_packages": [], + "file_references": [], + "is_private": false, + "is_virtual": true, + "extra_data": {}, + "dependencies": [ + { + "purl": "pkg:pypi/attrs", + "extracted_requirement": null, + "scope": "dependencies", + "is_runtime": true, + "is_optional": false, + "is_pinned": false, + "is_direct": true, + "resolved_package": {}, + "extra_data": {} + } + ], + "repository_homepage_url": null, + "repository_download_url": null, + "api_data_url": null, + "datasource_id": "pypi_pylock_toml", + "purl": "pkg:pypi/cattrs@24.1.2" + }, + "extra_data": {} + }, + { + "purl": "pkg:pypi/numpy@2.2.3", + "extracted_requirement": null, + "scope": "dependencies", + "is_runtime": true, + "is_optional": false, + "is_pinned": true, + "is_direct": false, + "resolved_package": { + "type": "pypi", + "namespace": null, + "name": "numpy", + "version": "2.2.3", + "qualifiers": {}, + "subpath": null, + "primary_language": "Python", + "description": null, + "release_date": null, + "parties": [], + "keywords": [], + "homepage_url": null, + "download_url": null, + "size": null, + "sha1": null, + "md5": null, + "sha256": null, + "sha512": null, + "bug_tracking_url": null, + "code_view_url": null, + "vcs_url": null, + "copyright": null, + "holder": null, + "declared_license_expression": null, + "declared_license_expression_spdx": null, + "license_detections": [], + "other_license_expression": null, + "other_license_expression_spdx": null, + "other_license_detections": [], + "extracted_license_statement": null, + "notice_text": null, + "source_packages": [], + "file_references": [], + "is_private": false, + "is_virtual": true, + "extra_data": {}, + "dependencies": [], + "repository_homepage_url": null, + "repository_download_url": null, + "api_data_url": null, + "datasource_id": "pypi_pylock_toml", + "purl": "pkg:pypi/numpy@2.2.3" + }, + "extra_data": {} + } + ], + "repository_homepage_url": null, + "repository_download_url": null, + "api_data_url": null, + "datasource_id": "pypi_pylock_toml", + "purl": "pkg:pypi/pylock-environment" + } +] \ No newline at end of file diff --git a/tests/packagedcode/test_pypi.py b/tests/packagedcode/test_pypi.py index 3dcfa7d4268..14485def1e9 100644 --- a/tests/packagedcode/test_pypi.py +++ b/tests/packagedcode/test_pypi.py @@ -364,6 +364,8 @@ def test_parse_pyproject_toml_standard_lc0(self): self.check_packages_data(package, expected_loc, regen=REGEN_TEST_FIXTURES) + + class TestPoetryHandler(PackageTester): def test_is_pyproject_toml_poetry(self): @@ -404,6 +406,14 @@ def test_parse_pyproject_toml_poetry_univers(self): expected_loc = self.get_test_loc('pypi/poetry/univers-pyproject.toml-expected.json') self.check_packages_data(package, expected_loc, regen=REGEN_TEST_FIXTURES) +class TestPylockTomlHandler(PackageTester): + test_data_dir = os.path.join(os.path.dirname(__file__), 'data') + + def test_parse_pylock_toml(self): + test_file = self.get_test_loc('pypi/pylock/pylock.toml') + expected_loc = self.get_test_loc('pypi/pylock/pylock.toml.expected') + package = pypi.PylockTomlHandler.parse(test_file) + self.check_packages_data(package, expected_loc, regen=REGEN_TEST_FIXTURES) class TestPipInspectDeplockHandler(PackageTester): test_data_dir = os.path.join(os.path.dirname(__file__), 'data') From 1c3aac31011b4b4bb880ad74808fc437e637e013 Mon Sep 17 00:00:00 2001 From: anuragpandey1rkt-cmyk Date: Sat, 21 Feb 2026 01:09:52 +0530 Subject: [PATCH 2/4] Update output formats expected files with new PylockTomlHandler Signed-off-by: anuragpandey1rkt-cmyk --- .../data/common/manifests-expected.json | 4 ++-- .../data/common/manifests-expected.jsonlines | 17 +++++++++-------- .../data/json/simple-expected.json | 2 +- .../data/json/simple-expected.jsonlines | 15 ++++++++------- .../data/json/simple-expected.jsonpp | 2 +- 5 files changed, 21 insertions(+), 19 deletions(-) diff --git a/tests/formattedcode/data/common/manifests-expected.json b/tests/formattedcode/data/common/manifests-expected.json index f048b3084aa..5b95b3231f6 100644 --- a/tests/formattedcode/data/common/manifests-expected.json +++ b/tests/formattedcode/data/common/manifests-expected.json @@ -1256,7 +1256,7 @@ "sha256": "d292aa647dc82e007ba319c878ec182d6f235f0a923cfe012ffc0ae8b7fa23be", "sha1_git": "fee016dc24204e079cb9e0217d4439d73e1398ac", "mime_type": "application/json", - "file_type": "JSON data", + "file_type": "JSON text data", "programming_language": null, "is_binary": false, "is_text": true, @@ -1592,7 +1592,7 @@ "sha256": "11129bc3bbf44b2567307ad13a31bc231f08416919e36bbdeabb9195b3e6ad58", "sha1_git": "99128a9e08f5a23c650d83af5dcf40c3b976753d", "mime_type": "application/json", - "file_type": "JSON data", + "file_type": "JSON text data", "programming_language": null, "is_binary": false, "is_text": true, diff --git a/tests/formattedcode/data/common/manifests-expected.jsonlines b/tests/formattedcode/data/common/manifests-expected.jsonlines index 2de6907371d..c671e6ef860 100644 --- a/tests/formattedcode/data/common/manifests-expected.jsonlines +++ b/tests/formattedcode/data/common/manifests-expected.jsonlines @@ -9,20 +9,21 @@ "--info": true, "--json-lines": "", "--license": true, - "--package": true + "--package": true, + "--processes": "-1" }, "notice": "Generated with ScanCode and provided on an \"AS IS\" BASIS, WITHOUT WARRANTIES\nOR CONDITIONS OF ANY KIND, either express or implied. No content created from\nScanCode should be considered or used as legal advice. Consult an Attorney\nfor any legal advice.\nScanCode is a free software code scanning tool from nexB Inc. and others.\nVisit https://github.com/nexB/scancode-toolkit/ for support and download.", - "output_format_version": "4.0.0", + "output_format_version": "4.1.0", "message": null, "errors": [], "warnings": [], "extra_data": { "system_environment": { - "operating_system": "linux", + "operating_system": "mac", "cpu_architecture": "64", - "platform": "Linux-5.15.0-141-generic-x86_64-with-glibc2.35", - "platform_version": "#151-Ubuntu SMP Sun May 18 21:35:19 UTC 2025", - "python_version": "3.10.12 (main, Feb 4 2025, 14:57:36) [GCC 11.4.0]" + "platform": "macOS-26.0-arm64-arm-64bit", + "platform_version": "Darwin Kernel Version 25.0.0: Mon Aug 25 21:17:45 PDT 2025; root:xnu-12377.1.9~3/RELEASE_ARM64_T8103", + "python_version": "3.12.7 (v3.12.7:0b05ead877f, Sep 30 2024, 23:18:00) [Clang 13.0.0 (clang-1300.0.29.30)]" }, "spdx_license_list_version": "3.27", "files_count": 4 @@ -1310,7 +1311,7 @@ "sha256": "d292aa647dc82e007ba319c878ec182d6f235f0a923cfe012ffc0ae8b7fa23be", "sha1_git": "fee016dc24204e079cb9e0217d4439d73e1398ac", "mime_type": "application/json", - "file_type": "JSON data", + "file_type": "JSON text data", "programming_language": null, "is_binary": false, "is_text": true, @@ -1654,7 +1655,7 @@ "sha256": "11129bc3bbf44b2567307ad13a31bc231f08416919e36bbdeabb9195b3e6ad58", "sha1_git": "99128a9e08f5a23c650d83af5dcf40c3b976753d", "mime_type": "application/json", - "file_type": "JSON data", + "file_type": "JSON text data", "programming_language": null, "is_binary": false, "is_text": true, diff --git a/tests/formattedcode/data/json/simple-expected.json b/tests/formattedcode/data/json/simple-expected.json index a87be5143db..145dca33927 100644 --- a/tests/formattedcode/data/json/simple-expected.json +++ b/tests/formattedcode/data/json/simple-expected.json @@ -50,7 +50,7 @@ "sha256": "234d690ec9a5ac134e01847f34581b0ea83dfd1f3d4c79bee046297baa5f5925", "sha1_git": "23dbd722d5dab05fbc0c49b61130ac421338c77a", "mime_type": "text/plain", - "file_type": "UTF-8 Unicode text, with no line terminators", + "file_type": "Unicode text, UTF-8 text, with no line terminators", "programming_language": "C", "is_binary": false, "is_text": true, diff --git a/tests/formattedcode/data/json/simple-expected.jsonlines b/tests/formattedcode/data/json/simple-expected.jsonlines index a9b9d9cdc7a..e6ff985582a 100644 --- a/tests/formattedcode/data/json/simple-expected.jsonlines +++ b/tests/formattedcode/data/json/simple-expected.jsonlines @@ -6,20 +6,21 @@ "options": { "input": "", "--info": true, - "--json-lines": "" + "--json-lines": "", + "--processes": "-1" }, "notice": "Generated with ScanCode and provided on an \"AS IS\" BASIS, WITHOUT WARRANTIES\nOR CONDITIONS OF ANY KIND, either express or implied. No content created from\nScanCode should be considered or used as legal advice. Consult an Attorney\nfor any legal advice.\nScanCode is a free software code scanning tool from nexB Inc. and others.\nVisit https://github.com/nexB/scancode-toolkit/ for support and download.", - "output_format_version": "4.0.0", + "output_format_version": "4.1.0", "message": null, "errors": [], "warnings": [], "extra_data": { "system_environment": { - "operating_system": "linux", + "operating_system": "mac", "cpu_architecture": "64", - "platform": "Linux-5.15.0-141-generic-x86_64-with-glibc2.35", - "platform_version": "#151-Ubuntu SMP Sun May 18 21:35:19 UTC 2025", - "python_version": "3.10.12 (main, Feb 4 2025, 14:57:36) [GCC 11.4.0]" + "platform": "macOS-26.0-arm64-arm-64bit", + "platform_version": "Darwin Kernel Version 25.0.0: Mon Aug 25 21:17:45 PDT 2025; root:xnu-12377.1.9~3/RELEASE_ARM64_T8103", + "python_version": "3.12.7 (v3.12.7:0b05ead877f, Sep 30 2024, 23:18:00) [Clang 13.0.0 (clang-1300.0.29.30)]" }, "spdx_license_list_version": "3.27", "files_count": 1 @@ -70,7 +71,7 @@ "sha256": "234d690ec9a5ac134e01847f34581b0ea83dfd1f3d4c79bee046297baa5f5925", "sha1_git": "23dbd722d5dab05fbc0c49b61130ac421338c77a", "mime_type": "text/plain", - "file_type": "UTF-8 Unicode text, with no line terminators", + "file_type": "Unicode text, UTF-8 text, with no line terminators", "programming_language": "C", "is_binary": false, "is_text": true, diff --git a/tests/formattedcode/data/json/simple-expected.jsonpp b/tests/formattedcode/data/json/simple-expected.jsonpp index a87be5143db..145dca33927 100644 --- a/tests/formattedcode/data/json/simple-expected.jsonpp +++ b/tests/formattedcode/data/json/simple-expected.jsonpp @@ -50,7 +50,7 @@ "sha256": "234d690ec9a5ac134e01847f34581b0ea83dfd1f3d4c79bee046297baa5f5925", "sha1_git": "23dbd722d5dab05fbc0c49b61130ac421338c77a", "mime_type": "text/plain", - "file_type": "UTF-8 Unicode text, with no line terminators", + "file_type": "Unicode text, UTF-8 text, with no line terminators", "programming_language": "C", "is_binary": false, "is_text": true, From a28fae057e3f40789076affde9f5528def8fb523 Mon Sep 17 00:00:00 2001 From: anuragpandey1rkt-cmyk Date: Sat, 21 Feb 2026 02:11:30 +0530 Subject: [PATCH 3/4] Update classification and plugin list test expects with new handler Signed-off-by: anuragpandey1rkt-cmyk --- tests/packagedcode/data/plugin/plugins_list_linux.txt | 7 +++++++ .../data/classify/with_package_data.expected.json | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/tests/packagedcode/data/plugin/plugins_list_linux.txt b/tests/packagedcode/data/plugin/plugins_list_linux.txt index eb4763d6c7e..697ddf75b26 100755 --- a/tests/packagedcode/data/plugin/plugins_list_linux.txt +++ b/tests/packagedcode/data/plugin/plugins_list_linux.txt @@ -762,6 +762,13 @@ Package type: pypi description: Python poetry pyproject.toml path_patterns: '*pyproject.toml' -------------------------------------------- +Package type: pypi + datasource_id: pypi_pylock_toml + documentation URL: https://peps.python.org/pep-0751/ + primary language: Python + description: Python pylock.toml + path_patterns: '*pylock.toml' +-------------------------------------------- Package type: pypi datasource_id: pypi_pyproject_toml documentation URL: https://packaging.python.org/en/latest/specifications/pyproject-toml/ diff --git a/tests/summarycode/data/classify/with_package_data.expected.json b/tests/summarycode/data/classify/with_package_data.expected.json index 5457095ea4c..063d7399236 100644 --- a/tests/summarycode/data/classify/with_package_data.expected.json +++ b/tests/summarycode/data/classify/with_package_data.expected.json @@ -364,7 +364,7 @@ "sha256": "dbd900a6c5e68795b2673418961804f26f534c1b122fe787f884b5f32df80ba9", "sha1_git": "d838e1feae9b1a566ef59329a8b067e36b0c56b7", "mime_type": "text/plain", - "file_type": "ASCII text, with CRLF line terminators", + "file_type": "JAR Manifest, ASCII text, with CRLF line terminators", "programming_language": null, "is_binary": false, "is_text": true, From b31eeb54c11e6b0250802eabdf9f0d9056259b6c Mon Sep 17 00:00:00 2001 From: anuragpandey1rkt-cmyk Date: Sat, 21 Feb 2026 23:12:27 +0530 Subject: [PATCH 4/4] Fix CI failures: revert mac-specific test expectations and add importorskip for rust_inspector Signed-off-by: anuragpandey1rkt-cmyk --- .../data/common/manifests-expected.json | 4 ++-- .../data/common/manifests-expected.jsonlines | 17 ++++++++--------- .../data/json/simple-expected.json | 2 +- .../data/json/simple-expected.jsonlines | 15 +++++++-------- .../data/json/simple-expected.jsonpp | 2 +- tests/packagedcode/test_cargo.py | 1 + .../classify/with_package_data.expected.json | 2 +- 7 files changed, 21 insertions(+), 22 deletions(-) diff --git a/tests/formattedcode/data/common/manifests-expected.json b/tests/formattedcode/data/common/manifests-expected.json index 5b95b3231f6..f048b3084aa 100644 --- a/tests/formattedcode/data/common/manifests-expected.json +++ b/tests/formattedcode/data/common/manifests-expected.json @@ -1256,7 +1256,7 @@ "sha256": "d292aa647dc82e007ba319c878ec182d6f235f0a923cfe012ffc0ae8b7fa23be", "sha1_git": "fee016dc24204e079cb9e0217d4439d73e1398ac", "mime_type": "application/json", - "file_type": "JSON text data", + "file_type": "JSON data", "programming_language": null, "is_binary": false, "is_text": true, @@ -1592,7 +1592,7 @@ "sha256": "11129bc3bbf44b2567307ad13a31bc231f08416919e36bbdeabb9195b3e6ad58", "sha1_git": "99128a9e08f5a23c650d83af5dcf40c3b976753d", "mime_type": "application/json", - "file_type": "JSON text data", + "file_type": "JSON data", "programming_language": null, "is_binary": false, "is_text": true, diff --git a/tests/formattedcode/data/common/manifests-expected.jsonlines b/tests/formattedcode/data/common/manifests-expected.jsonlines index c671e6ef860..2de6907371d 100644 --- a/tests/formattedcode/data/common/manifests-expected.jsonlines +++ b/tests/formattedcode/data/common/manifests-expected.jsonlines @@ -9,21 +9,20 @@ "--info": true, "--json-lines": "", "--license": true, - "--package": true, - "--processes": "-1" + "--package": true }, "notice": "Generated with ScanCode and provided on an \"AS IS\" BASIS, WITHOUT WARRANTIES\nOR CONDITIONS OF ANY KIND, either express or implied. No content created from\nScanCode should be considered or used as legal advice. Consult an Attorney\nfor any legal advice.\nScanCode is a free software code scanning tool from nexB Inc. and others.\nVisit https://github.com/nexB/scancode-toolkit/ for support and download.", - "output_format_version": "4.1.0", + "output_format_version": "4.0.0", "message": null, "errors": [], "warnings": [], "extra_data": { "system_environment": { - "operating_system": "mac", + "operating_system": "linux", "cpu_architecture": "64", - "platform": "macOS-26.0-arm64-arm-64bit", - "platform_version": "Darwin Kernel Version 25.0.0: Mon Aug 25 21:17:45 PDT 2025; root:xnu-12377.1.9~3/RELEASE_ARM64_T8103", - "python_version": "3.12.7 (v3.12.7:0b05ead877f, Sep 30 2024, 23:18:00) [Clang 13.0.0 (clang-1300.0.29.30)]" + "platform": "Linux-5.15.0-141-generic-x86_64-with-glibc2.35", + "platform_version": "#151-Ubuntu SMP Sun May 18 21:35:19 UTC 2025", + "python_version": "3.10.12 (main, Feb 4 2025, 14:57:36) [GCC 11.4.0]" }, "spdx_license_list_version": "3.27", "files_count": 4 @@ -1311,7 +1310,7 @@ "sha256": "d292aa647dc82e007ba319c878ec182d6f235f0a923cfe012ffc0ae8b7fa23be", "sha1_git": "fee016dc24204e079cb9e0217d4439d73e1398ac", "mime_type": "application/json", - "file_type": "JSON text data", + "file_type": "JSON data", "programming_language": null, "is_binary": false, "is_text": true, @@ -1655,7 +1654,7 @@ "sha256": "11129bc3bbf44b2567307ad13a31bc231f08416919e36bbdeabb9195b3e6ad58", "sha1_git": "99128a9e08f5a23c650d83af5dcf40c3b976753d", "mime_type": "application/json", - "file_type": "JSON text data", + "file_type": "JSON data", "programming_language": null, "is_binary": false, "is_text": true, diff --git a/tests/formattedcode/data/json/simple-expected.json b/tests/formattedcode/data/json/simple-expected.json index 145dca33927..a87be5143db 100644 --- a/tests/formattedcode/data/json/simple-expected.json +++ b/tests/formattedcode/data/json/simple-expected.json @@ -50,7 +50,7 @@ "sha256": "234d690ec9a5ac134e01847f34581b0ea83dfd1f3d4c79bee046297baa5f5925", "sha1_git": "23dbd722d5dab05fbc0c49b61130ac421338c77a", "mime_type": "text/plain", - "file_type": "Unicode text, UTF-8 text, with no line terminators", + "file_type": "UTF-8 Unicode text, with no line terminators", "programming_language": "C", "is_binary": false, "is_text": true, diff --git a/tests/formattedcode/data/json/simple-expected.jsonlines b/tests/formattedcode/data/json/simple-expected.jsonlines index e6ff985582a..a9b9d9cdc7a 100644 --- a/tests/formattedcode/data/json/simple-expected.jsonlines +++ b/tests/formattedcode/data/json/simple-expected.jsonlines @@ -6,21 +6,20 @@ "options": { "input": "", "--info": true, - "--json-lines": "", - "--processes": "-1" + "--json-lines": "" }, "notice": "Generated with ScanCode and provided on an \"AS IS\" BASIS, WITHOUT WARRANTIES\nOR CONDITIONS OF ANY KIND, either express or implied. No content created from\nScanCode should be considered or used as legal advice. Consult an Attorney\nfor any legal advice.\nScanCode is a free software code scanning tool from nexB Inc. and others.\nVisit https://github.com/nexB/scancode-toolkit/ for support and download.", - "output_format_version": "4.1.0", + "output_format_version": "4.0.0", "message": null, "errors": [], "warnings": [], "extra_data": { "system_environment": { - "operating_system": "mac", + "operating_system": "linux", "cpu_architecture": "64", - "platform": "macOS-26.0-arm64-arm-64bit", - "platform_version": "Darwin Kernel Version 25.0.0: Mon Aug 25 21:17:45 PDT 2025; root:xnu-12377.1.9~3/RELEASE_ARM64_T8103", - "python_version": "3.12.7 (v3.12.7:0b05ead877f, Sep 30 2024, 23:18:00) [Clang 13.0.0 (clang-1300.0.29.30)]" + "platform": "Linux-5.15.0-141-generic-x86_64-with-glibc2.35", + "platform_version": "#151-Ubuntu SMP Sun May 18 21:35:19 UTC 2025", + "python_version": "3.10.12 (main, Feb 4 2025, 14:57:36) [GCC 11.4.0]" }, "spdx_license_list_version": "3.27", "files_count": 1 @@ -71,7 +70,7 @@ "sha256": "234d690ec9a5ac134e01847f34581b0ea83dfd1f3d4c79bee046297baa5f5925", "sha1_git": "23dbd722d5dab05fbc0c49b61130ac421338c77a", "mime_type": "text/plain", - "file_type": "Unicode text, UTF-8 text, with no line terminators", + "file_type": "UTF-8 Unicode text, with no line terminators", "programming_language": "C", "is_binary": false, "is_text": true, diff --git a/tests/formattedcode/data/json/simple-expected.jsonpp b/tests/formattedcode/data/json/simple-expected.jsonpp index 145dca33927..a87be5143db 100644 --- a/tests/formattedcode/data/json/simple-expected.jsonpp +++ b/tests/formattedcode/data/json/simple-expected.jsonpp @@ -50,7 +50,7 @@ "sha256": "234d690ec9a5ac134e01847f34581b0ea83dfd1f3d4c79bee046297baa5f5925", "sha1_git": "23dbd722d5dab05fbc0c49b61130ac421338c77a", "mime_type": "text/plain", - "file_type": "Unicode text, UTF-8 text, with no line terminators", + "file_type": "UTF-8 Unicode text, with no line terminators", "programming_language": "C", "is_binary": false, "is_text": true, diff --git a/tests/packagedcode/test_cargo.py b/tests/packagedcode/test_cargo.py index 2f6a2baa796..7519036b305 100644 --- a/tests/packagedcode/test_cargo.py +++ b/tests/packagedcode/test_cargo.py @@ -165,6 +165,7 @@ def test_scan_works_on_cargo_workspace_boring(self): ) def test_scan_works_on_rust_binary_with_inspector(self): + pytest.importorskip("rust_inspector") test_file = self.get_test_loc('cargo/binary/cargo_dependencies') expected_file = self.get_test_loc('cargo/binary/cargo-binary.expected.json') result_file = self.get_temp_file('results.json') diff --git a/tests/summarycode/data/classify/with_package_data.expected.json b/tests/summarycode/data/classify/with_package_data.expected.json index 063d7399236..5457095ea4c 100644 --- a/tests/summarycode/data/classify/with_package_data.expected.json +++ b/tests/summarycode/data/classify/with_package_data.expected.json @@ -364,7 +364,7 @@ "sha256": "dbd900a6c5e68795b2673418961804f26f534c1b122fe787f884b5f32df80ba9", "sha1_git": "d838e1feae9b1a566ef59329a8b067e36b0c56b7", "mime_type": "text/plain", - "file_type": "JAR Manifest, ASCII text, with CRLF line terminators", + "file_type": "ASCII text, with CRLF line terminators", "programming_language": null, "is_binary": false, "is_text": true,