Modulemd.ModuleStream

g GObject.Object GObject.Object Modulemd.ModuleStream Modulemd.ModuleStream GObject.Object->Modulemd.ModuleStream

Subclasses:

Modulemd.ModuleStreamV1, Modulemd.ModuleStreamV2

Methods

Inherited:

GObject.Object (37)

Structs:

GObject.ObjectClass (5)

class

new (mdversion, module_name, module_stream)

class

read_file (path, strict, module_name, module_stream)

class

read_string (yaml_string, strict, module_name, module_stream)

build_depends_on_stream (module_name, stream_name)

copy (module_name, module_stream)

depends_on_stream (module_name, stream_name)

equals (self_2)

get_NSVCA ()

get_arch ()

get_context ()

get_mdversion ()

get_module_name ()

get_nsvc ()

get_stream_name ()

get_version ()

set_arch (arch)

set_context (context)

set_version (version)

upgrade (mdversion)

upgrade_ext (mdversion)

validate ()

Virtual Methods

Inherited:

GObject.Object (7)

do_build_depends_on_stream (module_name, stream_name)

do_copy (module_name, module_stream)

do_depends_on_stream (module_name, stream_name)

do_equals (self_2)

do_get_mdversion ()

do_validate ()

Properties

Name

Type

Flags

Short Description

arch

str

r/w/c

The processor architecture of this module stream.

context

str

r/w/c

The context of this module stream. Distinguishes between streams with the same version but different dependencies due to module stream expansion.

mdversion

int

r

The metadata version of this ModuleStream object. Read-only.

module-name

str

r/w/co

The name of the module providing this stream.

stream-name

str

r/w/co

The name of this module stream.

version

int

r/w/c

The version of this module stream

Signals

Inherited:

GObject.Object (1)

Fields

Inherited:

GObject.Object (1)

Name

Type

Access

Description

parent_instance

GObject.Object

r

Class Details

class Modulemd.ModuleStream(**kwargs)
Bases:

GObject.Object

Abstract:

Yes

Structure:

Modulemd.ModuleStreamClass

classmethod new(mdversion, module_name, module_stream)
Parameters:
  • mdversion (int) – The metadata version of Modulemd.ModuleStream to create.

  • module_name (str or None) – The name of the module.

  • module_stream (str or None) – The name of this stream. Optional.

Returns:

A newly-allocated Modulemd.ModuleStream object of the requested metadata version.

Return type:

Modulemd.ModuleStream

New in version 2.0.

classmethod read_file(path, strict, module_name, module_stream)
Parameters:
  • path (str) – The path to a YAML document containing a module stream definition.

  • strict (bool) – Whether the parser should return failure if it encounters an unknown mapping key or if it should ignore it.

  • module_name (str or None) – An optional module name to override the document on disk. Mostly useful in cases where the name is being auto-detected from git.

  • module_stream (str or None) – An optional module stream name to override the document on disk. Mostly useful in cases where the name is being auto-detected from git.

Raises:

GLib.Error

Returns:

A newly-allocated Modulemd.ModuleStream object if the YAML file was valid and contained exactly one document: modulemd subdocument. None if the document fails validation or multiple documents are encountered and sets error appropriately. See Modulemd.ModuleIndex for functions to read in multiple-subdocument YAML.

Return type:

Modulemd.ModuleStream

Create a Modulemd.ModuleStream object from a YAML file.

Note: This function also reads modulemd-packager v2 and v3 documents, which are transparently returned as Modulemd.ModuleStream (V2) objects. However, if a modulemd-packager v3 document (Modulemd.PackagerV3) is encountered and it uses buildopts (Modulemd.Buildopts) in one or more build configurations, only the buildopts present in the first listed configuration (if any) will be applied to the returned Modulemd.ModuleStreamV2 object.

New in version 2.0.

Deprecated since version 2.11: Use Modulemd.read_packager_file() instead.

classmethod read_string(yaml_string, strict, module_name, module_stream)
Parameters:
  • yaml_string (str) – A YAML document string containing a module stream definition.

  • strict (bool) – Whether the parser should return failure if it encounters an unknown mapping key or if it should ignore it.

  • module_name (str or None) – An optional module name to override the document on disk. Mostly useful in cases where the name is being auto-detected from git.

  • module_stream (str or None) – An optional module stream name to override the document on disk. Mostly useful in cases where the name is being auto-detected from git.

