thoth.adviser.sieves package

Subpackages

Submodules

thoth.adviser.sieves.constraints module

A sieve to filter out packages based on constraints supplied.

class thoth.adviser.sieves.constraints.ConstraintsSieve(*, unit_run: bool = False, configuration: Dict[str, Any] = NOTHING)[source]

Bases: thoth.adviser.sieve.Sieve

A sieve to filter out packages based on constraints supplied.

CONFIGURATION_DEFAULT: Dict[str, Any] = {'package_name': None}
CONFIGURATION_SCHEMA: voluptuous.schema_builder.Schema = <Schema({'package_name': <class 'str'>, 'specifier': <class 'str'>}, extra=PREVENT_EXTRA, required=False) object>
classmethod default_environment(builder_context: PipelineBuilderContext) Dict[str, str][source]

Get environment for markers based on runtime environment configuration supplied.

packages_seen
pre_run() None[source]

Initialize this pipeline unit before any resolution run.

run(package_versions: Generator[thoth.python.package_version.PackageVersion, None, None]) Generator[thoth.python.package_version.PackageVersion, None, None][source]

Cut-off packages that do not meet desired specifier in constraints.

classmethod should_include(builder_context: PipelineBuilderContext) Generator[Dict[str, Any], None, None][source]

Enable this pipeline unit if the adjustment is enabled.

specifier_set

thoth.adviser.sieves.cve module

Sieve packages with CVE when recommendation type is set to security.

class thoth.adviser.sieves.cve.CveSieve(*, unit_run: bool = False, configuration: Dict[str, Any] = NOTHING)[source]

Bases: thoth.adviser.sieve.Sieve

Filter out packages with CVEs.

CONFIGURATION_DEFAULT: Dict[str, Any] = {'package_name': None}
CONFIGURATION_SCHEMA: voluptuous.schema_builder.Schema = <Schema({'package_name': None}, extra=PREVENT_EXTRA, required=False) object>
pre_run() None[source]

Initialize this pipeline unit before running.

run(package_versions: Generator[thoth.python.package_version.PackageVersion, None, None]) Generator[thoth.python.package_version.PackageVersion, None, None][source]

Filter out packages with a CVE.

classmethod should_include(builder_context: PipelineBuilderContext) Generator[Dict[str, Any], None, None][source]

Remove CVEs only secure stacks.

thoth.adviser.sieves.experimental_filter_conf_index module

A sieve to filter out packages coming from other indexes than the ones configured.

class thoth.adviser.sieves.experimental_filter_conf_index.FilterConfiguredIndexSieve(*, unit_run: bool = False, configuration: Dict[str, Any] = NOTHING)[source]

Bases: thoth.adviser.sieve.Sieve

A sieve to filter out packages coming from other indexes than the ones configured.

CONFIGURATION_DEFAULT: Dict[str, Any] = {'allowed_indexes': None, 'package_name': None}
CONFIGURATION_SCHEMA: voluptuous.schema_builder.Schema = <Schema({'package_name': None, 'allowed_indexes': {<class 'str'>}}, extra=PREVENT_EXTRA, required=False) object>
packages_seen
pre_run() None[source]

Initialize this unit before each run.

run(package_versions: Generator[thoth.python.package_version.PackageVersion, None, None]) Generator[thoth.python.package_version.PackageVersion, None, None][source]

Cut-off packages that are not coming from an allowed index.

classmethod should_include(builder_context: PipelineBuilderContext) Generator[Dict[str, Any], None, None][source]

Enable this pipeline unit if the adjustment is enabled.

to_dict() Dict[str, Any][source]

Turn this pipeline step into its dictionary representation, override to have unit JSON serializable.

thoth.adviser.sieves.experimental_package_index module

A sieve to filter out packages based on index configuration.

class thoth.adviser.sieves.experimental_package_index.PackageIndexConfigurationSieve(*, unit_run: bool = False, configuration: Dict[str, Any] = NOTHING)[source]

Bases: thoth.adviser.sieve.Sieve

A sieve to filter out packages based on index configuration.

CONFIGURATION_DEFAULT: Dict[str, Any] = {'index_url': None, 'package_name': None}
CONFIGURATION_SCHEMA: voluptuous.schema_builder.Schema = <Schema({'package_name': <class 'str'>, 'index_url': <class 'str'>}, extra=PREVENT_EXTRA, required=False) object>
packages_seen
pre_run() None[source]

Initialize this pipeline unit before each run.

run(package_versions: Generator[thoth.python.package_version.PackageVersion, None, None]) Generator[thoth.python.package_version.PackageVersion, None, None][source]

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

classmethod should_include(builder_context: PipelineBuilderContext) Generator[Dict[str, Any], None, None][source]

Register for each package.

