diff --git a/.vscode/settings.json b/.vscode/settings.json index 6b9729290ff..982eb42c8dd 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -125,6 +125,10 @@ ], "esbonio.sphinx.confDir": "${workspaceFolder}/doc/source", "esbonio.sphinx.buildDir": "${workspaceFolder}/doc/build/", + "pylint.severity": { + // display refactor warnings as information messages + "refactor": "Information" + }, "[python]": { "editor.defaultFormatter": "ms-python.black-formatter", "editor.formatOnSave": true, diff --git a/mlos_bench/mlos_bench/services/config_persistence.py b/mlos_bench/mlos_bench/services/config_persistence.py index 78c0e1f3cec..72bfad007de 100644 --- a/mlos_bench/mlos_bench/services/config_persistence.py +++ b/mlos_bench/mlos_bench/services/config_persistence.py @@ -395,7 +395,7 @@ def build_scheduler( # pylint: disable=too-many-arguments _LOG.info("Created: Scheduler %s", inst) return inst - def build_environment( # pylint: disable=too-many-arguments + def build_environment( self, config: Dict[str, Any], tunables: TunableGroups, @@ -403,6 +403,7 @@ def build_environment( # pylint: disable=too-many-arguments parent_args: Optional[Dict[str, TunableValue]] = None, service: Optional[Service] = None, ) -> Environment: + # pylint: disable=too-many-arguments,too-many-positional-arguments """ Factory method for a new environment with a given config. @@ -566,7 +567,7 @@ def build_service( return self._build_composite_service(config_list, global_config, parent) - def load_environment( # pylint: disable=too-many-arguments + def load_environment( self, json_file_name: str, tunables: TunableGroups, @@ -574,6 +575,7 @@ def load_environment( # pylint: disable=too-many-arguments parent_args: Optional[Dict[str, TunableValue]] = None, service: Optional[Service] = None, ) -> Environment: + # pylint: disable=too-many-arguments,too-many-positional-arguments """ Load and build new environment from the config file. @@ -600,7 +602,7 @@ def load_environment( # pylint: disable=too-many-arguments assert isinstance(config, dict) return self.build_environment(config, tunables, global_config, parent_args, service) - def load_environment_list( # pylint: disable=too-many-arguments + def load_environment_list( self, json_file_name: str, tunables: TunableGroups, @@ -608,6 +610,7 @@ def load_environment_list( # pylint: disable=too-many-arguments parent_args: Optional[Dict[str, TunableValue]] = None, service: Optional[Service] = None, ) -> List[Environment]: + # pylint: disable=too-many-arguments,too-many-positional-arguments """ Load and build a list of environments from the config file. diff --git a/mlos_bench/mlos_bench/services/remote/azure/azure_auth.py b/mlos_bench/mlos_bench/services/remote/azure/azure_auth.py index dccb5740ce2..5aa46ab8ee7 100644 --- a/mlos_bench/mlos_bench/services/remote/azure/azure_auth.py +++ b/mlos_bench/mlos_bench/services/remote/azure/azure_auth.py @@ -111,7 +111,7 @@ def get_credential(self) -> TokenCredential: cert_bytes = b64decode(secret.value) # Reauthenticate as the service principal. - self._cred = CertificateCredential( + self._cred = CertificateCredential( # pylint: disable=redefined-variable-type tenant_id=tenant_id, client_id=sp_client_id, certificate_data=cert_bytes, diff --git a/mlos_bench/mlos_bench/services/remote/ssh/ssh_fileshare.py b/mlos_bench/mlos_bench/services/remote/ssh/ssh_fileshare.py index 383fcfbd20a..137ab024d1c 100644 --- a/mlos_bench/mlos_bench/services/remote/ssh/ssh_fileshare.py +++ b/mlos_bench/mlos_bench/services/remote/ssh/ssh_fileshare.py @@ -35,7 +35,7 @@ async def _start_file_copy( remote_path: str, recursive: bool = True, ) -> None: - # pylint: disable=too-many-arguments + # pylint: disable=too-many-arguments,too-many-positional-arguments """ Starts a file copy operation. diff --git a/mlos_bench/mlos_bench/services/types/config_loader_type.py b/mlos_bench/mlos_bench/services/types/config_loader_type.py index b2b6bdf0e5f..33adac67eb4 100644 --- a/mlos_bench/mlos_bench/services/types/config_loader_type.py +++ b/mlos_bench/mlos_bench/services/types/config_loader_type.py @@ -78,6 +78,7 @@ def build_environment( # pylint: disable=too-many-arguments parent_args: Optional[Dict[str, TunableValue]] = None, service: Optional["Service"] = None, ) -> "Environment": + # pylint: disable=too-many-arguments,too-many-positional-arguments """ Factory method for a new environment with a given config. @@ -106,7 +107,7 @@ def build_environment( # pylint: disable=too-many-arguments An instance of the `Environment` class initialized with `config`. """ - def load_environment_list( # pylint: disable=too-many-arguments + def load_environment_list( self, json_file_name: str, tunables: "TunableGroups", @@ -114,6 +115,7 @@ def load_environment_list( # pylint: disable=too-many-arguments parent_args: Optional[Dict[str, TunableValue]] = None, service: Optional["Service"] = None, ) -> List["Environment"]: + # pylint: disable=too-many-arguments,too-many-positional-arguments """ Load and build a list of environments from the config file. diff --git a/mlos_bench/mlos_bench/tests/conftest.py b/mlos_bench/mlos_bench/tests/conftest.py index a13c57a2cdb..bc0a8aa1897 100644 --- a/mlos_bench/mlos_bench/tests/conftest.py +++ b/mlos_bench/mlos_bench/tests/conftest.py @@ -143,7 +143,7 @@ def locked_docker_services( """A locked version of the docker_services fixture to implement xdist single instance locking. """ - # pylint: disable=too-many-arguments + # pylint: disable=too-many-arguments,too-many-positional-arguments # Mark the services as in use with the reader lock. docker_services_lock.acquire_read_lock() # Acquire the setup lock to prevent multiple setup operations at once. diff --git a/mlos_bench/mlos_bench/tests/services/remote/azure/azure_network_services_test.py b/mlos_bench/mlos_bench/tests/services/remote/azure/azure_network_services_test.py index 87dd78fd5a7..6dc1de468cd 100644 --- a/mlos_bench/mlos_bench/tests/services/remote/azure/azure_network_services_test.py +++ b/mlos_bench/mlos_bench/tests/services/remote/azure/azure_network_services_test.py @@ -75,7 +75,6 @@ def test_wait_network_deployment_retry( ], ) @patch("mlos_bench.services.remote.azure.azure_deployment_services.requests") -# pylint: disable=too-many-arguments def test_network_operation_status( mock_requests: MagicMock, azure_network_service: AzureNetworkService, @@ -85,6 +84,7 @@ def test_network_operation_status( operation_status: Status, ) -> None: """Test network operation status.""" + # pylint: disable=too-many-arguments,too-many-positional-arguments mock_response = MagicMock() mock_response.status_code = http_status_code mock_requests.post.return_value = mock_response diff --git a/mlos_bench/mlos_bench/tests/services/remote/azure/azure_vm_services_test.py b/mlos_bench/mlos_bench/tests/services/remote/azure/azure_vm_services_test.py index 6418da01a91..988177180e9 100644 --- a/mlos_bench/mlos_bench/tests/services/remote/azure/azure_vm_services_test.py +++ b/mlos_bench/mlos_bench/tests/services/remote/azure/azure_vm_services_test.py @@ -139,7 +139,6 @@ def test_azure_vm_service_custom_data(azure_auth_service: AzureAuthService) -> N ], ) @patch("mlos_bench.services.remote.azure.azure_deployment_services.requests") -# pylint: disable=too-many-arguments def test_vm_operation_status( mock_requests: MagicMock, azure_vm_service: AzureVMService, @@ -149,6 +148,7 @@ def test_vm_operation_status( operation_status: Status, ) -> None: """Test VM operation status.""" + # pylint: disable=too-many-arguments,too-many-positional-arguments mock_response = MagicMock() mock_response.status_code = http_status_code mock_requests.post.return_value = mock_response