Raises:

GLib.Error

Returns:

A newly-allocated Modulemd.ModuleStream object if the YAML string was valid and contained exactly one document: modulemd subdocument. None if the document fails validation or multiple documents are encountered and sets error appropriately. See Modulemd.ModuleIndex for functions to read in multiple-subdocument YAML.

Return type:

Modulemd.ModuleStream

Create a Modulemd.ModuleStream object from a YAML string.

Note: This function also reads modulemd-packager v2 and v3 documents, which are transparently returned as Modulemd.ModuleStream (V2) objects. However, if a modulemd-packager v3 document (Modulemd.PackagerV3) is encountered and it uses buildopts (Modulemd.Buildopts) in one or more build configurations, only the buildopts present in the first listed configuration (if any) will be applied to the returned Modulemd.ModuleStreamV2 object.

New in version 2.0.

Deprecated since version 2.11: Use Modulemd.read_packager_string() instead.

build_depends_on_stream(module_name, stream_name)
Parameters:
  • module_name (str) – A module name.

  • stream_name (str) – The stream of the module.

Returns:

True if any of the Modulemd.Dependencies objects associated with this module applies to the provided module name and stream in the build-time dependencies.

Return type:

bool

New in version 2.1.

copy(module_name, module_stream)
Parameters:
  • module_name (str or None) – An optional new name for the module of the copied stream.

  • module_stream (str or None) – An optional new name for the copied stream.

Returns:

A newly-allocated Modulemd.ModuleStream object that is a complete copy of self, optionally with a new stream name.

Return type:

Modulemd.ModuleStream

Copies a Modulemd.ModuleStream, optionally assigning it a new stream name in the process.

New in version 2.0.

depends_on_stream(module_name, stream_name)
Parameters:
  • module_name (str) – A module name.

  • stream_name (str) – The stream of the module.

Returns:

True if any of the Modulemd.Dependencies objects associated with this module applies to the provided module name and stream in the runtime dependencies.

Return type:

bool

New in version 2.1.

equals(self_2)
Parameters:

self_2 (Modulemd.ModuleStream) – A Modulemd.ModuleStream object.

Returns:

True, If both objects are equal. False, otherwise.

Return type:

bool

Checks if self and self_2 are identical objects.

New in version 2.3.

get_NSVCA()
Returns:

The NSVCA of this module stream. The returned format is described here. None if module name or stream stream is unknown.

Return type:

str

New in version 2.2.

get_arch()
Returns:

Module architecture object. Indicates to which processor architecture this Modulemd.ModuleStream applies.

Return type:

str

New in version 2.2.

get_context()
Returns:

Module context flag. The context flag serves to distinguish module builds with the same name, stream and version and plays an important role in automatic module stream name expansion.

Return type:

str

New in version 2.0.

get_mdversion()
Returns:

The metadata version of this Modulemd.ModuleStream.

Return type:

int

New in version 2.0.

get_module_name()
Returns:

The name of the module.

Return type:

str

New in version 2.0.

get_nsvc()
Returns:

The NSVC (name:stream:py:data::version<Modulemd.ModuleStream.props.version>[:context]) of this module stream. None if module name or stream stream is unknown.

Return type:

str

Retrieves a representation of the module name, stream name, version and context of this Modulemd.ModuleStream in the form module_name:stream_name:version:context. Note that this excludes the architecture of the module stream and as such is not guaranteed to be unique within a repository.

New in version 2.0.

get_stream_name()
Returns:

The name of this stream.

Return type:

str

New in version 2.0.

get_version()
Returns:

The version of this Modulemd.ModuleStream.

Return type:

int

set_arch(arch)
Parameters:

arch (str or None) – Module architecture. Indicates to which processor architecture this Modulemd.ModuleStream applies.

New in version 2.2.

set_context(context)
Parameters:

context (str or None) – Module context flag. The context flag serves to distinguish module builds with the same name, stream and version and plays an important role in automatic module stream name expansion.

New in version 2.0.

set_version(version)
Parameters:

