diff --git a/Documentation/AdviserResultResponseResultReportProducts.md b/Documentation/AdviserResultResponseResultReportProducts.md index 4a2d0272d..980149fe7 100644 --- a/Documentation/AdviserResultResponseResultReportProducts.md +++ b/Documentation/AdviserResultResponseResultReportProducts.md @@ -7,7 +7,7 @@ Name | Type | Description | Notes **advised_runtime_environment** | [**RuntimeEnvironment**](RuntimeEnvironment.md) | | **dependency_graph** | [**AdviserResultResponseResultReportDependencyGraph**](AdviserResultResponseResultReportDependencyGraph.md) | | **justification** | [**Justification**](Justification.md) | | -**project** | [**AdviserResultResponseResultReportProject**](AdviserResultResponseResultReportProject.md) | | +**project** | **object** | | **score** | **float** | Score of the computed product | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/Documentation/ProvenanceResultResponseResultParametersProject.md b/Documentation/ProvenanceResultResponseResultParametersProject.md index bf4d402ae..3f205a452 100644 --- a/Documentation/ProvenanceResultResponseResultParametersProject.md +++ b/Documentation/ProvenanceResultResponseResultParametersProject.md @@ -4,8 +4,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **constraints** | [**list[ProvenanceResultResponseResultParametersProjectConstraints]**](ProvenanceResultResponseResultParametersProjectConstraints.md) | | -**requirements** | **object** | | -**requirements_locked** | **object** | | +**requirements** | **object** | Requirements stating direct dependencies of the project, the format is compatible with Pipenv | +**requirements_locked** | **object** | A lock file stating all the dependencies pinned to a specific version togher with an explicit Python package index configuration | **runtime_environment** | [**RuntimeEnvironment**](RuntimeEnvironment.md) | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/Documentation/PythonPackageIndexesIndexes.md b/Documentation/PythonPackageIndexesIndexes.md index e422bc167..593dfe6ce 100644 --- a/Documentation/PythonPackageIndexesIndexes.md +++ b/Documentation/PythonPackageIndexesIndexes.md @@ -6,7 +6,7 @@ Name | Type | Description | Notes **url** | **str** | URL to the Python simple repository as described in PEP 503 | **warehouse_api_url** | **str** | URL to the warehouse API | **verify_ssl** | **bool** | Use secured connection to warehouse | -**only_if_packages_seen** | **bool** | The backend is configured to monitor only releases of already seen packages | +**only_if_package_seen** | **bool** | The backend is configured to monitor only releases of already seen packages | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/thamos/cli.py b/thamos/cli.py index d0a4b066d..8a96aab60 100755 --- a/thamos/cli.py +++ b/thamos/cli.py @@ -44,6 +44,7 @@ from thamos.exceptions import ConfigurationError from thamos.exceptions import NoProjectDirError from thamos.exceptions import NoRuntimeEnvironmentError +from thamos.swagger_client.rest import ApiException from thamos.config import config as configuration from thamos.lib import advise_here as thoth_advise_here from thamos.lib import add_requirements_to_project @@ -1463,11 +1464,16 @@ def whatprovides(import_name: str, output_format: str) -> None: # noqa: D412 def discover( runtime_environment: typing.Optional[str], src_path: str = "." ) -> None: # noqa: D412 - """Discover packages used in the project or in the file. + """Discover packages used in the project or in a file and add them to requirements. + + If runtime environment is passed, requirements are added to requirements specific + to the given runtime environment. Otherwise, the default runtime environment is used. Examples: thamos discover + + thamos discover --runtime-environment "production" """ # Obtain list of imports using invectio and verify package from PyPI verified_packages = get_verified_packages_from_static_analysis( diff --git a/thamos/swagger_client/__init__.py b/thamos/swagger_client/__init__.py index cf1d5e8f9..6192a661e 100644 --- a/thamos/swagger_client/__init__.py +++ b/thamos/swagger_client/__init__.py @@ -38,7 +38,6 @@ from thamos.swagger_client.models.adviser_result_response_result_report_pipeline import AdviserResultResponseResultReportPipeline from thamos.swagger_client.models.adviser_result_response_result_report_pipeline_boots import AdviserResultResponseResultReportPipelineBoots from thamos.swagger_client.models.adviser_result_response_result_report_products import AdviserResultResponseResultReportProducts -from thamos.swagger_client.models.adviser_result_response_result_report_project import AdviserResultResponseResultReportProject from thamos.swagger_client.models.analysis_log_response import AnalysisLogResponse from thamos.swagger_client.models.analysis_response import AnalysisResponse from thamos.swagger_client.models.analysis_response_error import AnalysisResponseError diff --git a/thamos/swagger_client/models/__init__.py b/thamos/swagger_client/models/__init__.py index e86d2b95e..462195269 100644 --- a/thamos/swagger_client/models/__init__.py +++ b/thamos/swagger_client/models/__init__.py @@ -24,7 +24,6 @@ from thamos.swagger_client.models.adviser_result_response_result_report_pipeline import AdviserResultResponseResultReportPipeline from thamos.swagger_client.models.adviser_result_response_result_report_pipeline_boots import AdviserResultResponseResultReportPipelineBoots from thamos.swagger_client.models.adviser_result_response_result_report_products import AdviserResultResponseResultReportProducts -from thamos.swagger_client.models.adviser_result_response_result_report_project import AdviserResultResponseResultReportProject from thamos.swagger_client.models.analysis_log_response import AnalysisLogResponse from thamos.swagger_client.models.analysis_response import AnalysisResponse from thamos.swagger_client.models.analysis_response_error import AnalysisResponseError diff --git a/thamos/swagger_client/models/adviser_result_response_result_report_products.py b/thamos/swagger_client/models/adviser_result_response_result_report_products.py index 685f487e4..dc9a17d5e 100644 --- a/thamos/swagger_client/models/adviser_result_response_result_report_products.py +++ b/thamos/swagger_client/models/adviser_result_response_result_report_products.py @@ -32,7 +32,7 @@ class AdviserResultResponseResultReportProducts(object): 'advised_runtime_environment': 'RuntimeEnvironment', 'dependency_graph': 'AdviserResultResponseResultReportDependencyGraph', 'justification': 'Justification', - 'project': 'AdviserResultResponseResultReportProject', + 'project': 'object', 'score': 'float' } @@ -159,7 +159,7 @@ def project(self): :return: The project of this AdviserResultResponseResultReportProducts. # noqa: E501 - :rtype: AdviserResultResponseResultReportProject + :rtype: object """ return self._project @@ -169,7 +169,7 @@ def project(self, project): :param project: The project of this AdviserResultResponseResultReportProducts. # noqa: E501 - :type: AdviserResultResponseResultReportProject + :type: object """ if project is None: raise ValueError("Invalid value for `project`, must not be `None`") # noqa: E501 diff --git a/thamos/swagger_client/models/provenance_result_response_result_parameters_project.py b/thamos/swagger_client/models/provenance_result_response_result_parameters_project.py index 1532fa4c9..a814f68eb 100644 --- a/thamos/swagger_client/models/provenance_result_response_result_parameters_project.py +++ b/thamos/swagger_client/models/provenance_result_response_result_parameters_project.py @@ -80,6 +80,7 @@ def constraints(self, constraints): def requirements(self): """Gets the requirements of this ProvenanceResultResponseResultParametersProject. # noqa: E501 + Requirements stating direct dependencies of the project, the format is compatible with Pipenv # noqa: E501 :return: The requirements of this ProvenanceResultResponseResultParametersProject. # noqa: E501 :rtype: object @@ -90,6 +91,7 @@ def requirements(self): def requirements(self, requirements): """Sets the requirements of this ProvenanceResultResponseResultParametersProject. + Requirements stating direct dependencies of the project, the format is compatible with Pipenv # noqa: E501 :param requirements: The requirements of this ProvenanceResultResponseResultParametersProject. # noqa: E501 :type: object @@ -103,6 +105,7 @@ def requirements(self, requirements): def requirements_locked(self): """Gets the requirements_locked of this ProvenanceResultResponseResultParametersProject. # noqa: E501 + A lock file stating all the dependencies pinned to a specific version togher with an explicit Python package index configuration # noqa: E501 :return: The requirements_locked of this ProvenanceResultResponseResultParametersProject. # noqa: E501 :rtype: object @@ -113,6 +116,7 @@ def requirements_locked(self): def requirements_locked(self, requirements_locked): """Sets the requirements_locked of this ProvenanceResultResponseResultParametersProject. + A lock file stating all the dependencies pinned to a specific version togher with an explicit Python package index configuration # noqa: E501 :param requirements_locked: The requirements_locked of this ProvenanceResultResponseResultParametersProject. # noqa: E501 :type: object diff --git a/thamos/swagger_client/models/python_package_indexes_indexes.py b/thamos/swagger_client/models/python_package_indexes_indexes.py index 0823cde7f..a8c263ba4 100644 --- a/thamos/swagger_client/models/python_package_indexes_indexes.py +++ b/thamos/swagger_client/models/python_package_indexes_indexes.py @@ -31,27 +31,27 @@ class PythonPackageIndexesIndexes(object): 'url': 'str', 'warehouse_api_url': 'str', 'verify_ssl': 'bool', - 'only_if_packages_seen': 'bool' + 'only_if_package_seen': 'bool' } attribute_map = { 'url': 'url', 'warehouse_api_url': 'warehouse_api_url', 'verify_ssl': 'verify_ssl', - 'only_if_packages_seen': 'only_if_packages_seen' + 'only_if_package_seen': 'only_if_package_seen' } - def __init__(self, url=None, warehouse_api_url=None, verify_ssl=None, only_if_packages_seen=None): # noqa: E501 + def __init__(self, url=None, warehouse_api_url=None, verify_ssl=None, only_if_package_seen=None): # noqa: E501 """PythonPackageIndexesIndexes - a model defined in Swagger""" # noqa: E501 self._url = None self._warehouse_api_url = None self._verify_ssl = None - self._only_if_packages_seen = None + self._only_if_package_seen = None self.discriminator = None self.url = url self.warehouse_api_url = warehouse_api_url self.verify_ssl = verify_ssl - self.only_if_packages_seen = only_if_packages_seen + self.only_if_package_seen = only_if_package_seen @property def url(self): @@ -127,27 +127,29 @@ def verify_ssl(self, verify_ssl): self._verify_ssl = verify_ssl @property - def only_if_packages_seen(self): - """Gets the only_if_packages_seen of this PythonPackageIndexesIndexes. # noqa: E501 + def only_if_package_seen(self): + """Gets the only_if_package_seen of this PythonPackageIndexesIndexes. # noqa: E501 The backend is configured to monitor only releases of already seen packages # noqa: E501 - :return: The only_if_packages_seen of this PythonPackageIndexesIndexes. # noqa: E501 + :return: The only_if_package_seen of this PythonPackageIndexesIndexes. # noqa: E501 :rtype: bool """ - return self._only_if_packages_seen + return self._only_if_package_seen - @only_if_packages_seen.setter - def only_if_packages_seen(self, only_if_packages_seen): - """Sets the only_if_packages_seen of this PythonPackageIndexesIndexes. + @only_if_package_seen.setter + def only_if_package_seen(self, only_if_package_seen): + """Sets the only_if_package_seen of this PythonPackageIndexesIndexes. The backend is configured to monitor only releases of already seen packages # noqa: E501 - :param only_if_packages_seen: The only_if_packages_seen of this PythonPackageIndexesIndexes. # noqa: E501 + :param only_if_package_seen: The only_if_package_seen of this PythonPackageIndexesIndexes. # noqa: E501 :type: bool """ + if only_if_package_seen is None: + raise ValueError("Invalid value for `only_if_package_seen`, must not be `None`") # noqa: E501 - self._only_if_packages_seen = only_if_packages_seen + self._only_if_package_seen = only_if_package_seen def to_dict(self): """Returns the model properties as a dict"""