thoth.adviser.strides package

Submodules

thoth.adviser.strides.one_version module

Filter out software stacks allowing the pipeline to produce just one software stack with specific package.

This stride will allow the pipeline to produce a stack with only a specific package-version just once - e.g. if two or more software stacks could be resolved with tensorflow==2.0.0, this stride will allow the pipeline to produce just one software stack with tensorflow==2.0.0, other software stacks will be filtered out.

class thoth.adviser.strides.one_version.OneVersionStride(version_seen: Optional[str] = None, *, configuration: Dict[str, Any] = NOTHING, name: str = None)[source]

Bases: thoth.adviser.stride.Stride

Filter out software stacks allowing the pipeline to produce just one software stack with specific package.

CONFIGURATION_DEFAULT = {'only_once': True, 'package_name': None}
pre_run() → None[source]

Initialize internal state of the unit.

run(state: thoth.adviser.state.State) → None[source]

Filter out software stacks, allow only a package with specific version being produced just once.

classmethod should_include(builder_context: PipelineBuilderContext) → Optional[Dict[str, Any]][source]

Include this pipeline unit only if user asks for it explicitly.

version_seen

thoth.adviser.strides.random_decision module

Filter out states randomly.

class thoth.adviser.strides.random_decision.RandomDecisionStride(*, configuration: Dict[str, Any] = NOTHING, name: str = None)[source]

Bases: thoth.adviser.stride.Stride

Filter out states randomly.

run(state: thoth.adviser.state.State) → None[source]

Flip a coin and decide - tails are not acceptable.

classmethod should_include(builder_context: PipelineBuilderContext) → Optional[Dict[str, Any]][source]

Allow inclusion only per user request.

thoth.adviser.strides.unique_stack module

Filter out software stacks that were already resolved.

This pipeline unit is especially useful for dependency monkey runs when no duplicate software stacks should be resolved.

class thoth.adviser.strides.unique_stack.UniqueStackStride(*, configuration: Dict[str, Any] = NOTHING, name: str = None)[source]

Bases: thoth.adviser.stride.Stride

Filter out software stacks that were already resolved.

As dependency graphs can share nodes, it might happen that the same software stack can be resolved multiple times considering different resolution paths.

pre_run() → None[source]

Initialize internal state of the unit.

run(state: thoth.adviser.state.State) → None[source]

Filter out software stacks that were already resolved.

classmethod should_include(builder_context: PipelineBuilderContext) → Optional[Dict[str, Any]][source]

Include this pipeline unit only if user asks for it explicitly.

stacks_seen

Module contents

Implementation of strides used to filter out resolved stacks.

class thoth.adviser.strides.OneVersionStride(version_seen: Optional[str] = None, *, configuration: Dict[str, Any] = NOTHING, name: str = None)[source]

Bases: thoth.adviser.stride.Stride

Filter out software stacks allowing the pipeline to produce just one software stack with specific package.

CONFIGURATION_DEFAULT = {'only_once': True, 'package_name': None}
pre_run() → None[source]

Initialize internal state of the unit.

run(state: thoth.adviser.state.State) → None[source]

Filter out software stacks, allow only a package with specific version being produced just once.

classmethod should_include(builder_context: PipelineBuilderContext) → Optional[Dict[str, Any]][source]

Include this pipeline unit only if user asks for it explicitly.

version_seen
class thoth.adviser.strides.RandomDecisionStride(*, configuration: Dict[str, Any] = NOTHING, name: str = None)[source]

Bases: thoth.adviser.stride.Stride

Filter out states randomly.

run(state: thoth.adviser.state.State) → None[source]

Flip a coin and decide - tails are not acceptable.

classmethod should_include(builder_context: PipelineBuilderContext) → Optional[Dict[str, Any]][source]

Allow inclusion only per user request.

class thoth.adviser.strides.UniqueStackStride(*, configuration: Dict[str, Any] = NOTHING, name: str = None)[source]

Bases: thoth.adviser.stride.Stride

Filter out software stacks that were already resolved.

As dependency graphs can share nodes, it might happen that the same software stack can be resolved multiple times considering different resolution paths.

pre_run() → None[source]

Initialize internal state of the unit.

run(state: thoth.adviser.state.State) → None[source]

Filter out software stacks that were already resolved.

classmethod should_include(builder_context: PipelineBuilderContext) → Optional[Dict[str, Any]][source]

Include this pipeline unit only if user asks for it explicitly.

stacks_seen