Skip to content

Commit a2b1522

Browse files
committed
Ruff linting and formatting
1 parent 99cd291 commit a2b1522

File tree

155 files changed

+527
-502
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

155 files changed

+527
-502
lines changed

general_itests/steps/deployments_json_steps.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -186,9 +186,9 @@ def step_impl_then(context):
186186
},
187187
}
188188
)
189-
assert (
190-
expected_deployments == deployments
191-
), f"actual: {deployments}\nexpected:{expected_deployments}"
189+
assert expected_deployments == deployments, (
190+
f"actual: {deployments}\nexpected:{expected_deployments}"
191+
)
192192

193193

194194
@then('that deployments.json has a desired_state of "{expected_state}"')
@@ -202,9 +202,9 @@ def step_impl_then_desired_state(context, expected_state):
202202
reverse=True,
203203
)[0][1]
204204
desired_state = latest["desired_state"]
205-
assert (
206-
desired_state == expected_state
207-
), f"actual: {desired_state}\nexpected: {expected_state}"
205+
assert desired_state == expected_state, (
206+
f"actual: {desired_state}\nexpected: {expected_state}"
207+
)
208208

209209

210210
@then("the repository should be correctly tagged")

general_itests/steps/validate_steps.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,9 @@ def given_service(context, service_type):
2828

2929
@when("we run paasta validate")
3030
def run_paasta_validate(context):
31-
validate_cmd = (
32-
"paasta validate "
33-
"--yelpsoa-config-root %s "
34-
"--service %s " % (context.soa_dir, context.service)
31+
validate_cmd = "paasta validate --yelpsoa-config-root %s --service %s " % (
32+
context.soa_dir,
33+
context.service,
3534
)
3635
context.return_code, context.output = _run(command=validate_cmd)
3736

k8s_itests/scripts/containerd_registry_setup.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
import toml
55

6+
67
containerdcfg_file_path = sys.argv[1]
78
containerdcfg = toml.load(containerdcfg_file_path)
89
dockercfg = json.load(open("/nail/etc/docker-registry-ro"))

k8s_itests/test_autoscaling.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
from k8s_itests.utils import cmd
44
from k8s_itests.utils import init_all
55

6+
67
terminate_on_exit = []
78

89

paasta_tools/api/api.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
"""
1616
Responds to paasta service and instance requests.
1717
"""
18+
1819
import argparse
1920
import contextlib
2021
import logging
@@ -36,6 +37,7 @@
3637
from paasta_tools.api.tweens import request_logger
3738
from paasta_tools.utils import load_system_paasta_config
3839

40+
3941
try:
4042
import clog
4143
except ImportError:

paasta_tools/api/client.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
"""
1616
Client interface for the Paasta rest api.
1717
"""
18+
1819
import logging
1920
from dataclasses import dataclass
2021
from typing import Optional
@@ -61,9 +62,9 @@ def get_paasta_oapi_client_by_url(
6162

6263
client = paastaapi.ApiClient(configuration=config)
6364
# PAASTA-18005: Adds default timeout to paastaapi client
64-
client.rest_client.pool_manager.connection_pool_kw[
65-
"timeout"
66-
] = load_system_paasta_config().get_api_client_timeout()
65+
client.rest_client.pool_manager.connection_pool_kw["timeout"] = (
66+
load_system_paasta_config().get_api_client_timeout()
67+
)
6768
# SEC-19555: support auth in PaaSTA APIs
6869
if auth_token:
6970
client.set_default_header("Authorization", f"Bearer {auth_token}")

paasta_tools/api/settings.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
"""
1515
Settings of the paasta-api server.
1616
"""
17+
1718
import os
1819
from typing import Optional
1920

@@ -22,6 +23,7 @@
2223
from paasta_tools.utils import DEFAULT_SOA_DIR
2324
from paasta_tools.utils import SystemPaastaConfig
2425

26+
2527
soa_dir: str = os.environ.get("PAASTA_API_SOA_DIR", DEFAULT_SOA_DIR)
2628

2729
# The following `type: ignore` mypy hints are there because variables below de

paasta_tools/api/tweens/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@
33
from pyramid.request import Request
44
from pyramid.response import Response
55

6+
67
Handler = Callable[[Request], Response]

paasta_tools/api/tweens/profiling.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,13 @@
1414
"""
1515
Creates a tween that cprofiles requests
1616
"""
17+
1718
import pyramid
1819
import pytz
1920

2021
from paasta_tools.api import settings as api_settings
2122

23+
2224
try:
2325
# hackily patch pytz, since yelp_lib (used by yelp_profiling) type checks
2426
# using an older version of pytz where tzinfo didn't exist yet. this needs to

paasta_tools/api/tweens/request_logger.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
"""
1515
Creates a tween that logs information about requests.
1616
"""
17+
1718
import json
1819
import traceback
1920
from datetime import datetime
@@ -23,6 +24,7 @@
2324

2425
from paasta_tools.api import settings
2526

27+
2628
try:
2729
import clog
2830
except ImportError:

0 commit comments

Comments
 (0)