thoth.adviser.sieves.experimental_prereleases module

A sieve to filter out pre-releases, selectively.

class thoth.adviser.sieves.experimental_prereleases.SelectiveCutPreReleasesSieve(*, unit_run: bool = False, configuration: Dict[str, Any] = NOTHING)[source]

Bases: thoth.adviser.sieve.Sieve

Enable or disable specific pre-releases for the given set of packages..

CONFIGURATION_DEFAULT: Dict[str, Any] = {'allow_prereleases': None, 'package_name': None}
CONFIGURATION_SCHEMA: voluptuous.schema_builder.Schema = <Schema({'package_name': None, 'allow_prereleases': <Schema({<class 'str'>: <class 'bool'>}, extra=PREVENT_EXTRA, required=False) object>}, extra=PREVENT_EXTRA, required=False) object>
packages_seen
pre_run() None[source]

Initialize this pipeline unit before each run.

run(package_versions: Generator[thoth.python.package_version.PackageVersion, None, None]) Generator[thoth.python.package_version.PackageVersion, None, None][source]

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

classmethod should_include(builder_context: PipelineBuilderContext) Generator[Dict[str, Any], None, None][source]

Enable or disable specific pre-releases for the given set of packages..

thoth.adviser.sieves.filter_index module

A sieve to filter out packages based on Python package index configured.

class thoth.adviser.sieves.filter_index.FilterIndexSieve(*, unit_run: bool = False, configuration: Dict[str, Any] = NOTHING)[source]

Bases: thoth.adviser.sieve.Sieve

A sieve to filter out packages based on Python package index configured.

The filtering is done based on configuration supplied - per package-version. The sieve is configured using the following pipeline configuration entry:

{

“package_name”: “tensorflow”, “index_url”: [

]

}

CONFIGURATION_DEFAULT: Dict[str, Any] = {'index_url': None, 'package_name': None}
CONFIGURATION_SCHEMA: voluptuous.schema_builder.Schema = <Schema({'package_name': <class 'str'>, 'index_url': [<class 'str'>]}, extra=PREVENT_EXTRA, required=False) object>
run(package_versions: Generator[thoth.python.package_version.PackageVersion, None, None]) Generator[thoth.python.package_version.PackageVersion, None, None][source]

Filter out packages based on Python package index configured for the given package.

classmethod should_include(builder_context: PipelineBuilderContext) Generator[Dict[str, Any], None, None][source]

Register self, never.

thoth.adviser.sieves.index_enabled module

A sieve for filtering out disabled Python package indexes.

class thoth.adviser.sieves.index_enabled.PackageIndexSieve(*, unit_run: bool = False, configuration: Dict[str, Any] = NOTHING, cached_records: Dict[str, Optional[bool]] = NOTHING)[source]

Bases: thoth.adviser.sieve.Sieve

Filter out disabled Python package indexes.

CONFIGURATION_DEFAULT: Dict[str, Any] = {'package_name': None}
run(package_versions: Generator[thoth.python.package_version.PackageVersion, None, None]) Generator[thoth.python.package_version.PackageVersion, None, None][source]

Filter out package versions based on disabled Python package index.

classmethod should_include(builder_context: PipelineBuilderContext) Generator[Dict[str, Any], None, None][source]

Remove indexes which are not enabled in pipeline configuration.

thoth.adviser.sieves.legacy_version module

A sieve to filter out legacy versions.

class thoth.adviser.sieves.legacy_version.LegacyVersionSieve(*, unit_run: bool = False, configuration: Dict[str, Any] = NOTHING)[source]

Bases: thoth.adviser.sieve.Sieve

A sieve to filter out legacy versions.

This sieve assumes no recent projects use legacy versions hence we can simply skip them in the resolution process.

CONFIGURATION_DEFAULT: Dict[str, Any] = {'package_name': None}
pre_run() None[source]

Initialize this pipeline unit before each run.

run(package_versions: Generator[thoth.python.package_version.PackageVersion, None, None]) Generator[thoth.python.package_version.PackageVersion, None, None][source]

Cut-off legacy versions from the resolution process.

classmethod should_include(builder_context: PipelineBuilderContext) Generator[Dict[str, Any], None, None][source]

Include this sieve once, always.

thoth.adviser.sieves.locked module

A step to filter out packages that are pinned to a specific version.

class thoth.adviser.sieves.locked.CutLockedSieve(*, unit_run: bool = False, configuration: Dict[str, Any] = NOTHING)[source]

Bases: thoth.adviser.sieve.Sieve

Cut-off packages that are locked to a specific version.

If a project pins down a package to a specific release, respect that. Otherwise resolver does not need to find any resolved stack, especially considering only N latest versions and the pinned version is >=N+1 version.

