thoth.adviser.sieves package

Submodules

thoth.adviser.sieves.abi_compat module

Filter out stacks which have require non-existent ABI symbols.

class thoth.adviser.sieves.abi_compat.AbiCompatibilitySieve(image_symbols: Set = NOTHING, *, configuration: Dict[str, Any] = NOTHING, name: str = None)[source]

Bases: thoth.adviser.sieve.Sieve

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

image_symbols
pre_run()[source]

Initialize image_symbols.

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

If package requires non-present symbols remove it.

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

Include sieve which checks for abi compatability.

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(*, configuration: Dict[str, Any] = NOTHING, name: str = None)[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 = {'index_url': None, 'package_name': None}
CONFIGURATION_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) → Optional[Dict[str, Any]][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(*, configuration: Dict[str, Any] = NOTHING, name: str = None, cached_records: Dict[str, Optional[bool]] = NOTHING)[source]

Bases: thoth.adviser.sieve.Sieve

Filter out disabled Python package indexes.

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) → Optional[Dict[str, Any]][source]

Remove indexes which are not enabled in pipeline configuration.

thoth.adviser.sieves.locked module

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

class thoth.adviser.sieves.locked.CutLockedSieve(*, configuration: Dict[str, Any] = NOTHING, name: str = None)[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.

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) → Optional[Dict[str, Any]][source]

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

thoth.adviser.sieves.prereleases module

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

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

Bases: thoth.adviser.sieve.Sieve

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

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) → Optional[Dict[str, Any]][source]

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

thoth.adviser.sieves.solved module

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

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

Bases: thoth.adviser.sieve.Sieve

Filter out build time/installation errors of Python packages.

CONFIGURATION_DEFAULT = {'without_error': True}
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) → Optional[Dict[str, Any]][source]

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

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(specifier: Optional[packaging.specifiers.Specifier] = None, *, configuration: Dict[str, Any] = NOTHING, name: str = None)[source]

Bases: thoth.adviser.sieve.Sieve

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

CONFIGURATION_DEFAULT = {'package_name': None, 'version_specifier': None}
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) → Optional[Dict[str, Any]][source]

Include this sieve only if user explicitly asks for it.

Module contents

Implementation of sieves used in adviser pipeline.

class thoth.adviser.sieves.CutLockedSieve(*, configuration: Dict[str, Any] = NOTHING, name: str = None)[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.

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) → Optional[Dict[str, Any]][source]

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

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

Bases: thoth.adviser.sieve.Sieve

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

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) → Optional[Dict[str, Any]][source]

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

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

Bases: thoth.adviser.sieve.Sieve

Filter out disabled Python package indexes.

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) → Optional[Dict[str, Any]][source]

Remove indexes which are not enabled in pipeline configuration.

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

Bases: thoth.adviser.sieve.Sieve

Filter out build time/installation errors of Python packages.

CONFIGURATION_DEFAULT = {'without_error': True}
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) → Optional[Dict[str, Any]][source]

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

class thoth.adviser.sieves.VersionConstraintSieve(specifier: Optional[packaging.specifiers.Specifier] = None, *, configuration: Dict[str, Any] = NOTHING, name: str = None)[source]

Bases: thoth.adviser.sieve.Sieve

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

CONFIGURATION_DEFAULT = {'package_name': None, 'version_specifier': None}
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) → Optional[Dict[str, Any]][source]

Include this sieve only if user explicitly asks for it.

class thoth.adviser.sieves.AbiCompatibilitySieve(image_symbols: Set = NOTHING, *, configuration: Dict[str, Any] = NOTHING, name: str = None)[source]

Bases: thoth.adviser.sieve.Sieve

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

image_symbols
pre_run()[source]

Initialize image_symbols.

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

If package requires non-present symbols remove it.

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

Include sieve which checks for abi compatability.

class thoth.adviser.sieves.FilterIndexSieve(*, configuration: Dict[str, Any] = NOTHING, name: str = None)[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 = {'index_url': None, 'package_name': None}
CONFIGURATION_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) → Optional[Dict[str, Any]][source]

Register self, never.