Skip to content

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 to Checksum

  • The classes License, LicenseConjunction, LicenseDisjunction, ExtractedLicense were moved to a separate file license.py

    -> imports need to be adapted, e.g. from spdx.document import License to from spdx.license import License

  • Checksum fields in File and Package were renamed from chk_sum/check_sum to checksum

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)
Clone this wiki locally