Skip to content

Re-export customized CycloneDX models from top-level package for external use

Jonathan Howard requested to merge export-model-types into dev

Checklist

  • documentation is changed or added in ./docs
  • unit tests updated to test changes

Description

Context

Top-level package export of single unified type for each CycloneDX model for simplifying typing in external projects.

Intent

  • Import all customized CycloneDX models within Hoppr to the top-level hoppr package and reexport using the __all__ module variable
    • Allows external code to import extended models more easily, e.g. from hoppr import Vulnerability
    • This is a way of declaring which internal Hoppr types are intended to be imported externally
  • Add type aliases for poorly named enums, e.g. hoppr_cyclonedx_models.cyclonedx_1_5.Type3 --> ExternalReferenceType, and and reexport using the __all__ module variable
    • Doesn't impact any existing code because:
      • The new type aliases didn't exist until now
      • Any models that are imported at top-level and reexported are still found in and can be imported from their original locations
  • Fix empty __version__ string variable in hopctl release container image
Edited by Jonathan Howard

Merge request reports