Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ mcs = [
"firewheel-repo-vyos",
]
format = [
"ruff==0.11.2",
"ruff==0.14.3",
]
docs = [
"Sphinx>=7.0.0,<=8.2.3",
Expand Down Expand Up @@ -302,7 +302,7 @@ ignore = [
"PERF203", # try-except-in-loop
"PERF401", # manual-list-comprehension
]
preview = true
preview = false
# Allow fix for all enabled rules (when `--fix`) is provided.
fixable = ["ALL"]
unfixable = []
Expand Down
2 changes: 1 addition & 1 deletion src/firewheel/cli/completion/prepare_completion_script.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def populate_template(script_path: Path) -> None:
python_bin=config["python"]["bin"],
)
# Write the script content to the completion script
with script_path.open("w") as script_file:
with script_path.open("w", encoding="utf-8") as script_file:
script_file.write(script_content)


Expand Down
2 changes: 1 addition & 1 deletion src/firewheel/cli/executable_section.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def is_executable(self) -> bool:
"""
return True

def _load_executor( # noqa: DOC503
def _load_executor(
self, name: str
) -> Union[Type[Helpers], Type[LocalPython], Type[Python], Type[Shell]]:
"""
Expand Down
8 changes: 6 additions & 2 deletions src/firewheel/cli/executors/shell.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,16 @@ def execute(
"MM_FORCE",
"MM_RECOVER",
"MM_CGROUP",
"MM_APPEND"
"MM_APPEND",
}

# Concatenate minimega environment variables
env_vars = [
*(f"{env}={os.environ[env]}" for env in minimega_vars if env in os.environ),
*(
f"{env}={os.environ[env]}"
for env in minimega_vars
if env in os.environ
),
f"FIREWHEEL={fw_path}",
f"FIREWHEEL_PYTHON={sys.executable}",
f"FIREWHEEL_GRPC_SERVER={grpc_path}",
Expand Down
2 changes: 1 addition & 1 deletion src/firewheel/cli/firewheel_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -713,7 +713,7 @@ def do_history(self, args):
)
print("<Count>: <ID>:<Sequence Number> -- <command>")
for line in self.history_file:
print("%d: %s" % (counter, line.strip("\n"))) # noqa: FS001
print("%d: %s" % (counter, line.strip("\n")))
counter += 1
# We're done, reset our file descriptor.
self.history_file.close()
Expand Down
2 changes: 1 addition & 1 deletion src/firewheel/control/experiment_graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -1668,7 +1668,7 @@ def do_source(graph, vertex_filter, source_queue, path_queue):
self.log.debug("Only sampling %s of sources.", sample_pct)
for source in vert_it:
if sample_pct:
if random.random() < sample_pct: # noqa: DUO102
if random.random() < sample_pct:
source_queue.put(source.graph_id)
else:
source_queue.put(source.graph_id)
Expand Down
2 changes: 1 addition & 1 deletion src/firewheel/control/utils/paths.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def is_pathname_valid(pathname: str) -> bool: # pragma: no cover
# the drive to which Windows was installed (e.g., the "%HOMEDRIVE%"
# environment variable); else, the typical root directory.
root_dirname = (
os.environ.get("HOMEDRIVE", "C:") # noqa: IF100
os.environ.get("HOMEDRIVE", "C:")
if sys.platform == "win32"
else os.path.sep
)
Expand Down
2 changes: 1 addition & 1 deletion src/firewheel/lib/minimega/file_store.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def read(self, size: int = 16 * 1024 * 1024) -> bytes:

return self.handle.read(size)

def __exit__( # noqa: DOC109, DOC110
def __exit__(
self,
exc_type: Union[BaseException, None] = None,
exc_val: Union[BaseException, None] = None,
Expand Down
2 changes: 1 addition & 1 deletion src/firewheel/lib/utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ def decorator(func):
"""

@_wraps(func)
def f_retry(*args, **kwargs): # noqa: DOC109
def f_retry(*args, **kwargs):
"""
The retry loop which attempts the function ``num_tries`` times
and will catch exceptions passed into exceptions, then sleep
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -646,7 +646,7 @@ def read_file(self, filename, local_destination, mode="rb"):
RuntimeError: There is a read error.
RuntimeError: The return didn't have a byte count.
RuntimeError: The returned size does not match the read size.
""" # noqa: DAR402
"""

handle = None
try:
Expand Down
2 changes: 1 addition & 1 deletion src/firewheel/vm_resource_manager/vm_mapping.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ def get_count_vm_not_ready(self):
count = res["count"]
return count

def prepare_put(self, entry): # noqa: DOC503
def prepare_put(self, entry):
"""
Validate that the provided entry has the necessary fields and if it does
not, provide details or raise an error in the case of a required field.
Expand Down
2 changes: 1 addition & 1 deletion src/firewheel/vm_resource_manager/vm_resource_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -622,7 +622,7 @@ def transfer_data(self, name, location, interval=None, destination=None):
except Exception as exp: # noqa: BLE001
self.log.exception(exp)

def _transfer_data(self, name, location, interval=None, destination=None): # noqa: DOC503
def _transfer_data(self, name, location, interval=None, destination=None):
"""
The helper function which transfers data from the VM to the physical host
based on the input parameters.
Expand Down
Loading