CONFIGURATION_DEFAULT: Dict[str, Any] = {'package_name': None}
run(package_versions: Generator[thoth.python.package_version.PackageVersion, None, None]) Generator[thoth.python.package_version.PackageVersion, None, None][source]

Cut-off locked versions to a specific version.

classmethod should_include(builder_context: PipelineBuilderContext) Generator[Dict[str, Any], None, None][source]

Include cut-locked pipeline sieve for adviser or Dependency Monkey, always.

thoth.adviser.sieves.package_combinations module

A sieve to filter out packages respecting desired combinations that should be computed.

class thoth.adviser.sieves.package_combinations.PackageCombinationsSieve(*, unit_run: bool = False, configuration: Dict[str, Any] = NOTHING)[source]

Bases: thoth.adviser.sieve.Sieve

A sieve to filter out packages respecting desired combinations that should be computed.

CONFIGURATION_DEFAULT: Dict[str, Union[None, List[str]]] = {'package_combinations': [], 'package_name': None}
CONFIGURATION_SCHEMA: Schema = <Schema({'package_name': None, 'package_combinations': [<class 'str'>]}, extra=PREVENT_EXTRA, required=False) object>
pre_run() None[source]

Prepare for the actual run.

run(package_versions: Generator[thoth.python.package_version.PackageVersion, None, None]) Generator[thoth.python.package_version.PackageVersion, None, None][source]

Filter out packages based on Python package index configured for the given package.

classmethod should_include(builder_context: PipelineBuilderContext) Generator[Dict[str, Any], None, None][source]

Register self, never.

thoth.adviser.sieves.prereleases module

A sieve to filter out pre-releases in direct dependencies.

class thoth.adviser.sieves.prereleases.CutPreReleasesSieve(*, unit_run: bool = False, configuration: Dict[str, Any] = NOTHING)[source]

Bases: thoth.adviser.sieve.Sieve

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

CONFIGURATION_DEFAULT: Dict[str, Any] = {'package_name': None}
run(package_versions: Generator[thoth.python.package_version.PackageVersion, None, None]) Generator[thoth.python.package_version.PackageVersion, None, None][source]

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

classmethod should_include(builder_context: PipelineBuilderContext) Generator[Dict[str, Any], None, None][source]

Include cut-prereleases pipeline sieve for adviser or Dependency Monkey if pre-releases are not allowed.

thoth.adviser.sieves.rules module

A sieve for filtering out Python packages that have rules assigned.

class thoth.adviser.sieves.rules.SolverRulesSieve(*, unit_run: bool = False, configuration: Dict[str, Any] = NOTHING)[source]

Bases: thoth.adviser.sieve.Sieve

A sieve for filtering out Python packages that have rules assigned.

CONFIGURATION_DEFAULT: Dict[str, Any] = {'package_name': None}
CONFIGURATION_SCHEMA: voluptuous.schema_builder.Schema = <Schema({'package_name': Any(<class 'str'>, None, msg=None)}, extra=PREVENT_EXTRA, required=False) object>
pre_run() None[source]

Initialize this pipeline unit before each run.

run(package_versions: Generator[thoth.python.package_version.PackageVersion, None, None]) Generator[thoth.python.package_version.PackageVersion, None, None][source]

Filter out packages that have rules assigned.

classmethod should_include(builder_context: PipelineBuilderContext) Generator[Dict[str, Any], None, None][source]

Include pipeline sieve.

thoth.adviser.sieves.solved module

A sieve for filtering out build time/installation errors of Python packages.

class thoth.adviser.sieves.solved.SolvedSieve(*, unit_run: bool = False, configuration: Dict[str, Any] = NOTHING)[source]

Bases: thoth.adviser.sieve.Sieve

Filter out build time/installation errors of Python packages.

CONFIGURATION_DEFAULT: Dict[str, Any] = {'package_name': None, 'without_error': True}
CONFIGURATION_SCHEMA: voluptuous.schema_builder.Schema = <Schema({'package_name': Any(<class 'str'>, None, msg=None), 'without_error': <class 'bool'>}, extra=PREVENT_EXTRA, required=False) object>
post_run() None[source]

Post-run method for wrapping up the work.

pre_run() None[source]

Initialize this pipeline unit before each run.

run(package_versions: Generator[thoth.python.package_version.PackageVersion, None, None]) Generator[thoth.python.package_version.PackageVersion, None, None][source]

Filter out packages based on build time/installation issues..

classmethod should_include(builder_context: PipelineBuilderContext) Generator[Dict[str, Any], None, None][source]

Include solved pipeline sieve for adviser or Dependency Monkey on pipeline creation.

thoth.adviser.sieves.thoth_s2i_abi_compat module

