spdx / tools-python

A Python library to parse, validate and create SPDX documents.
http://spdx.org
Apache License 2.0
190 stars 134 forks source link

OPENSSL and zlib not recognized as valid licences #811

Open vargenau opened 4 months ago

vargenau commented 4 months ago

OPENSSL-zlib.spdx.json

pyspdxtools -i OPENSSL-zlib.spdx.json
ERROR:root:The document is invalid. The following issues have been found:
Unrecognized license reference: zlib. license_expression must only use IDs from the license list or extracted licensing info, but is: BSD-3-Clause AND IJG AND zlib
Unrecognized license reference: OPENSSL. license_expression must only use IDs from the license list or extracted licensing info, but is: IJG AND ISC AND LGPL-2.1-or-later AND Libpng AND MIT AND OPENSSL AND X11 AND Zlib AND bzip2-1.0.6

File is valid SPDX as confirmed by Java Tools

stefan6419846 commented 2 months ago

Is this still an issue? Running the latest main code with license-expression==30.3.1 seems to validate correctly both from the CLI and from code:

(venv) stefan@localhost:/tmp$ python
Python 3.10.12 (main, Sep 11 2024, 15:47:36) [GCC 11.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from spdx_tools.spdx.model.document import Document
>>> from spdx_tools.spdx.parser.parse_anything import parse_file
>>> document = parse_file('/home/stefan/Downloads/OPENSSL-zlib.spdx.json')
>>> from spdx_tools.spdx.validation.document_validator import validate_full_spdx_document
>>> validate_full_spdx_document(document)
[]
>>>
vargenau commented 2 months ago

Yes, I still have the issue.

pyspdxtools -i OPENSSL-zlib.spdx.json
ERROR:root:The document is invalid. The following issues have been found:
Unrecognized license reference: zlib. license_expression must only use IDs from the license list or extracted licensing info, but is: BSD-3-Clause AND IJG AND zlib
Unrecognized license reference: OPENSSL. license_expression must only use IDs from the license list or extracted licensing info, but is: IJG AND ISC AND LGPL-2.1-or-later AND Libpng AND MIT AND OPENSSL AND X11 AND Zlib AND bzip2-1.0.6
which pyspdxtools
/opt/homebrew/bin/pyspdxtools

MacOS 14.6.1

python --version
Python 3.11.10