1+ #!/usr/bin/env python
2+ # Copyright (c) 2024, 2025 Oracle and/or its affiliates.
3+ # Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/
4+
15import logging
6+ import sys
27from functools import wraps
38
49import click
@@ -56,9 +61,7 @@ def run_func():
5661 if ignore_spinner :
5762 return run_func ()
5863 else :
59- with self ._rich_ui .console .status (
60- f"Verifying { operation_message ['name' ]} "
61- ) as status :
64+ with self ._rich_ui .console .status (f"Verifying { operation_message ['name' ]} " ):
6265 return run_func ()
6366
6467 return wrapper
@@ -183,7 +186,7 @@ def _test_delete_model(self, **kwargs):
183186 ).to_dict ()
184187 ]
185188
186- def _test_model_deployment (self , ** kwargs ):
189+ def _test_model_deployment (self , ** kwargs ): # noqa: ARG002
187190 """Verifies policies required to create and delete a model deployment.
188191
189192 Returns:
@@ -201,7 +204,7 @@ def _test_model_deployment(self, **kwargs):
201204 )
202205 return [test_model_deployment .to_dict (), test_delete_md .to_dict ()]
203206
204- def _test_manage_mvs (self , ** kwargs ):
207+ def _test_manage_mvs (self , ** kwargs ): # noqa: ARG002
205208 """Verifies policies required to create and delete a model version set (MVS).
206209
207210 Returns:
@@ -289,7 +292,7 @@ def _consent(self):
289292 """
290293 answer = self ._prompt ("Do you want to continue?" , bool = True )
291294 if not answer :
292- exit (0 )
295+ sys . exit (0 )
293296
294297 def common_policies (self , ** kwargs ):
295298 """Verifies basic read-level policies across various AQUA components
@@ -328,7 +331,7 @@ def model_register(self, **kwargs):
328331 """
329332 logger .info ("[magenta]Verifying Model Register" )
330333 logger .info ("Object and Model will be created." )
331- kwargs .pop ("consent" , None ) == True or self ._consent ()
334+ kwargs .pop ("consent" , None ) or self ._consent ()
332335
333336 model_save_bucket = kwargs .pop ("bucket" , None ) or self ._prompt (
334337 "Provide bucket name where model artifacts will be saved"
@@ -345,7 +348,7 @@ def model_deployment(self, **kwargs):
345348 """
346349 logger .info ("[magenta]Verifying Model Deployment" )
347350 logger .info ("Model, Model deployment will be created." )
348- kwargs .pop ("consent" , None ) == True or self ._consent ()
351+ kwargs .pop ("consent" , None ) or self ._consent ()
349352
350353 self .model_id , test_model_register = self ._execute (self ._util .register_model )
351354 model_register = [test_model_register .to_dict ()]
@@ -364,7 +367,7 @@ def evaluation(self, **kwargs):
364367 """
365368 logger .info ("[magenta]Verifying Evaluation" )
366369 logger .info ("Model Version Set, Model, Object, Job and JobRun will be created." )
367- kwargs .pop ("consent" , None ) == True or self ._consent ()
370+ kwargs .pop ("consent" , None ) or self ._consent ()
368371
369372 # Create & Delete MVS
370373 test_manage_mvs = self ._test_manage_mvs (** kwargs )
@@ -397,7 +400,7 @@ def finetune(self, **kwargs):
397400 logger .info (
398401 "Object, Model Version Set, Job and JobRun will be created. VCN will be used."
399402 )
400- kwargs .pop ("consent" , None ) == True or self ._consent ()
403+ kwargs .pop ("consent" , None ) or self ._consent ()
401404
402405 # Manage bucket
403406 bucket = kwargs .pop ("bucket" , None ) or self ._prompt (
0 commit comments