version (int) – The version of this Modulemd.ModuleStream.

New in version 2.0.

upgrade(mdversion)
Parameters:

mdversion (int) – The metadata version to upgrade to. If zero, upgrades to the highest-supported version.

Raises:

GLib.Error

Returns:

A newly-allocated Modulemd.ModuleStream copy of this object upgraded to the requested version. Returns None and sets error appropriately if the upgrade could not be completed automatically.

Return type:

Modulemd.ModuleStream

Return an upgraded copy of this object. Does not modify the original.

New in version 2.0.

Deprecated since version 2.10: Use Modulemd.ModuleStream.upgrade_ext() instead.

upgrade_ext(mdversion)
Parameters:

mdversion (int) – The metadata version to upgrade to. If zero, upgrades to the highest-supported version.

Raises:

GLib.Error

Returns:

A newly-allocated Modulemd.Module containing a copy of this object upgraded to the requested version, possibly with multiple streams. Returns None and sets error appropriately if the upgrade could not be completed automatically.

Return type:

Modulemd.Module

Does not modify the original Modulemd.ModuleStream object, from.

New in version 2.10.

validate()
Raises:

GLib.Error

Returns:

True if the Modulemd.ModuleStream passed validation. False and sets error appropriately if validation fails.

Return type:

bool

Verifies that all stored values are internally consistent and that the module is sufficiently-complete for emitting. This function is called implicitly before attempting to emit the contents.

New in version 2.0.

do_build_depends_on_stream(module_name, stream_name) virtual
Parameters:
  • module_name (str) – A module name.

  • stream_name (str) – The stream of the module.

Returns:

True if any of the Modulemd.Dependencies objects associated with this module applies to the provided module name and stream in the build-time dependencies.

Return type:

bool

New in version 2.1.

do_copy(module_name, module_stream) virtual
Parameters:
  • module_name (str or None) – An optional new name for the module of the copied stream.

  • module_stream (str or None) – An optional new name for the copied stream.

Returns:

A newly-allocated Modulemd.ModuleStream object that is a complete copy of self, optionally with a new stream name.

Return type:

Modulemd.ModuleStream

Copies a Modulemd.ModuleStream, optionally assigning it a new stream name in the process.

New in version 2.0.

do_depends_on_stream(module_name, stream_name) virtual
Parameters:
  • module_name (str) – A module name.

  • stream_name (str) – The stream of the module.

Returns:

True if any of the Modulemd.Dependencies objects associated with this module applies to the provided module name and stream in the runtime dependencies.

Return type:

bool

New in version 2.1.

do_equals(self_2) virtual
Parameters:

self_2 (Modulemd.ModuleStream) – A Modulemd.ModuleStream object.

Returns:

True, If both objects are equal. False, otherwise.

Return type:

bool

Checks if self_1 and self_2 are identical objects.

New in version 2.3.

do_get_mdversion() virtual
Returns:

The metadata version of this Modulemd.ModuleStream.

Return type:

int

New in version 2.0.

do_validate() virtual
Returns:

True if the Modulemd.ModuleStream passed validation. False and sets error appropriately if validation fails.

Return type:

bool

Verifies that all stored values are internally consistent and that the module is sufficiently-complete for emitting. This function is called implicitly before attempting to emit the contents.

New in version 2.0.

Property Details

Modulemd.ModuleStream.props.arch
Name:

arch

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE, CONSTRUCT

The processor architecture of this module stream.

Modulemd.ModuleStream.props.context
Name:

context

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE, CONSTRUCT

The context of this module stream. Distinguishes between streams with the same version but different dependencies due to module stream expansion.

Modulemd.ModuleStream.props.mdversion
Name:

mdversion

Type:

int

Default Value:

0

Flags:

READABLE

The metadata version of this ModuleStream object. Read-only.

Modulemd.ModuleStream.props.module_name
Name:

module-name

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

The name of the module providing this stream.

Modulemd.ModuleStream.props.stream_name
Name:

stream-name

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

The name of this module stream.

Modulemd.ModuleStream.props.version
Name:

version

Type:

int

Default Value:

0

Flags:

READABLE, WRITABLE, CONSTRUCT

The version of this module stream