3
3
# SPDX-License-Identifier: Apache-2.0
4
4
from datetime import datetime
5
5
6
- from license_expression import get_spdx_licensing
7
-
6
+ from spdx_tools .common .spdx_licensing import spdx_licensing
8
7
from spdx_tools .spdx .constants import DOCUMENT_SPDX_ID
9
8
from spdx_tools .spdx .model import (
10
9
Actor ,
@@ -88,7 +87,7 @@ def file_fixture(
88
87
spdx_id = "SPDXRef-File" ,
89
88
checksums = None ,
90
89
file_types = None ,
91
- license_concluded = get_spdx_licensing () .parse ("MIT and GPL-2.0" ),
90
+ license_concluded = spdx_licensing .parse ("MIT and GPL-2.0" ),
92
91
license_info_in_file = None ,
93
92
license_comment = "licenseComment" ,
94
93
copyright_text = "copyrightText" ,
@@ -100,7 +99,7 @@ def file_fixture(
100
99
checksums = [checksum_fixture ()] if checksums is None else checksums
101
100
file_types = [FileType .TEXT ] if file_types is None else file_types
102
101
license_info_in_file = (
103
- [get_spdx_licensing () .parse ("MIT" ), get_spdx_licensing () .parse ("GPL-2.0" ), SpdxNoAssertion ()]
102
+ [spdx_licensing .parse ("MIT" ), spdx_licensing .parse ("GPL-2.0" ), SpdxNoAssertion ()]
104
103
if license_info_in_file is None
105
104
else license_info_in_file
106
105
)
@@ -135,9 +134,9 @@ def package_fixture(
135
134
checksums = None ,
136
135
homepage = "https://homepage.com" ,
137
136
source_info = "sourceInfo" ,
138
- license_concluded = get_spdx_licensing () .parse ("MIT and GPL-2.0" ),
137
+ license_concluded = spdx_licensing .parse ("MIT and GPL-2.0" ),
139
138
license_info_from_files = None ,
140
- license_declared = get_spdx_licensing () .parse ("MIT and GPL-2.0" ),
139
+ license_declared = spdx_licensing .parse ("MIT and GPL-2.0" ),
141
140
license_comment = "packageLicenseComment" ,
142
141
copyright_text = "packageCopyrightText" ,
143
142
summary = "packageSummary" ,
@@ -152,7 +151,7 @@ def package_fixture(
152
151
) -> Package :
153
152
checksums = [checksum_fixture ()] if checksums is None else checksums
154
153
license_info_from_files = (
155
- [get_spdx_licensing () .parse ("MIT" ), get_spdx_licensing () .parse ("GPL-2.0" ), SpdxNoAssertion ()]
154
+ [spdx_licensing .parse ("MIT" ), spdx_licensing .parse ("GPL-2.0" ), SpdxNoAssertion ()]
156
155
if license_info_from_files is None
157
156
else license_info_from_files
158
157
)
@@ -208,7 +207,7 @@ def snippet_fixture(
208
207
file_spdx_id = "SPDXRef-File" ,
209
208
byte_range = (1 , 2 ),
210
209
line_range = (3 , 4 ),
211
- license_concluded = get_spdx_licensing () .parse ("MIT and GPL-2.0" ),
210
+ license_concluded = spdx_licensing .parse ("MIT and GPL-2.0" ),
212
211
license_info_in_snippet = None ,
213
212
license_comment = "snippetLicenseComment" ,
214
213
copyright_text = "licenseCopyrightText" ,
@@ -217,7 +216,7 @@ def snippet_fixture(
217
216
attribution_texts = None ,
218
217
) -> Snippet :
219
218
license_info_in_snippet = (
220
- [get_spdx_licensing () .parse ("MIT" ), get_spdx_licensing () .parse ("GPL-2.0" ), SpdxNone ()]
219
+ [spdx_licensing .parse ("MIT" ), spdx_licensing .parse ("GPL-2.0" ), SpdxNone ()]
221
220
if license_info_in_snippet is None
222
221
else license_info_in_snippet
223
222
)
0 commit comments