thamos package¶
Subpackages¶
- thamos.swagger_client package
- Subpackages
- thamos.swagger_client.models package
- Submodules
- thamos.swagger_client.models.advise_input module
- thamos.swagger_client.models.advise_input_library_usage module
- thamos.swagger_client.models.analysis_listing_response module
- thamos.swagger_client.models.analysis_log_response module
- thamos.swagger_client.models.analysis_response module
- thamos.swagger_client.models.analysis_response_error module
- thamos.swagger_client.models.analysis_result_response module
- thamos.swagger_client.models.analysis_result_response_metadata module
- thamos.swagger_client.models.analysis_result_response_metadata_distribution module
- thamos.swagger_client.models.analysis_result_response_metadata_distribution_version_parts module
- thamos.swagger_client.models.analysis_result_response_metadata_python module
- thamos.swagger_client.models.analysis_status_response module
- thamos.swagger_client.models.analysis_status_response_status module
- thamos.swagger_client.models.build module
- thamos.swagger_client.models.build_analysis_response module
- thamos.swagger_client.models.build_analysis_response_base_image_analysis module
- thamos.swagger_client.models.build_analysis_response_error module
- thamos.swagger_client.models.build_analysis_response_error_base_image_analysis module
- thamos.swagger_client.models.build_build_log module
- thamos.swagger_client.models.image_metadata_response module
- thamos.swagger_client.models.inline_response200 module
- thamos.swagger_client.models.inline_response2001 module
- thamos.swagger_client.models.inline_response2001_hardware_environments module
- thamos.swagger_client.models.inline_response2001_parameters module
- thamos.swagger_client.models.inline_response2002 module
- thamos.swagger_client.models.inline_response2002_software_environments module
- thamos.swagger_client.models.inline_response200_runtime_environments module
- thamos.swagger_client.models.kebechet_webhook_input module
- thamos.swagger_client.models.log module
- thamos.swagger_client.models.python_package_dependencies module
- thamos.swagger_client.models.python_package_dependencies_error module
- thamos.swagger_client.models.python_package_dependencies_inner module
- thamos.swagger_client.models.python_package_indexes module
- thamos.swagger_client.models.python_package_indexes_inner module
- thamos.swagger_client.models.python_package_metadata_response module
- thamos.swagger_client.models.python_package_metadata_response_error module
- thamos.swagger_client.models.python_package_versions_response module
- thamos.swagger_client.models.python_package_versions_response_error module
- thamos.swagger_client.models.python_package_versions_response_versions module
- thamos.swagger_client.models.python_packages_count_info_response module
- thamos.swagger_client.models.python_packages_count_info_response_error module
- thamos.swagger_client.models.python_platforms module
- thamos.swagger_client.models.python_stack module
- thamos.swagger_client.models.qeb_hwt_thamos_advise_input module
- thamos.swagger_client.models.runtime_environment module
- Module contents
- thamos.swagger_client.thoth package
- Submodules
- thamos.swagger_client.thoth.advise_api module
- thamos.swagger_client.thoth.build_analysis_api module
- thamos.swagger_client.thoth.buildlogs_api module
- thamos.swagger_client.thoth.git_hub_api module
- thamos.swagger_client.thoth.image_analysis_api module
- thamos.swagger_client.thoth.info_api module
- thamos.swagger_client.thoth.kebechet_api module
- thamos.swagger_client.thoth.provenance_api module
- thamos.swagger_client.thoth.python_packages_api module
- Module contents
- thamos.swagger_client.models package
- Submodules
- thamos.swagger_client.api_client module
- thamos.swagger_client.configuration module
- thamos.swagger_client.rest module
- Module contents
- Subpackages
Submodules¶
thamos.cli module¶
Command line interface Thamos for interaction with Thoth.
-
class
thamos.cli.
AliasedGroup
(name=None, commands=None, **attrs)[source]¶ Bases:
click.core.Group
Provide clever command aliases.
-
get_command
(ctx, cmd_name)[source]¶ Get command to be executed based on the prefix.
https://click.palletsprojects.com/en/7.x/advanced/#command-aliases
-
thamos.config module¶
CLI and library configuration.
thamos.discover module¶
Implementation discovery methods to detect the current environment and its configuration.
-
thamos.discover.
discover_cpu
() → Dict[str, Union[str, int, None]][source]¶ Discover CPU model, model name and family.
-
thamos.discover.
discover_cuda_version
(interactive: bool = False) → Optional[str][source]¶ Check for CUDA version, if no CUDA is installed, return None.
thamos.exceptions module¶
Exception hierarchy in Thamos.
-
exception
thamos.exceptions.
ApiError
[source]¶ Bases:
thamos.exceptions.ThamosException
An exception raised if the API doesn’t return expected status code.
-
exception
thamos.exceptions.
ConfigurationError
[source]¶ Bases:
thamos.exceptions.ThamosException
An exception raised if there are issues with configuration file.
-
exception
thamos.exceptions.
InternalError
[source]¶ Bases:
thamos.exceptions.ThamosException
An exception raised on internal programming errors.
-
exception
thamos.exceptions.
NoApiSupported
[source]¶ Bases:
thamos.exceptions.ThamosException
Raised if client and Thoth server does not support same API versions.
-
exception
thamos.exceptions.
NoProjectDirError
[source]¶ Bases:
thamos.exceptions.ThamosException
An exception raised if the project directory cannot be found.
-
exception
thamos.exceptions.
NoRequirementsFile
[source]¶ Bases:
thamos.exceptions.ThamosException
An exception raised when requirements file is not present.
-
exception
thamos.exceptions.
NoRequirementsFormatError
[source]¶ Bases:
thamos.exceptions.ThamosException
An exception raised if no requirements format could be found in configuration file.
-
exception
thamos.exceptions.
NoRuntimeEnvironmentError
[source]¶ Bases:
thamos.exceptions.ThamosException
An exception raised if no runtime environment could be found in configuration file.
Bases:
thamos.exceptions.ThamosException
Raised if Thoth service is not available.
-
exception
thamos.exceptions.
ThamosException
[source]¶ Bases:
Exception
A base class for exceptions in Thamos.
-
exception
thamos.exceptions.
TimeoutError
[source]¶ Bases:
thamos.exceptions.ThamosException
An exception raised if the API takes longer than timeout limit.
-
exception
thamos.exceptions.
UnknownAnalysisType
[source]¶ Bases:
thamos.exceptions.ThamosException
Raised analysis type (adviser, package-extract, …) cannot be determined from analysis identifier.
thamos.lib module¶
Core parts of library for interacting with Thoth.
-
thamos.lib.
advise
(api_client: thamos.swagger_client.api_client.ApiClient, pipfile: str, pipfile_lock: str, recommendation_type: str = None, *, runtime_environment: dict = None, runtime_environment_name: str = None, dev: bool = False, no_static_analysis: bool = False, no_user_stack: bool = False, nowait: bool = False, force: bool = False, limit: int = None, count: int = 1, debug: bool = False, origin: str = None, github_event_type: Optional[str] = None, github_check_run_id: Optional[int] = None, github_installation_id: Optional[int] = None, github_base_repo_url: Optional[str] = None, source_type: Optional[thoth.common.enums.ThothAdviserIntegrationEnum] = None) → Optional[tuple][source]¶ Submit a stack for adviser checks and wait for results.
-
thamos.lib.
advise_here
(recommendation_type: Optional[str] = None, *, runtime_environment: dict = None, runtime_environment_name: Optional[str] = None, dev: bool = False, no_static_analysis: bool = False, no_user_stack: bool = False, nowait: bool = False, force: bool = False, limit: Optional[int] = None, count: int = 1, debug: bool = False, origin: Optional[str] = None, github_event_type: Optional[str] = None, github_check_run_id: Optional[int] = None, github_installation_id: Optional[int] = None, github_base_repo_url: Optional[str] = None, source_type: Optional[thoth.common.enums.ThothAdviserIntegrationEnum] = None) → Optional[tuple][source]¶ Run advise in current directory, requires no arguments.
-
thamos.lib.
advise_using_config
(pipfile: str, pipfile_lock: str, config: str = None, *, runtime_environment_name: str = None, recommendation_type: str = None, dev: bool = False, no_static_analysis: bool = False, no_user_stack: bool = False, nowait: bool = False, force: bool = False, limit: int = None, count: int = 1, debug: bool = False, origin: str = None, github_event_type: Optional[str] = None, github_check_run_id: Optional[int] = None, github_installation_id: Optional[int] = None, github_base_repo_url: Optional[str] = None, source_type: Optional[thoth.common.enums.ThothAdviserIntegrationEnum] = None) → Optional[Tuple[Dict[str, Any], bool]][source]¶ Trigger advise, respecting the configuration file supplied directly as a string or as a file path.
-
thamos.lib.
build_analysis
(api_client: thamos.swagger_client.api_client.ApiClient, build_log: dict, base_image: str, output_image: str, *, environment_type: str, base_registry_user: Optional[str] = None, base_registry_password: Optional[str] = None, base_registry_verify_tls: bool = True, output_registry_user: Optional[str] = None, output_registry_password: Optional[str] = None, output_registry_verify_tls: bool = True, origin: Optional[str] = None, nowait: bool = False, force: bool = False, debug: bool = False) → Union[Dict, str][source]¶ Submit a build image and logs for analysis to Thoth.
-
thamos.lib.
get_analysis_results
(api_client: thamos.swagger_client.api_client.ApiClient, analysis_id: str)[source]¶ Get the analysis result from a given id.
-
thamos.lib.
get_log
(api_client: thamos.swagger_client.api_client.ApiClient, analysis_id: str = None)[source]¶ Get log of an analysis - the analysis type and endpoint are automatically derived from analysis id.
If analysis_id is not provided, its get from the last thamos call which stores it in a temporary file.
-
thamos.lib.
get_status
(api_client: thamos.swagger_client.api_client.ApiClient, analysis_id: str = None)[source]¶ Get status of an analysis - the analysis type and endpoint are automatically derived from analysis id.
If analysis_id is not provided, its get from the last thamos call which stores it in a temporary file.
-
thamos.lib.
image_analysis
(api_client: thamos.swagger_client.api_client.ApiClient, image: str, *, environment_type: str, registry_user: str = None, registry_password: str = None, verify_tls: bool = True, nowait: bool = False, force: bool = False, debug: bool = False) → Union[Dict, str, None][source]¶ Submit an image for analysis to Thoth.
-
thamos.lib.
install
(runtime_environment_name: Optional[str] = None, dev: bool = False) → None[source]¶ Perform installation of packages for the given runtime environment.
If the runtime environment is not specified, the first environment stated in the configuration is used.
-
thamos.lib.
install_using_config
(config: str, runtime_environment_name: Optional[str] = None, dev: bool = False) → None[source]¶ Perform installation given the configuration supplied.
-
thamos.lib.
is_analysis_ready
(analysis_id: str) → bool[source]¶ Handle the the multiple response types available while asking for result of a anaylsis result.
-
thamos.lib.
provenance_check
(api_client: thamos.swagger_client.api_client.ApiClient, pipfile: str, pipfile_lock: str, *, nowait: bool = False, force: bool = False, debug: bool = False, origin: str = None) → Optional[tuple][source]¶ Submit a stack for provenance checks and wait for results.
thamos.utils module¶
Utility and helper functions for Thamos.
Module contents¶
A CLI tool and library for interacting with Thoth.