Filter out stacks which have require non-existent ABI symbols in Thoth’s s2i base image.

class thoth.adviser.sieves.thoth_s2i_abi_compat.ThothS2IAbiCompatibilitySieve(*, unit_run: bool = False, configuration: Dict[str, Any] = NOTHING)[source]

Bases: thoth.adviser.sieve.Sieve

Remove packages if the Thoth’s s2i image being used doesn’t have necessary ABI.

CONFIGURATION_DEFAULT: Dict[str, Any] = {'package_name': None}
image_symbols
pre_run() None[source]

Initialize image_symbols.

run(package_versions: Generator[thoth.python.package_version.PackageVersion, None, None]) Generator[thoth.python.package_version.PackageVersion, None, None][source]

If package requires non-present symbols remove it.

classmethod should_include(builder_context: PipelineBuilderContext) Generator[Dict[str, Any], None, None][source]

Register if the base image provided is Thoth’s s2i.

thoth.adviser.sieves.thoth_s2i_packages module

A sieve that makes sure packages shipped inside an s2i container are reused.

An example can be a Jupyter Notebook image that has TensorFlow pre-installed. As this image is supposed to be “supported”, TensorFlow that is present should be reused, rather than re-installed to another version.

class thoth.adviser.sieves.thoth_s2i_packages.ThothS2IPackagesSieve(*, unit_run: bool = False, configuration: Dict[str, Any] = NOTHING)[source]

Bases: thoth.adviser.sieve.Sieve

Remove packages that are already present in s2i image.

CONFIGURATION_DEFAULT: Dict[str, Any] = {'package_name': None}
CONFIGURATION_SCHEMA: voluptuous.schema_builder.Schema = <Schema({'package_name': <class 'str'>, 'package_version': <class 'str'>}, extra=PREVENT_EXTRA, required=False) object>
pre_run() None[source]

Initialize before running the pipeline unit.

run(package_versions: Generator[thoth.python.package_version.PackageVersion, None, None]) Generator[thoth.python.package_version.PackageVersion, None, None][source]

If a package does not meet version already present in the base image, remove it.

classmethod should_include(builder_context: PipelineBuilderContext) Generator[Dict[str, Any], None, None][source]

Register if the base image provided is Thoth’s s2i.

thoth.adviser.sieves.update module

A sieve for filtering out Python packages that are not part of a new release.

This pipeline unit is registered only if adviser was requested to run to check a new package release. The pipeline unit filters out all the packages except for the one that should be included in the stack (the newly released) to check whether there is a stack with the released package that is better than the one used with an older release.

class thoth.adviser.sieves.update.PackageUpdateSieve(*, unit_run: bool = False, configuration: Dict[str, Any] = NOTHING)[source]

Bases: thoth.adviser.sieve.Sieve

A sieve for filtering out Python packages that are not part of a new release.

CONFIGURATION_DEFAULT: Dict[str, Any] = {'index_url': None, 'package_name': None, 'package_version': None}
CONFIGURATION_SCHEMA: voluptuous.schema_builder.Schema = <Schema({'package_name': <class 'str'>, 'package_version': <class 'str'>, 'index_url': <class 'str'>}, extra=PREVENT_EXTRA, required=False) object>
pre_run() None[source]

Initialize this pipeline unit before each run.

run(package_versions: Generator[thoth.python.package_version.PackageVersion, None, None]) Generator[thoth.python.package_version.PackageVersion, None, None][source]

Filter out packages that are old releases.

classmethod should_include(builder_context: PipelineBuilderContext) Generator[Dict[str, Any], None, None][source]

Include pipeline sieve.

thoth.adviser.sieves.version_constraint module

A sieve for filtering packages based on constraints.

This sieve will filter out packages in specific versions if they occur in the resolved stack.

class thoth.adviser.sieves.version_constraint.VersionConstraintSieve(*, unit_run: bool = False, configuration: Dict[str, Any] = NOTHING)[source]

Bases: thoth.adviser.sieve.Sieve

Filter out packages based on version constraints if they occur in the stack.

CONFIGURATION_DEFAULT: Dict[str, Any] = {'package_name': None, 'version_specifier': None}
CONFIGURATION_SCHEMA: voluptuous.schema_builder.Schema = <Schema({'package_name': <class 'str'>, 'version_specifier': <class 'str'>}, extra=PREVENT_EXTRA, required=False) object>
pre_run() None[source]

Parse and initialize specifier used.

run(package_versions: Generator[thoth.python.package_version.PackageVersion, None, None]) Generator[thoth.python.package_version.PackageVersion, None, None][source]

Filter out packages based on build time/installation issues..

classmethod should_include(builder_context: PipelineBuilderContext) Generator[Dict[str, Any], None, None][source]

Include this sieve only if user explicitly asks for it.

