Skip to content

Commit 6cc3d32

Browse files
MHHukiewitzhoh
authored andcommitted
Problem: new version of black invalidates prior formatting
Solution: update black and reformat files
1 parent 7d38872 commit 6cc3d32

File tree

11 files changed

+30
-26
lines changed

11 files changed

+30
-26
lines changed

examples/httpgateway.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
""" Server metrics upload.
22
"""
3+
34
# -*- coding: utf-8 -*-
45

56
import click

examples/metrics.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
""" Server metrics upload.
22
"""
3+
34
import asyncio
45
import os
56
import platform

examples/mqtt.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
""" Server metrics upload.
22
"""
3+
34
# -*- coding: utf-8 -*-
45

56
import asyncio

src/aleph/sdk/chains/nuls1.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
""" Barebone NULS address and message signing support.
22
"""
3+
34
import hashlib
45
import logging
56
import struct

src/aleph/sdk/chains/remote.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""
22
Remote account, accessible via an API.
33
"""
4+
45
import asyncio
56
from typing import Dict, Optional
67

src/aleph/sdk/client/authenticated_http.py

+10-6
Original file line numberDiff line numberDiff line change
@@ -476,9 +476,11 @@ async def create_program(
476476
runtime=FunctionRuntime(
477477
ref=runtime,
478478
use_latest=True,
479-
comment="Official aleph.im runtime"
480-
if runtime == settings.DEFAULT_RUNTIME_ID
481-
else "",
479+
comment=(
480+
"Official aleph.im runtime"
481+
if runtime == settings.DEFAULT_RUNTIME_ID
482+
else ""
483+
),
482484
),
483485
volumes=[parse_volume(volume) for volume in volumes],
484486
time=time.time(),
@@ -549,9 +551,11 @@ async def create_instance(
549551
size_mib=rootfs_size,
550552
persistence="host",
551553
use_latest=True,
552-
comment="Official Aleph Debian root filesystem"
553-
if rootfs == settings.DEFAULT_RUNTIME_ID
554-
else "",
554+
comment=(
555+
"Official Aleph Debian root filesystem"
556+
if rootfs == settings.DEFAULT_RUNTIME_ID
557+
else ""
558+
),
555559
),
556560
volumes=[parse_volume(volume) for volume in volumes],
557561
time=time.time(),

src/aleph/sdk/conf.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,9 @@ class Settings(BaseSettings):
2929
REMOTE_CRYPTO_UNIX_SOCKET: Optional[str] = None
3030
ADDRESS_TO_USE: Optional[str] = None
3131

32-
DEFAULT_RUNTIME_ID: str = "f873715dc2feec3833074bd4b8745363a0e0093746b987b4c8191268883b2463" # Debian 12 official runtime
32+
DEFAULT_RUNTIME_ID: str = (
33+
"f873715dc2feec3833074bd4b8745363a0e0093746b987b4c8191268883b2463" # Debian 12 official runtime
34+
)
3335
DEFAULT_VM_MEMORY: int = 256
3436
DEFAULT_VM_VCPUS: int = 1
3537
DEFAULT_VM_TIMEOUT: float = 30.0

src/aleph/sdk/types.py

+4-8
Original file line numberDiff line numberDiff line change
@@ -18,23 +18,19 @@ class Account(Protocol):
1818
CURVE: str
1919

2020
@abstractmethod
21-
async def sign_message(self, message: Dict) -> Dict:
22-
...
21+
async def sign_message(self, message: Dict) -> Dict: ...
2322

2423
@abstractmethod
25-
def get_address(self) -> str:
26-
...
24+
def get_address(self) -> str: ...
2725

2826
@abstractmethod
29-
def get_public_key(self) -> str:
30-
...
27+
def get_public_key(self) -> str: ...
3128

3229

3330
class AccountFromPrivateKey(Account, Protocol):
3431
"""Only accounts that are initialized from a private key string are supported."""
3532

36-
def __init__(self, private_key: bytes):
37-
...
33+
def __init__(self, private_key: bytes): ...
3834

3935

4036
GenericMessage = TypeVar("GenericMessage", bound=AlephMessage)

src/aleph/sdk/utils.py

+2-4
Original file line numberDiff line numberDiff line change
@@ -98,13 +98,11 @@ def check_unix_socket_valid(unix_socket_path: str) -> bool:
9898

9999

100100
class AsyncReadable(Protocol[T]):
101-
async def read(self, n: int = -1) -> T:
102-
...
101+
async def read(self, n: int = -1) -> T: ...
103102

104103

105104
class Writable(Protocol[U]):
106-
def write(self, buffer: U) -> int:
107-
...
105+
def write(self, buffer: U) -> int: ...
108106

109107

110108
async def copy_async_readable_to_buffer(

tests/unit/conftest.py

+5-7
Original file line numberDiff line numberDiff line change
@@ -130,9 +130,9 @@ def json_post() -> dict:
130130
@pytest.fixture
131131
def raw_messages_response(aleph_messages) -> Callable[[int], Dict[str, Any]]:
132132
return lambda page: {
133-
"messages": [message.dict() for message in aleph_messages]
134-
if int(page) == 1
135-
else [],
133+
"messages": (
134+
[message.dict() for message in aleph_messages] if int(page) == 1 else []
135+
),
136136
"pagination_item": "messages",
137137
"pagination_page": int(page),
138138
"pagination_per_page": max(len(aleph_messages), 20),
@@ -158,11 +158,9 @@ def __init__(self, sync: bool):
158158
async def __aenter__(self):
159159
return self
160160

161-
async def __aexit__(self, exc_type, exc_val, exc_tb):
162-
...
161+
async def __aexit__(self, exc_type, exc_val, exc_tb): ...
163162

164-
async def raise_for_status(self):
165-
...
163+
async def raise_for_status(self): ...
166164

167165
@property
168166
def status(self):

tests/unit/test_chain_nuls1_compat.py

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
33
This file tests that both implementations returns identical results.
44
"""
5+
56
from pathlib import Path
67
from tempfile import NamedTemporaryFile
78

0 commit comments

Comments
 (0)