-
Notifications
You must be signed in to change notification settings - Fork 146
How to migrate from 0.6.1 to 0.7.0
Meret B edited this page Dec 12, 2022
·
6 revisions
Below is a (non-exhaustive) overview of changes in the new release that might require adjustments during migration:
Refactoring
-
The class
Algorithm
was renamed toChecksum
-
The classes
License
,LicenseConjunction
,LicenseDisjunction
,ExtractedLicense
were moved to a separate filelicense.py
-> imports need to be adapted, e.g.
from spdx.document import License
tofrom spdx.license import License
-
Checksum fields in
File
andPackage
were renamed fromchk_sum
/check_sum
tochecksum
Structure
- Files are saved at document-level. To map a file belonging to a package you need to add a
CONTAINS
relationship, e.g. instead of adding the file to the package
package.add_file(file_entry)
add the file at document level and create a new CONTAINS
relationship
doc.add_file(file_entry)
relationship = Relationship(package.spdx_id + " CONTAINS " + file_entry.spdx_id)
doc.add_relationship(relationship)