Module contents

Implementation of sieves used in adviser pipeline.

class thoth.adviser.sieves.ConstraintsSieve(*, unit_run: bool = False, configuration: Dict[str, Any] = NOTHING)[source]

Bases: thoth.adviser.sieve.Sieve

A sieve to filter out packages based on constraints supplied.

CONFIGURATION_DEFAULT: Dict[str, Any] = {'package_name': None}
CONFIGURATION_SCHEMA: voluptuous.schema_builder.Schema = <Schema({'package_name': <class 'str'>, 'specifier': <class 'str'>}, extra=PREVENT_EXTRA, required=False) object>
classmethod default_environment(builder_context: PipelineBuilderContext) Dict[str, str][source]

Get environment for markers based on runtime environment configuration supplied.

packages_seen
pre_run() None[source]

Initialize this pipeline unit before any resolution run.

run(package_versions: Generator[thoth.python.package_version.PackageVersion, None, None]) Generator[thoth.python.package_version.PackageVersion, None, None][source]

Cut-off packages that do not meet desired specifier in constraints.

classmethod should_include(builder_context: PipelineBuilderContext) Generator[Dict[str, Any], None, None][source]

Enable this pipeline unit if the adjustment is enabled.

specifier_set
class thoth.adviser.sieves.CutLockedSieve(*, unit_run: bool = False, configuration: Dict[str, Any] = NOTHING)[source]

Bases: thoth.adviser.sieve.Sieve

Cut-off packages that are locked to a specific version.

If a project pins down a package to a specific release, respect that. Otherwise resolver does not need to find any resolved stack, especially considering only N latest versions and the pinned version is >=N+1 version.

CONFIGURATION_DEFAULT: Dict[str, Any] = {'package_name': None}
run(package_versions: Generator[thoth.python.package_version.PackageVersion, None, None]) Generator[thoth.python.package_version.PackageVersion, None, None][source]

Cut-off locked versions to a specific version.

classmethod should_include(builder_context: PipelineBuilderContext) Generator[Dict[str, Any], None, None][source]

Include cut-locked pipeline sieve for adviser or Dependency Monkey, always.

class thoth.adviser.sieves.CutPreReleasesSieve(*, unit_run: bool = False, configuration: Dict[str, Any] = NOTHING)[source]

Bases: thoth.adviser.sieve.Sieve

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

CONFIGURATION_DEFAULT: Dict[str, Any] = {'package_name': None}
run(package_versions: Generator[thoth.python.package_version.PackageVersion, None, None]) Generator[thoth.python.package_version.PackageVersion, None, None][source]

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

classmethod should_include(builder_context: PipelineBuilderContext) Generator[Dict[str, Any], None, None][source]

Include cut-prereleases pipeline sieve for adviser or Dependency Monkey if pre-releases are not allowed.

class thoth.adviser.sieves.CveSieve(*, unit_run: bool = False, configuration: Dict[str, Any] = NOTHING)[source]

Bases: thoth.adviser.sieve.Sieve

Filter out packages with CVEs.

CONFIGURATION_DEFAULT: Dict[str, Any] = {'package_name': None}
CONFIGURATION_SCHEMA: voluptuous.schema_builder.Schema = <Schema({'package_name': None}, extra=PREVENT_EXTRA, required=False) object>
pre_run() None[source]

Initialize this pipeline unit before running.

run(package_versions: Generator[thoth.python.package_version.PackageVersion, None, None]) Generator[thoth.python.package_version.PackageVersion, None, None][source]

Filter out packages with a CVE.

classmethod should_include(builder_context: PipelineBuilderContext) Generator[Dict[str, Any], None, None][source]

Remove CVEs only secure stacks.

class thoth.adviser.sieves.FilterConfiguredIndexSieve(*, unit_run: bool = False, configuration: Dict[str, Any] = NOTHING)[source]

Bases: thoth.adviser.sieve.Sieve

A sieve to filter out packages coming from other indexes than the ones configured.

CONFIGURATION_DEFAULT: Dict[str, Any] = {'allowed_indexes': None, 'package_name': None}
CONFIGURATION_SCHEMA: voluptuous.schema_builder.Schema = <Schema({'package_name': None, 'allowed_indexes': {<class 'str'>}}, extra=PREVENT_EXTRA, required=False) object>
packages_seen
pre_run() None[source]

Initialize this unit before each run.

run(package_versions: Generator[thoth.python.package_version.PackageVersion, None, None]) Generator[thoth.python.package_version.PackageVersion, None, None][source]

Cut-off packages that are not coming from an allowed index.

classmethod should_include(builder_context: PipelineBuilderContext) Generator[Dict[str, Any], None, None][source]

Enable this pipeline unit if the adjustment is enabled.

