Skip to content

Commit e47dc3e

Browse files
committed
ruff
1 parent 2248ed4 commit e47dc3e

File tree

5 files changed

+30
-12
lines changed

5 files changed

+30
-12
lines changed

src/warnet/cli/cluster.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import os
22
import subprocess
33
import sys
4+
from pathlib import Path
45

56
import click
67

@@ -51,7 +52,9 @@ def run_command(command, stream_output=False):
5152
@cluster.command()
5253
def minikube_setup():
5354
"""Setup minikube for use with Warnet"""
54-
template_path = Path(os.path.dirname(os.path.abspath(__file__))) / ".." / ".." / ".." / "manifests" / "rpc"
55+
template_path = (
56+
Path(os.path.dirname(os.path.abspath(__file__))) / ".." / ".." / ".." / "manifests" / "rpc"
57+
)
5558

5659
script_content = f"""
5760
#!/usr/bin/env bash
@@ -76,17 +79,17 @@ def minikube_setup():
7679
@cluster.command()
7780
def deploy():
7881
"""Setup Warnet using the current kubectl-configured cluster"""
79-
script_content = f"""
82+
script_content = """
8083
#!/usr/bin/env bash
8184
set -euxo pipefail
8285
8386
# Function to check if warnet-rpc container is already running
84-
check_warnet_rpc() {{
87+
check_warnet_rpc() {
8588
if kubectl get pods --all-namespaces | grep -q "bitcoindevproject/warnet-rpc"; then
8689
echo "warnet-rpc already running in minikube"
8790
exit 1
8891
fi
89-
}}
92+
}
9093
9194
# Setup K8s
9295
kubectl apply -f manifests/namespace.yaml

src/warnet/cli/image_build.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,16 @@
44

55
ARCHES = ["amd64", "arm64", "armhf"]
66

7-
dockerfile_path = Path(os.path.dirname(os.path.abspath(__file__))) / ".." / ".." / ".." / "images" / "bitcoin" / "Dockerfile"
7+
dockerfile_path = (
8+
Path(os.path.dirname(os.path.abspath(__file__)))
9+
/ ".."
10+
/ ".."
11+
/ ".."
12+
/ "images"
13+
/ "bitcoin"
14+
/ "Dockerfile"
15+
)
16+
817

918
def run_command(command):
1019
try:

src/warnet/cli/network.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,23 @@
1-
import os
21
import base64 # noqa: I001
2+
import json
3+
import os
34
from pathlib import Path
45

56
import click
6-
import json
77
from rich import print
88
from rich.console import Console
99
from rich.table import Table
10+
1011
from .rpc import rpc_call # noqa: I001
1112

12-
DEFAULT_GRAPH_FILE = Path(os.path.dirname(os.path.abspath(__file__))) / ".." / ".." / ".." / "graphs" / "default.graphml"
13+
DEFAULT_GRAPH_FILE = (
14+
Path(os.path.dirname(os.path.abspath(__file__)))
15+
/ ".."
16+
/ ".."
17+
/ ".."
18+
/ "graphs"
19+
/ "default.graphml"
20+
)
1321

1422

1523
def print_repr(wn: dict) -> None:

src/warnet/server.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@
2222
from flask import Flask, jsonify, request
2323
from flask_jsonrpc.app import JSONRPC
2424
from flask_jsonrpc.exceptions import ServerError
25+
from warnet import SRC_DIR
2526

2627
from .services import ServiceType
2728
from .utils import gen_config_dir
2829
from .warnet import Warnet
29-
from warnet import SRC_DIR
3030

3131
WARNET_SERVER_PORT = 9276
3232
CONFIG_DIR_ALREADY_EXISTS = 32001

src/warnet/warnet.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,11 @@
55
import base64
66
import json
77
import logging
8-
import shutil
98
from pathlib import Path
109

1110
import networkx
12-
import yaml
1311

1412
from .backend.kubernetes_backend import KubernetesBackend
15-
from .services import AO_CONF_NAME, FO_CONF_NAME, GRAFANA_PROVISIONING, PROM_CONF_NAME
1613
from .tank import Tank
1714
from .utils import gen_config_dir, load_schema, validate_graph_schema
1815

@@ -183,6 +180,7 @@ def warnet_down(self):
183180

184181
def generate_deployment(self):
185182
self.container_interface.generate_deployment_file(self)
183+
186184
# if "forkobserver" in self.services:
187185
# self.write_fork_observer_config()
188186
# if "addrmanobserver" in self.services:

0 commit comments

Comments
 (0)