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_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¶
- 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_SCHEMA: voluptuous.schema_builder.Schema = <Schema({'package_name': None}, extra=PREVENT_EXTRA, required=False) object>¶
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_SCHEMA: voluptuous.schema_builder.Schema = <Schema({'package_name': None, 'allowed_indexes': {<class 'str'>}}, extra=PREVENT_EXTRA, required=False) object>¶
- packages_seen¶
- 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.
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_SCHEMA: voluptuous.schema_builder.Schema = <Schema({'package_name': <class 'str'>, 'index_url': <class 'str'>}, extra=PREVENT_EXTRA, required=False) object>¶
- packages_seen¶
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_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¶
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_SCHEMA: voluptuous.schema_builder.Schema = <Schema({'package_name': <class 'str'>, 'index_url': [<class 'str'>]}, extra=PREVENT_EXTRA, required=False) object>¶
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.
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.
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.
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>¶
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.
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_SCHEMA: voluptuous.schema_builder.Schema = <Schema({'package_name': Any(<class 'str'>, None, msg=None)}, extra=PREVENT_EXTRA, required=False) object>¶
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_SCHEMA: voluptuous.schema_builder.Schema = <Schema({'package_name': Any(<class 'str'>, None, msg=None), 'without_error': <class 'bool'>}, extra=PREVENT_EXTRA, required=False) object>¶
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.
- image_symbols¶
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_SCHEMA: voluptuous.schema_builder.Schema = <Schema({'package_name': <class 'str'>, 'package_version': <class 'str'>}, extra=PREVENT_EXTRA, required=False) object>¶
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>¶
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_SCHEMA: voluptuous.schema_builder.Schema = <Schema({'package_name': <class 'str'>, 'version_specifier': <class 'str'>}, extra=PREVENT_EXTRA, required=False) object>¶
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_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¶
- 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.
- 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.
- 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_SCHEMA: voluptuous.schema_builder.Schema = <Schema({'package_name': None}, extra=PREVENT_EXTRA, required=False) object>¶
- 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_SCHEMA: voluptuous.schema_builder.Schema = <Schema({'package_name': None, 'allowed_indexes': {<class 'str'>}}, extra=PREVENT_EXTRA, required=False) object>¶
- packages_seen¶
- 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.
- 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_SCHEMA: voluptuous.schema_builder.Schema = <Schema({'package_name': <class 'str'>, 'index_url': [<class 'str'>]}, extra=PREVENT_EXTRA, required=False) object>¶
- 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.
- 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.
- 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>¶
- 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_SCHEMA: voluptuous.schema_builder.Schema = <Schema({'package_name': <class 'str'>, 'index_url': <class 'str'>}, extra=PREVENT_EXTRA, required=False) object>¶
- packages_seen¶
- 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.
- 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>¶
- 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.
- 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_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¶
- 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_SCHEMA: voluptuous.schema_builder.Schema = <Schema({'package_name': Any(<class 'str'>, None, msg=None), 'without_error': <class 'bool'>}, extra=PREVENT_EXTRA, required=False) object>¶
- 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_SCHEMA: voluptuous.schema_builder.Schema = <Schema({'package_name': Any(<class 'str'>, None, msg=None)}, extra=PREVENT_EXTRA, required=False) object>¶
- 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_SCHEMA: voluptuous.schema_builder.Schema = <Schema({'package_name': Any(<class 'str'>, msg=None)}, extra=PREVENT_EXTRA, required=False) object>¶
- 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.
- image_symbols¶
- 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_SCHEMA: voluptuous.schema_builder.Schema = <Schema({'package_name': <class 'str'>, 'package_version': <class 'str'>}, extra=PREVENT_EXTRA, required=False) object>¶
- 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_SCHEMA: voluptuous.schema_builder.Schema = <Schema({'package_name': <class 'str'>, 'version_specifier': <class 'str'>}, extra=PREVENT_EXTRA, required=False) object>¶