diff --git a/covalent/_shared_files/config.py b/covalent/_shared_files/config.py index 3bc9c16bb..73e0d90b7 100644 --- a/covalent/_shared_files/config.py +++ b/covalent/_shared_files/config.py @@ -50,7 +50,7 @@ def __init__(self) -> None: self.generate_default_config() try: - with open(self.config_file, "r") as f: + with open(self.config_file, "r"): pass self.update_config() diff --git a/covalent/_workflow/depsbash.py b/covalent/_workflow/depsbash.py index 1bef3a84e..4b8464342 100644 --- a/covalent/_workflow/depsbash.py +++ b/covalent/_workflow/depsbash.py @@ -28,7 +28,7 @@ def apply_bash_commands(commands): for cmd in commands: - proc = subprocess.run( + subprocess.run( cmd, stdin=subprocess.DEVNULL, shell=True, capture_output=True, check=True, text=True ) diff --git a/covalent/executor/base.py b/covalent/executor/base.py index e46f6590b..9f0d226fd 100644 --- a/covalent/executor/base.py +++ b/covalent/executor/base.py @@ -381,8 +381,8 @@ def execute( output: The result of the function execution. """ - dispatch_info = DispatchInfo(dispatch_id) - fn_version = function.args[0].python_version + DispatchInfo(dispatch_id) + function.args[0].python_version self._task_stdout = io.StringIO() self._task_stderr = io.StringIO() @@ -396,10 +396,10 @@ def execute( self.setup(task_metadata=task_metadata) result = self.run(function, args, kwargs, task_metadata) job_status = RESULT_STATUS.COMPLETED - except TaskRuntimeError as err: + except TaskRuntimeError: job_status = RESULT_STATUS.FAILED result = None - except TaskCancelledError as err: + except TaskCancelledError: job_status = RESULT_STATUS.CANCELLED result = None finally: @@ -655,10 +655,10 @@ async def execute( await self.setup(task_metadata=task_metadata) result = await self.run(function, args, kwargs, task_metadata) job_status = RESULT_STATUS.COMPLETED - except TaskCancelledError as err: + except TaskCancelledError: job_status = RESULT_STATUS.CANCELLED result = None - except TaskRuntimeError as err: + except TaskRuntimeError: job_status = RESULT_STATUS.FAILED result = None finally: diff --git a/covalent/executor/executor_plugins/dask.py b/covalent/executor/executor_plugins/dask.py index 8347619ff..288a06173 100644 --- a/covalent/executor/executor_plugins/dask.py +++ b/covalent/executor/executor_plugins/dask.py @@ -98,7 +98,7 @@ def __init__( if not scheduler_address: try: scheduler_address = get_config("dask.scheduler_address") - except KeyError as ex: + except KeyError: app_log.debug( "No dask scheduler address found in config. Address must be set manually." ) diff --git a/covalent_dispatcher/_cli/service.py b/covalent_dispatcher/_cli/service.py index 8645d88cb..c546b34b0 100644 --- a/covalent_dispatcher/_cli/service.py +++ b/covalent_dispatcher/_cli/service.py @@ -244,7 +244,7 @@ def _graceful_start( try: requests.get(dispatcher_addr, timeout=1) up = True - except requests.exceptions.ConnectionError as err: + except requests.exceptions.ConnectionError: time.sleep(1) Path(get_config("dispatcher.cache_dir")).mkdir(parents=True, exist_ok=True) @@ -649,7 +649,7 @@ def status() -> None: try: response = requests.get(f"http://localhost:{port}/api/triggers/status", timeout=1) trigger_status = response.json()["status"] - except requests.exceptions.ConnectionError as err: + except requests.exceptions.ConnectionError: trigger_status = "stopped" if trigger_status == "running": diff --git a/covalent_ui/api/v1/data_layer/summary_dal.py b/covalent_ui/api/v1/data_layer/summary_dal.py index 04bbcd239..c1938f25c 100644 --- a/covalent_ui/api/v1/data_layer/summary_dal.py +++ b/covalent_ui/api/v1/data_layer/summary_dal.py @@ -62,7 +62,6 @@ def get_summary( Return: List of top most Lattices and count """ - result = None status_filters = self.get_filters(status_filter) diff --git a/tests/covalent_dispatcher_tests/_cli/groups/db_test.py b/tests/covalent_dispatcher_tests/_cli/groups/db_test.py index c8464424c..935b9c514 100644 --- a/tests/covalent_dispatcher_tests/_cli/groups/db_test.py +++ b/tests/covalent_dispatcher_tests/_cli/groups/db_test.py @@ -40,7 +40,7 @@ def test_migration_success(mocker): runner = CliRunner() db_mock = Mock() mocker.patch.object(DataStore, "factory", lambda: db_mock) - res = runner.invoke(migrate, catch_exceptions=False) + runner.invoke(migrate, catch_exceptions=False) db_mock.run_migrations.assert_called_once()