to_dict() Dict[str, Any][source]

Turn this pipeline step into its dictionary representation, override to have unit JSON serializable.

class thoth.adviser.sieves.FilterIndexSieve(*, unit_run: bool = False, configuration: Dict[str, Any] = NOTHING)[source]

Bases: thoth.adviser.sieve.Sieve

A sieve to filter out packages based on Python package index configured.

The filtering is done based on configuration supplied - per package-version. The sieve is configured using the following pipeline configuration entry:

{

“package_name”: “tensorflow”, “index_url”: [

]

}

CONFIGURATION_DEFAULT: Dict[str, Any] = {'index_url': None, 'package_name': None}
CONFIGURATION_SCHEMA: voluptuous.schema_builder.Schema = <Schema({'package_name': <class 'str'>, 'index_url': [<class 'str'>]}, extra=PREVENT_EXTRA, required=False) object>
run(package_versions: Generator[thoth.python.package_version.PackageVersion, None, None]) Generator[thoth.python.package_version.PackageVersion, None, None][source]

Filter out packages based on Python package index configured for the given package.

classmethod should_include(builder_context: PipelineBuilderContext) Generator[Dict[str, Any], None, None][source]

Register self, never.

class thoth.adviser.sieves.LegacyVersionSieve(*, unit_run: bool = False, configuration: Dict[str, Any] = NOTHING)[source]

Bases: thoth.adviser.sieve.Sieve

A sieve to filter out legacy versions.

This sieve assumes no recent projects use legacy versions hence we can simply skip them in the resolution process.

CONFIGURATION_DEFAULT: Dict[str, Any] = {'package_name': None}
pre_run() None[source]

Initialize this pipeline unit before each run.

run(package_versions: Generator[thoth.python.package_version.PackageVersion, None, None]) Generator[thoth.python.package_version.PackageVersion, None, None][source]

Cut-off legacy versions from the resolution process.

classmethod should_include(builder_context: PipelineBuilderContext) Generator[Dict[str, Any], None, None][source]

Include this sieve once, always.

class thoth.adviser.sieves.NoPulpIndexLabelSieve(*, unit_run: bool = False, configuration: Dict[str, Any] = NOTHING)[source]

Bases: thoth.adviser.sieves._pulp.index_label.PulpIndexLabelSieve

A sieve that filters out packages that come from Operate First Pulp instance.

run(package_versions: Generator[thoth.python.package_version.PackageVersion, None, None]) Generator[thoth.python.package_version.PackageVersion, None, None][source]

Remove any packages that do not come from the Pulp instance.

classmethod should_include(builder_context: PipelineBuilderContext) Generator[Dict[Any, Any], None, None][source]

Include this wrap in adviser, if label pulp-index=disabled is used.

class thoth.adviser.sieves.PackageCombinationsSieve(*, unit_run: bool = False, configuration: Dict[str, Any] = NOTHING)[source]

Bases: thoth.adviser.sieve.Sieve

A sieve to filter out packages respecting desired combinations that should be computed.

CONFIGURATION_DEFAULT: Dict[str, Union[None, List[str]]] = {'package_combinations': [], 'package_name': None}
CONFIGURATION_SCHEMA: Schema = <Schema({'package_name': None, 'package_combinations': [<class 'str'>]}, extra=PREVENT_EXTRA, required=False) object>
pre_run() None[source]

Prepare for the actual run.

run(package_versions: Generator[thoth.python.package_version.PackageVersion, None, None]) Generator[thoth.python.package_version.PackageVersion, None, None][source]

Filter out packages based on Python package index configured for the given package.

classmethod should_include(builder_context: PipelineBuilderContext) Generator[Dict[str, Any], None, None][source]

Register self, never.

class thoth.adviser.sieves.PackageIndexConfigurationSieve(*, unit_run: bool = False, configuration: Dict[str, Any] = NOTHING)[source]

Bases: thoth.adviser.sieve.Sieve

A sieve to filter out packages based on index configuration.

CONFIGURATION_DEFAULT: Dict[str, Any] = {'index_url': None, 'package_name': None}
CONFIGURATION_SCHEMA: voluptuous.schema_builder.Schema = <Schema({'package_name': <class 'str'>, 'index_url': <class 'str'>}, extra=PREVENT_EXTRA, required=False) object>
packages_seen
pre_run() None[source]

Initialize this pipeline unit before each run.

run(package_versions: Generator[thoth.python.package_version.PackageVersion, None, None]) Generator[thoth.python.package_version.PackageVersion, None, None][source]

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

classmethod should_include(builder_context: PipelineBuilderContext) Generator[Dict[str, Any], None, None][source]

Register for each package.

