thoth.adviser.python.pipeline.strides package

Submodules

thoth.adviser.python.pipeline.strides.cve module

Penalize stacks with a CVE.

class thoth.adviser.python.pipeline.strides.cve.CveScoring(graph: thoth.storages.graph.postgres.GraphDatabase, project: thoth.python.project.Project, library_usage: dict = NOTHING, parameters: dict = NOTHING, name: str = None)[source]

Bases: thoth.adviser.python.pipeline.stride.Stride

Penalization based on CVE being present in stack.

PARAMETERS_DEFAULT = {'cve_penalization': -0.2}
run(stride_context: thoth.adviser.python.pipeline.stride_context.StrideContext) → None[source]

Score stacks with a CVE in a negative way.

thoth.adviser.python.pipeline.strides.random_decision module

Filter out stacks randomly.

class thoth.adviser.python.pipeline.strides.random_decision.RandomDecision(graph: thoth.storages.graph.postgres.GraphDatabase, project: thoth.python.project.Project, library_usage: dict = NOTHING, parameters: dict = NOTHING, name: str = None)[source]

Bases: thoth.adviser.python.pipeline.stride.Stride

Filtering of stacks which encountered runtime errors.

run(stride_context: thoth.adviser.python.pipeline.stride_context.StrideContext) → None[source]

Filter out packages which have runtime errors.

thoth.adviser.python.pipeline.strides.score_filter module

Filter out stacks which have same score.

This stride is used to filter out duplicate stacks - stacks which have same score, but differ only in a package which does not affect the overall score in any way. As we preserve order of versions based on semver, we accept the very first stack and the subsequent ones are checked against score which was given to the accepted stack. If score does not differ it means stacks differ in a package which did not differentiate stack scores. The first accepted has newer packages (as we respect semver ordering), the latter ones have older packages. The heuristic is to provide as latest stack as possible.

class thoth.adviser.python.pipeline.strides.score_filter.ScoreFiltering(graph: thoth.storages.graph.postgres.GraphDatabase, project: thoth.python.project.Project, library_usage: dict = NOTHING, parameters: dict = NOTHING, name: str = None)[source]

Bases: thoth.adviser.python.pipeline.stride.Stride

Filtering of stacks which encountered runtime errors.

run(stride_context: thoth.adviser.python.pipeline.stride_context.StrideContext) → None[source]

Filter out packages which have runtime errors.

Module contents

Implementation of strides used to filter out resolved stacks.