nexB/license-expression

Are DocumentRef licenses supported?

Closed this issue · 8 comments

The SPDX specifications allow this syntax:
license-ref = ["DocumentRef-"1*(idstring)":"]"LicenseRef-"1*(idstring)
However if I try to parse a license of DocumentRef-James:LicenseRef-Dean I get expections.
Am I doing something wrong or are these license-ref constructs not supported?

@papadeltasierra this should be fully working. Can you paste a snippet of the code that fails?

from license_expression import Licensing

licensing = Licensing()
expression = 'DocumentRef-James-1.0:LicenseRef-Eric-2.0'
parsed = licensing.parse(expression)
print(parsed)

The result of running this using Python 3 is

...
license_expression.ExpressionError: Invalid license key: the valid characters are: letters and numbers, underscore, dot or hyphen signs and spaces: "DocumentRef-spdx-tool-1.2:LicenseRef-MIT-Style-2"

No problem. What is your release schedule? How soon before this will filter through to an updated Python package on Pypi?

@papadeltasierra there you go: this is on Pypi now
https://github.com/nexB/license-expression/releases/tag/v0.999
https://pypi.org/project/license-expression/
Just out of curiosity, what's your use case? (you do not have to answer but that would be nice!)

@papadeltasierra ping? did you test this?

Sorry, yes and it seems to work exactly as required. Thanks for a very quick turnaround.

@papadeltasierra ack. Thank you! closing now