Skip to content

Commit

Permalink
Fixing lints
Browse files Browse the repository at this point in the history
  • Loading branch information
favilo committed Jun 21, 2024
1 parent ab8cf43 commit c8bae0a
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
10 changes: 6 additions & 4 deletions esrally/mechanic/team.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
import logging
import os
from enum import Enum
from typing import Any, Collection, Mapping, Union
from types import ModuleType
from typing import Any, Collection, Mapping, Union

import tabulate

Expand Down Expand Up @@ -49,7 +49,7 @@ def list_cars(cfg: types.Config):
console.println(tabulate.tabulate([[c.name, c.type, c.description] for c in cars], headers=["Name", "Type", "Description"]))


def load_car(repo: str, name: Collection[str], car_params: Mapping=None) -> "Car":
def load_car(repo: str, name: Collection[str], car_params: Mapping = None) -> "Car":
class Component:
def __init__(self, root_path, entry_point):
self.root_path = root_path
Expand Down Expand Up @@ -240,7 +240,7 @@ class Car:
def __init__(
self,
names: Collection[str],
root_path: Union[str, Collection[str]],
root_path: Union[None, str, Collection[str]],
config_paths: Collection[str],
variables: Mapping[str, Any] = None,
):
Expand All @@ -259,7 +259,9 @@ def __init__(
else:
self.names = names

if isinstance(root_path, str):
if root_path is None:
self.root_path = []
elif isinstance(root_path, str):
self.root_path = [root_path]
else:
self.root_path = root_path
Expand Down
7 changes: 3 additions & 4 deletions esrally/utils/modules.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
import logging
import os
import sys
from typing import Collection, Union
from types import ModuleType
from typing import Collection, Union

from esrally import exceptions
from esrally.utils import io
Expand Down Expand Up @@ -65,7 +65,7 @@ def _load_component(self, component_name: str, module_dirs: Collection[str], roo
# precondition: A module with this name has to exist provided that the caller has called #can_load() before.
root_module_name = "%s.%s" % (component_name, self.component_entry_point)
for name, p in self._modules(module_dirs, component_name, root_path):
self.logger.debug(f"Loading module [{name}]: {p}")
self.logger.debug("Loading module [%s]: %s", name, p)
spec = importlib.util.spec_from_file_location(name, p)
m = importlib.util.module_from_spec(spec)
spec.loader.exec_module(m)
Expand Down Expand Up @@ -118,6 +118,5 @@ def load(self) -> Collection[ModuleType]:
except BaseException:
msg = f"Could not load component [{component_name}]"
self.logger.exception(msg)
raise
# raise exceptions.SystemSetupError(msg)
raise exceptions.SystemSetupError(msg)
return root_modules
1 change: 0 additions & 1 deletion esrally/utils/process.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,6 @@ def run_subprocess_with_logging_and_output(
if header is not None:
logger.info(header)

# pylint: disable=subprocess-popen-preexec-fn
completed = subprocess.run(
command_line_args,
stdout=subprocess.PIPE,
Expand Down
2 changes: 1 addition & 1 deletion tests/mechanic/provisioner_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def null_apply_config(source_root_path, target_root_path, config_vars):
installer = provisioner.ElasticsearchInstaller(
car=team.Car(
names="unit-test-car",
root_path=None, # type: ignore
root_path=None,
config_paths=[HOME_DIR + "/.rally/benchmarks/teams/default/my-car"],
variables={
"heap": "4g",
Expand Down

0 comments on commit c8bae0a

Please sign in to comment.