Skip to content

Commit 48b1326

Browse files
committed
lint
1 parent 4005794 commit 48b1326

File tree

7 files changed

+15
-18
lines changed

7 files changed

+15
-18
lines changed

Diff for: resources/scenarios/ln_init.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#!/usr/bin/env python3
22

33
from time import sleep
4+
45
from commander import Commander
56

67

Diff for: resources/scenarios/miner_std.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#!/usr/bin/env python3
22

33
from time import sleep
4+
45
from commander import Commander
56

67

Diff for: resources/scenarios/tx_flood.py

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import threading
44
from random import choice, randrange
55
from time import sleep
6+
67
from commander import Commander
78

89

Diff for: src/warnet/bitcoin.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,9 @@
55
from io import BytesIO
66

77
import click
8-
from urllib3.exceptions import MaxRetryError
9-
108
from test_framework.messages import ser_uint256
119
from test_framework.p2p import MESSAGEMAP
10+
from urllib3.exceptions import MaxRetryError
1211

1312
from .k8s import get_default_namespace, get_mission
1413
from .process import run_command

Diff for: src/warnet/control.py

+7-13
Original file line numberDiff line numberDiff line change
@@ -200,25 +200,19 @@ def run(scenario_file: str, additional_args: tuple[str]):
200200

201201
# No need to copy the entire scenarios/ directory into the archive
202202
def filter(path):
203-
if any(
204-
needle in str(path) for needle in [
205-
".pyc",
206-
".csv",
207-
".DS_Store"
208-
]
209-
):
203+
if any(needle in str(path) for needle in [".pyc", ".csv", ".DS_Store"]):
210204
return False
211205
return any(
212-
needle in str(path) for needle in [
213-
"commander.py",
214-
"test_framework",
215-
scenario_name
216-
]
206+
needle in str(path) for needle in ["commander.py", "test_framework", scenario_name]
217207
)
218208

219209
# Compile python archive
220210
zipapp.create_archive(
221-
source=scenario_dir, target=archive_buffer, main=f"{scenario_name}:main", compressed=True, filter=filter
211+
source=scenario_dir,
212+
target=archive_buffer,
213+
main=f"{scenario_name}:main",
214+
compressed=True,
215+
filter=filter,
222216
)
223217

224218
# Encode the binary data as Base64

Diff for: src/warnet/graph.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,9 @@ def custom_graph(
7474
yaml.dump(network_yaml_data, f, default_flow_style=False)
7575

7676
# Generate node-defaults.yaml
77-
default_yaml_path = files("resources.networks").joinpath("fork_observer").joinpath("node-defaults.yaml")
77+
default_yaml_path = (
78+
files("resources.networks").joinpath("fork_observer").joinpath("node-defaults.yaml")
79+
)
7880
with open(str(default_yaml_path)) as f:
7981
defaults_yaml_content = yaml.safe_load(f)
8082

Diff for: src/warnet/network.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import json
2-
import re
32
import shutil
43
from pathlib import Path
54

@@ -23,7 +22,7 @@ def copy_defaults(directory: Path, target_subdir: str, source_path: Path, exclud
2322
src=source_path,
2423
dst=target_dir,
2524
dirs_exist_ok=True,
26-
ignore=shutil.ignore_patterns(*exclude_list)
25+
ignore=shutil.ignore_patterns(*exclude_list),
2726
)
2827

2928
print(f"Finished copying files to {target_dir}")

0 commit comments

Comments
 (0)