thoth.adviser.python.pipeline.steps package

Submodules

thoth.adviser.python.pipeline.steps.buildtime_error module

Filter out stacks which have buildtime errors.

class thoth.adviser.python.pipeline.steps.buildtime_error.BuildtimeErrorFiltering(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.step.Step

Filtering of stacks which have errors.

run(step_context: thoth.adviser.python.pipeline.step_context.StepContext) → None[source]

Filter out packages which have buildtime errors.

thoth.adviser.python.pipeline.steps.cve module

Penalize stacks with a CVE.

class thoth.adviser.python.pipeline.steps.cve.CvePenalization(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.step.Step

Penalization based on CVE being present in stack.

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

Penalize stacks with a CVE.

thoth.adviser.python.pipeline.steps.limit_latest_versions module

Limit number of latest versions considered when resolving software stacks.

This way we reduce number of nodes traversed in the graph traversal. This step has to be run after the semver sorting step so that packages are sorted according to semver and before any scoring (as score gets discarded).

class thoth.adviser.python.pipeline.steps.limit_latest_versions.LimitLatestVersions(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.step.Step

Limit number of latest versions considered when resolving software stacks.

PARAMETERS_DEFAULT = {'limit_latest_versions': 5}
run(step_context: thoth.adviser.python.pipeline.step_context.StepContext) → None[source]

Remove old versions of dependencies, consider only desired count of latest versions.

We traverse available paths horizontally and we check each package version in paths in the same column. If there are present more versions then the limit provided, paths with additional versions are discarded. A prerequisite for this function is to have paths sorted according to semver.

thoth.adviser.python.pipeline.steps.observation_reduction module

A pipeline step which eliminates sub-graphs that have no observation or observation bellow threshold.

This way we (in most cases) significantly reduce number of traversed nodes in stack producer.

class thoth.adviser.python.pipeline.steps.observation_reduction.ObservationReduction(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.step.Step

Remove not scored sub-graphs which do not observations or they have observations bellow threshold.

PARAMETERS_DEFAULT = {'score_threshold': 0.0}
run(step_context: thoth.adviser.python.pipeline.step_context.StepContext) → None[source]

Remove sub-graphs based on score threshold.

thoth.adviser.python.pipeline.steps.prereleases module

A step which cuts down pre-releases in paths if user does not want them.

class thoth.adviser.python.pipeline.steps.prereleases.CutPreReleases(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.step.Step

Cut-off pre-releases if project does not explicitly allows them.

run(step_context: thoth.adviser.python.pipeline.step_context.StepContext)[source]

Cut-off pre-releases if project does not explicitly allows them.

thoth.adviser.python.pipeline.steps.restrict_indexes module

A step which removes indexes which should not be taken into account.

class thoth.adviser.python.pipeline.steps.restrict_indexes.RestrictIndexes(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.step.Step

Remove indexes from which packages should not be present in generated stacks.

run(step_context: thoth.adviser.python.pipeline.step_context.StepContext)[source]

Remove indexes from which packages should not be present in generated stacks.

thoth.adviser.python.pipeline.steps.runtime_error module

Filter out stacks which have runtime errors.

class thoth.adviser.python.pipeline.steps.runtime_error.RuntimeErrorFiltering(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.step.Step

Filtering of stacks which encountered runtime errors.

run(step_context: thoth.adviser.python.pipeline.step_context.StepContext) → None[source]

Filter out packages which have runtime errors.

thoth.adviser.python.pipeline.steps.score_cutoff module

Limit number of latest versions considered when resolving software stacks.

This way we reduce number of nodes traversed in the graph traversal. This step has to be run after the semver sorting step so that packages are sorted according to semver and before any scoring (as score gets discarded).

class thoth.adviser.python.pipeline.steps.score_cutoff.ScoreCutoff(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.step.Step

Cut off parts of dependency graph which have score bellow the given threshold.

PARAMETERS_DEFAULT = {'threshold': -0.1}
run(step_context: thoth.adviser.python.pipeline.step_context.StepContext) → None[source]

Cut off parts of dependency graph which have score bellow the given threshold.

thoth.adviser.python.pipeline.steps.semver_sort module

Sort paths according to semver to preserve generation of packages - latest first.

class thoth.adviser.python.pipeline.steps.semver_sort.SemverSort(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.step.Step

Sort paths based on semver.

run(step_context: thoth.adviser.python.pipeline.step_context.StepContext)[source]

Sort paths in context based on semver of packages.

thoth.adviser.python.pipeline.steps.toolchain module

A step which reduces some of the toolchains to make sure they are always locked to a latest working version.

class thoth.adviser.python.pipeline.steps.toolchain.CutToolchain(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.step.Step

Cut off packages which are toolchain.

If packages considered in the “toolchain” group are present as direct dependencies, they are not removed.

is_toolchain(package_tuple: Tuple[str, str, str])[source]

Check if the given package is a toolchain package.

run(step_context: thoth.adviser.python.pipeline.step_context.StepContext)[source]

Cut off packages from toolchain.

thoth.adviser.python.pipeline.steps.unreachable module

Cut off unreachable dependencies - dependencies we know will never be resolved.

class thoth.adviser.python.pipeline.steps.unreachable.CutUnreachable(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.step.Step

Cut off dependencies we know will never be resolved.

run(step_context: thoth.adviser.python.pipeline.step_context.StepContext) → None[source]

Cut unreachable dependencies.

thoth.adviser.python.pipeline.steps.unsolved module

Cut off unsolved packages from dependency graph.

class thoth.adviser.python.pipeline.steps.unsolved.CutUnsolved(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.step.Step

Cut off parts of dependency graph which are not yet solved - remove unsolved packages.

run(step_context: thoth.adviser.python.pipeline.step_context.StepContext) → None[source]

Cut off parts of dependency graph which are not yet solved.

Module contents

Implementation of steps used in stack generators pipeline.