Modulemd.ModuleStream¶
- Subclasses:
Methods¶
- Inherited:
- Structs:
class |
|
class |
|
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
|
|
|
|
|
|
|
|
|
Properties¶
Name |
Type |
Flags |
Short Description |
---|---|---|---|
r/w/c |
The processor architecture of this module stream. |
||
r/w/c |
The context of this module stream. Distinguishes between streams with the same version but different dependencies due to module stream expansion. |
||
r |
The metadata version of this ModuleStream object. Read-only. |
||
r/w/co |
The name of the module providing this stream. |
||
r/w/co |
The name of this module stream. |
||
r/w/c |
The version of this module stream |
Signals¶
- Inherited:
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
---|---|---|---|
parent_instance |
r |
Class Details¶
- class Modulemd.ModuleStream(**kwargs)¶
- Bases:
- Abstract:
Yes
- Structure:
- classmethod new(mdversion, module_name, module_stream)¶
- Parameters:
- Returns:
A newly-allocated
Modulemd.ModuleStream
object of the requested metadata version.- Return type:
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
orNone
) – 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
orNone
) – 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:
- Returns:
A newly-allocated
Modulemd.ModuleStream
object if the YAML file was valid and contained exactly onedocument: modulemd
subdocument.None
if the document fails validation or multiple documents are encountered and sets error appropriately. SeeModulemd.ModuleIndex
for functions to read in multiple-subdocument YAML.- Return type:
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 returnedModulemd.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
orNone
) – 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
orNone
) – 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:
- Returns:
A newly-allocated
Modulemd.ModuleStream
object if the YAML string was valid and contained exactly onedocument: modulemd
subdocument.None
if the document fails validation or multiple documents are encountered and sets error appropriately. SeeModulemd.ModuleIndex
for functions to read in multiple-subdocument YAML.- Return type:
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 returnedModulemd.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:
- Returns:
True
if any of theModulemd.Dependencies
objects associated with this module applies to the provided module name and stream in the build-time dependencies.- Return type:
New in version 2.1.
- copy(module_name, module_stream)¶
- Parameters:
- Returns:
A newly-allocated
Modulemd.ModuleStream
object that is a complete copy of self, optionally with a new stream name.- Return type:
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:
- Returns:
True
if any of theModulemd.Dependencies
objects associated with this module applies to the provided module name and stream in the runtime dependencies.- Return type:
New in version 2.1.
- equals(self_2)¶
- Parameters:
self_2 (
Modulemd.ModuleStream
) – AModulemd.ModuleStream
object.- Returns:
- Return type:
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:
New in version 2.2.
- get_arch()¶
- Returns:
Module architecture object. Indicates to which processor architecture this
Modulemd.ModuleStream
applies.- Return type:
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:
New in version 2.0.
- get_mdversion()¶
- Returns:
The metadata version of this
Modulemd.ModuleStream
.- Return type:
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:
Retrieves a representation of the module name, stream name, version and context of this
Modulemd.ModuleStream
in the formmodule_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_version()¶
- Returns:
The version of this
Modulemd.ModuleStream
.- Return type:
- set_arch(arch)¶
- Parameters:
arch (
str
orNone
) – Module architecture. Indicates to which processor architecture thisModulemd.ModuleStream
applies.
New in version 2.2.
- set_context(context)¶
- Parameters:
context (
str
orNone
) – 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 thisModulemd.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:
- Returns:
A newly-allocated
Modulemd.ModuleStream
copy of this object upgraded to the requested version. ReturnsNone
and sets error appropriately if the upgrade could not be completed automatically.- Return type:
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:
- Returns:
A newly-allocated
Modulemd.Module
containing a copy of this object upgraded to the requested version, possibly with multiple streams. ReturnsNone
and sets error appropriately if the upgrade could not be completed automatically.- Return type:
Does not modify the original
Modulemd.ModuleStream
object, from.New in version 2.10.
- validate()¶
- Raises:
- Returns:
True
if theModulemd.ModuleStream
passed validation.False
and sets error appropriately if validation fails.- Return type:
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:
- Returns:
True
if any of theModulemd.Dependencies
objects associated with this module applies to the provided module name and stream in the build-time dependencies.- Return type:
New in version 2.1.
- do_copy(module_name, module_stream) virtual¶
- Parameters:
- Returns:
A newly-allocated
Modulemd.ModuleStream
object that is a complete copy of self, optionally with a new stream name.- Return type:
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:
- Returns:
True
if any of theModulemd.Dependencies
objects associated with this module applies to the provided module name and stream in the runtime dependencies.- Return type:
New in version 2.1.
- do_equals(self_2) virtual¶
- Parameters:
self_2 (
Modulemd.ModuleStream
) – AModulemd.ModuleStream
object.- Returns:
- Return type:
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:
New in version 2.0.
- do_validate() virtual¶
- Returns:
True
if theModulemd.ModuleStream
passed validation.False
and sets error appropriately if validation fails.- Return type:
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¶
-
The processor architecture of this module stream.
- Modulemd.ModuleStream.props.context¶
-
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¶
-
The metadata version of this ModuleStream object. Read-only.
- Modulemd.ModuleStream.props.module_name¶
- Name:
module-name
- Type:
- Default Value:
- Flags:
The name of the module providing this stream.
- Modulemd.ModuleStream.props.stream_name¶
- Name:
stream-name
- Type:
- Default Value:
- Flags:
The name of this module stream.