class thoth.adviser.sieves.PackageIndexSieve(*, unit_run: bool = False, configuration: Dict[str, Any] = NOTHING, cached_records: Dict[str, Optional[bool]] = NOTHING)[source]

Bases: thoth.adviser.sieve.Sieve

Filter out disabled Python package indexes.

CONFIGURATION_DEFAULT: Dict[str, Any] = {'package_name': None}
run(package_versions: Generator[thoth.python.package_version.PackageVersion, None, None]) Generator[thoth.python.package_version.PackageVersion, None, None][source]

Filter out package versions based on disabled Python package index.

classmethod should_include(builder_context: PipelineBuilderContext) Generator[Dict[str, Any], None, None][source]

Remove indexes which are not enabled in pipeline configuration.

class thoth.adviser.sieves.PackageUpdateSieve(*, unit_run: bool = False, configuration: Dict[str, Any] = NOTHING)[source]

Bases: thoth.adviser.sieve.Sieve

A sieve for filtering out Python packages that are not part of a new release.

CONFIGURATION_DEFAULT: Dict[str, Any] = {'index_url': None, 'package_name': None, 'package_version': None}
CONFIGURATION_SCHEMA: voluptuous.schema_builder.Schema = <Schema({'package_name': <class 'str'>, 'package_version': <class 'str'>, 'index_url': <class 'str'>}, extra=PREVENT_EXTRA, required=False) object>
pre_run() None[source]

Initialize this pipeline unit before each run.

run(package_versions: Generator[thoth.python.package_version.PackageVersion, None, None]) Generator[thoth.python.package_version.PackageVersion, None, None][source]

Filter out packages that are old releases.

classmethod should_include(builder_context: PipelineBuilderContext) Generator[Dict[str, Any], None, None][source]

Include pipeline sieve.

class thoth.adviser.sieves.PulpIndexLabelSieve(*, unit_run: bool = False, configuration: Dict[str, Any] = NOTHING)[source]

Bases: thoth.adviser.sieve.Sieve

A sieve that filters out packages that do not come from Operate First Pulp instance.

pre_run() None[source]

Add information about Pulp use to stack information.

run(package_versions: Generator[thoth.python.package_version.PackageVersion, None, None]) Generator[thoth.python.package_version.PackageVersion, None, None][source]

Remove any packages that do not come from the Pulp instance.

classmethod should_include(builder_context: PipelineBuilderContext) Generator[Dict[Any, Any], None, None][source]

Include this wrap in adviser, if label pulp-index=solely is used.

class thoth.adviser.sieves.SelectiveCutPreReleasesSieve(*, unit_run: bool = False, configuration: Dict[str, Any] = NOTHING)[source]

Bases: thoth.adviser.sieve.Sieve

Enable or disable specific pre-releases for the given set of packages..

CONFIGURATION_DEFAULT: Dict[str, Any] = {'allow_prereleases': None, 'package_name': None}
CONFIGURATION_SCHEMA: voluptuous.schema_builder.Schema = <Schema({'package_name': None, 'allow_prereleases': <Schema({<class 'str'>: <class 'bool'>}, extra=PREVENT_EXTRA, required=False) object>}, extra=PREVENT_EXTRA, required=False) object>
packages_seen
pre_run() None[source]

Initialize this pipeline unit before each run.

run(package_versions: Generator[thoth.python.package_version.PackageVersion, None, None]) Generator[thoth.python.package_version.PackageVersion, None, None][source]

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

classmethod should_include(builder_context: PipelineBuilderContext) Generator[Dict[str, Any], None, None][source]

Enable or disable specific pre-releases for the given set of packages..

class thoth.adviser.sieves.SolvedSieve(*, unit_run: bool = False, configuration: Dict[str, Any] = NOTHING)[source]

Bases: thoth.adviser.sieve.Sieve

Filter out build time/installation errors of Python packages.

CONFIGURATION_DEFAULT: Dict[str, Any] = {'package_name': None, 'without_error': True}
CONFIGURATION_SCHEMA: voluptuous.schema_builder.Schema = <Schema({'package_name': Any(<class 'str'>, None, msg=None), 'without_error': <class 'bool'>}, extra=PREVENT_EXTRA, required=False) object>
post_run() None[source]

Post-run method for wrapping up the work.

pre_run() None[source]

Initialize this pipeline unit before each run.

run(package_versions: Generator[thoth.python.package_version.PackageVersion, None, None]) Generator[thoth.python.package_version.PackageVersion, None, None][source]

Filter out packages based on build time/installation issues..

classmethod should_include(builder_context: PipelineBuilderContext) Generator[Dict[str, Any], None, None][source]

Include solved pipeline sieve for adviser or Dependency Monkey on pipeline creation.

