Skip to content

Commit 05913cd

Browse files
author
Sergio Schvezov
authored
static: update to newer black (#2599)
1 parent a646def commit 05913cd

15 files changed

Lines changed: 35 additions & 41 deletions

File tree

snapcraft/cli/ci.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def cicli():
3535
@click.option(
3636
"--refresh",
3737
is_flag=True,
38-
help=("Refresh the macaroon required to be able to push and release to channels"),
38+
help="Refresh the macaroon required to be able to push and release to channels",
3939
)
4040
def enableci(ci_system, refresh):
4141
"""Enable continuous-integration systems to build and release snaps."""

snapcraft/internal/deltas/_deltas.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ def _update_progress_indicator(self, proc, progress_indicator):
159159
count = 0
160160
progress_indicator.update(count)
161161
count += 1
162-
time.sleep(.2)
162+
time.sleep(0.2)
163163
ret = proc.poll()
164164
print("")
165165
# the caller should finish the progressbar outside
@@ -193,9 +193,13 @@ def make_delta(self, output_dir=None, progress_indicator=None, is_for_test=False
193193

194194
delta_cmd = self.get_delta_cmd(self.source_path, self.target_path, delta_file)
195195

196-
workdir, stdout_path, stdout_file, stderr_path, stderr_file = self._setup_std_output(
197-
delta_file
198-
)
196+
(
197+
workdir,
198+
stdout_path,
199+
stdout_file,
200+
stderr_path,
201+
stderr_file,
202+
) = self._setup_std_output(delta_file)
199203

200204
proc = subprocess.Popen(
201205
delta_cmd, stdout=stdout_file, stderr=stderr_file, cwd=workdir

snapcraft/internal/lifecycle/_packer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ def _run_mksquashfs(
126126
count = 0
127127
progress_indicator.update(count)
128128
count += 1
129-
time.sleep(.2)
129+
time.sleep(0.2)
130130
ret = proc.poll()
131131
print("")
132132
if ret != 0:

snapcraft/plugins/cmake.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ def _get_processed_flags(self) -> List[str]:
140140

141141
flags = [_Flag(f) for f in self.options.configflags]
142142
for flag in flags:
143-
if flag.name == ("-DCMAKE_FIND_ROOT_PATH"):
143+
if flag.name == "-DCMAKE_FIND_ROOT_PATH":
144144
flag.value = "{};{}".format(flag.value, ";".join(build_snap_paths))
145145
break
146146
else:

snapcraft/storeapi/_sca_client.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,9 @@ def get_macaroon(self, acls, packages=None, channels=None, expires=None):
4242

4343
@staticmethod
4444
def _is_needs_refresh_response(response):
45-
return response.status_code == requests.codes.unauthorized and response.headers.get(
46-
"WWW-Authenticate"
47-
) == (
48-
"Macaroon needs_refresh=1"
45+
return (
46+
response.status_code == requests.codes.unauthorized
47+
and response.headers.get("WWW-Authenticate") == "Macaroon needs_refresh=1"
4948
)
5049

5150
def request(self, *args, **kwargs):
@@ -246,9 +245,9 @@ def get_assertion(self, snap_id, endpoint):
246245
try:
247246
response_json = response.json()
248247
except JSONDecodeError:
249-
message = (
250-
"Invalid response from the server when getting {}: {} {}"
251-
).format(endpoint, response.status_code, response)
248+
message = "Invalid response from the server when getting {}: {} {}".format(
249+
endpoint, response.status_code, response
250+
)
252251
logger.debug(message)
253252
raise errors.StoreValidationError(
254253
snap_id, response, message="Invalid response from the server"

snapcraft/storeapi/errors.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -404,9 +404,8 @@ def __init__(self, response):
404404
what = "The Snap Store encountered an error while processing your request"
405405
error_code = response.status_code
406406
error_text = responses[error_code].lower()
407-
action = (
408-
"The operational status of the Snap Store can be checked at "
409-
"{}".format(_STORE_STATUS_URL)
407+
action = "The operational status of the Snap Store can be checked at {}".format(
408+
_STORE_STATUS_URL
410409
)
411410

412411
super().__init__(

tests/fake_servers/api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -405,7 +405,7 @@ def snap_close(self, request):
405405
"error_list": [
406406
{
407407
"code": "invalid-field",
408-
"message": ("The 'channels' field content is not valid."),
408+
"message": "The 'channels' field content is not valid.",
409409
}
410410
]
411411
}

tests/unit/build_providers/multipass/test_instance_info.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
from snapcraft.internal.build_providers import errors
2222
from snapcraft.internal.build_providers._multipass._instance_info import (
23-
InstanceInfo
23+
InstanceInfo,
2424
) # noqa: E501
2525
from tests import unit
2626

tests/unit/build_providers/test_errors.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ class ErrorFormattingTest(unit.TestCase):
326326
dict(
327327
exception=errors.ProviderInstanceNotFoundError,
328328
kwargs=dict(instance_name="test-build"),
329-
expected_message=("Cannot find an instance named 'test-build'."),
329+
expected_message="Cannot find an instance named 'test-build'.",
330330
),
331331
),
332332
(

tests/unit/commands/__init__.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,11 @@
2727
_sample_keys = [
2828
{
2929
"name": "default",
30-
"sha3-384": (
31-
"vdEeQvRxmZ26npJCFaGnl-VfGz0lU2jZZkWp_s7E-RxVCNtH2_mtjcxq2NkDKkIp"
32-
),
30+
"sha3-384": "vdEeQvRxmZ26npJCFaGnl-VfGz0lU2jZZkWp_s7E-RxVCNtH2_mtjcxq2NkDKkIp",
3331
},
3432
{
3533
"name": "another",
36-
"sha3-384": (
37-
"JsfToV5hO2eN9l89pYYCKXUioTERrZIIHUgQQd47jW8YNNBskupiIjWYd3KXLY_D"
38-
),
34+
"sha3-384": "JsfToV5hO2eN9l89pYYCKXUioTERrZIIHUgQQd47jW8YNNBskupiIjWYd3KXLY_D",
3935
},
4036
]
4137

0 commit comments

Comments
 (0)