craft_platforms.snap

Snap-specific module for craft-platforms.

craft_platforms.snap.get_default_architectures(base)[source]

Get the default architectures for a given snap base.

Parameters:

base (str) – the snap base as a string (e.g. core24)

Returns:

Sequence[DebianArchitecture] – A sequence of of DebianArchitecture objects containing the default set of architectures to use if none are defined for this base.

craft_platforms.snap.get_distro_base_from_core_base(base)[source]

Get a DistroBase from a ‘coreXX’ base number.

Parameters:

base (str) – a string containing the base value

Returns:

DistroBase – A generic base object for the given snap base.

craft_platforms.snap.get_platforms_snap_build_plan(base, *, build_base=None, snap_type=None, platforms)[source]

Generate the build plan for a platforms-based charm.

Parameters:
  • base (str | None) – The base string in snapcraft.yaml (or None if not given)

  • build_base (str | None, default: None) – The build-base string in snapcraft.yaml (or None if not given)

  • snap_type (str | None, default: None)

  • platforms (dict[DebianArchitecture | str, PlatformDict | None] | None)

Return type:

Sequence[BuildInfo]