class thoth.adviser.sieves.SolverRulesSieve(*, unit_run: bool = False, configuration: Dict[str, Any] = NOTHING)[source]

Bases: thoth.adviser.sieve.Sieve

A sieve for filtering out Python packages that have rules assigned.

CONFIGURATION_DEFAULT: Dict[str, Any] = {'package_name': None}
CONFIGURATION_SCHEMA: voluptuous.schema_builder.Schema = <Schema({'package_name': Any(<class 'str'>, None, msg=None)}, extra=PREVENT_EXTRA, required=False) object>
pre_run() None[source]

Initialize this pipeline unit before each run.

run(package_versions: Generator[thoth.python.package_version.PackageVersion, None, None]) Generator[thoth.python.package_version.PackageVersion, None, None][source]

Filter out packages that have rules assigned.

classmethod should_include(builder_context: PipelineBuilderContext) Generator[Dict[str, Any], None, None][source]

Include pipeline sieve.

class thoth.adviser.sieves.TensorFlowAPISieve(*, unit_run: bool = False, configuration: Dict[str, Any] = NOTHING)[source]

Bases: thoth.adviser.sieve.Sieve

A sieve that makes sure the right TensorFlow release is used based on user’s API usage.

CONFIGURATION_DEFAULT: Dict[str, Any] = {'package_name': 'tensorflow'}
CONFIGURATION_SCHEMA: voluptuous.schema_builder.Schema = <Schema({'package_name': Any(<class 'str'>, msg=None)}, extra=PREVENT_EXTRA, required=False) object>
pre_run() None[source]

Initialize this pipeline unit before each run.

run(package_versions: Generator[thoth.python.package_version.PackageVersion, None, None]) Generator[thoth.python.package_version.PackageVersion, None, None][source]

Use specific TensorFlow release based on library usage as supplied by the user.

classmethod should_include(builder_context: PipelineBuilderContext) Generator[Dict[str, Any], None, None][source]

Register this pipeline unit for adviser library usage is provided.

class thoth.adviser.sieves.ThothS2IAbiCompatibilitySieve(*, unit_run: bool = False, configuration: Dict[str, Any] = NOTHING)[source]

Bases: thoth.adviser.sieve.Sieve

Remove packages if the Thoth’s s2i image being used doesn’t have necessary ABI.

CONFIGURATION_DEFAULT: Dict[str, Any] = {'package_name': None}
image_symbols
pre_run() None[source]

Initialize image_symbols.

run(package_versions: Generator[thoth.python.package_version.PackageVersion, None, None]) Generator[thoth.python.package_version.PackageVersion, None, None][source]

If package requires non-present symbols remove it.

classmethod should_include(builder_context: PipelineBuilderContext) Generator[Dict[str, Any], None, None][source]

Register if the base image provided is Thoth’s s2i.

class thoth.adviser.sieves.ThothS2IPackagesSieve(*, unit_run: bool = False, configuration: Dict[str, Any] = NOTHING)[source]

Bases: thoth.adviser.sieve.Sieve

Remove packages that are already present in s2i image.

CONFIGURATION_DEFAULT: Dict[str, Any] = {'package_name': None}
CONFIGURATION_SCHEMA: voluptuous.schema_builder.Schema = <Schema({'package_name': <class 'str'>, 'package_version': <class 'str'>}, extra=PREVENT_EXTRA, required=False) object>
pre_run() None[source]

Initialize before running the pipeline unit.

run(package_versions: Generator[thoth.python.package_version.PackageVersion, None, None]) Generator[thoth.python.package_version.PackageVersion, None, None][source]

If a package does not meet version already present in the base image, remove it.

classmethod should_include(builder_context: PipelineBuilderContext) Generator[Dict[str, Any], None, None][source]

Register if the base image provided is Thoth’s s2i.

class thoth.adviser.sieves.VersionConstraintSieve(*, unit_run: bool = False, configuration: Dict[str, Any] = NOTHING)[source]

Bases: thoth.adviser.sieve.Sieve

Filter out packages based on version constraints if they occur in the stack.

CONFIGURATION_DEFAULT: Dict[str, Any] = {'package_name': None, 'version_specifier': None}
CONFIGURATION_SCHEMA: voluptuous.schema_builder.Schema = <Schema({'package_name': <class 'str'>, 'version_specifier': <class 'str'>}, extra=PREVENT_EXTRA, required=False) object>
pre_run() None[source]

Parse and initialize specifier used.

run(package_versions: Generator[thoth.python.package_version.PackageVersion, None, None]) Generator[thoth.python.package_version.PackageVersion, None, None][source]

Filter out packages based on build time/installation issues..

classmethod should_include(builder_context: PipelineBuilderContext) Generator[Dict[str, Any], None, None][source]

Include this sieve only if user explicitly asks for it.