Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Sep 2, 2024
1 parent 3f0da79 commit d747f62
Show file tree
Hide file tree
Showing 20 changed files with 52 additions and 63 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ repos:
- id: "check-toml"

- repo: https://github.com/psf/black
rev: 24.8.0
rev: 22.12.0
hooks:
- id: black
files: &files '^(glQiwiApi|tests|examples|benchmarks|docs)'
Expand Down
6 changes: 2 additions & 4 deletions glQiwiApi/core/cache/storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,10 @@ async def delete(self, key: str) -> None:
pass

@abc.abstractmethod
async def retrieve_all(self) -> List[Any]:
...
async def retrieve_all(self) -> List[Any]: ...

Check notice

Code scanning / CodeQL

Statement has no effect Note

This statement has no effect.

@abc.abstractmethod
async def contains_similar(self, item: Any) -> bool:
...
async def contains_similar(self, item: Any) -> bool: ...

Check notice

Code scanning / CodeQL

Statement has no effect Note

This statement has no effect.

def __getitem__(self, item: Any) -> Any:
return self.retrieve(item)
Expand Down
6 changes: 3 additions & 3 deletions glQiwiApi/core/event_fetching/webhooks/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ class RoutesConfig:
@dataclass()
class EncryptionConfig:
secret_p2p_key: str
base64_encryption_key: Optional[
str
] = None # taken from QIWI API using QiwiWallet instance by default
base64_encryption_key: Optional[str] = (
None # taken from QIWI API using QiwiWallet instance by default
)


@dataclass()
Expand Down
12 changes: 4 additions & 8 deletions glQiwiApi/core/request_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@


class RequestServiceProto(Protocol):
async def execute_api_method(self, method: APIMethod[T], **url_kw: Any) -> T:
...
async def execute_api_method(self, method: APIMethod[T], **url_kw: Any) -> T: ...

Check notice

Code scanning / CodeQL

Statement has no effect Note

This statement has no effect.

async def get_json_content(
self,
Expand All @@ -27,8 +26,7 @@ async def get_json_content(
headers: Optional[Any] = None,
params: Optional[Any] = None,
**kwargs: Any,
) -> Dict[str, Any]:
...
) -> Dict[str, Any]: ...

Check notice

Code scanning / CodeQL

Statement has no effect Note

This statement has no effect.

async def send_request(
self,
Expand All @@ -40,11 +38,9 @@ async def send_request(
headers: Optional[Any] = None,
params: Optional[Any] = None,
**kwargs: Any,
) -> HTTPResponse:
...
) -> HTTPResponse: ...

Check notice

Code scanning / CodeQL

Statement has no effect Note

This statement has no effect.

async def shutdown(self) -> None:
...
async def shutdown(self) -> None: ...

Check notice

Code scanning / CodeQL

Statement has no effect Note

This statement has no effect.


class RequestService:
Expand Down
6 changes: 3 additions & 3 deletions glQiwiApi/qiwi/clients/p2p/methods/create_p2p_key_pair.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@

class CreateP2PKeyPair(QiwiAPIMethod[PairOfP2PKeys]):
http_method: ClassVar[str] = 'POST'
url: ClassVar[
str
] = 'https://api.qiwi.com/partner/bill/v1/bills/widgets-api/api/p2p/protected/keys/create'
url: ClassVar[str] = (
'https://api.qiwi.com/partner/bill/v1/bills/widgets-api/api/p2p/protected/keys/create'
)

json_payload_schema: ClassVar[Dict[str, Any]] = {
'keysPairName': RuntimeValue(),
Expand Down
6 changes: 3 additions & 3 deletions glQiwiApi/qiwi/clients/wallet/methods/authenticate_wallet.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@


class AuthenticateWallet(QiwiAPIMethod[Dict[str, Any]]):
url: ClassVar[
str
] = 'https://edge.qiwi.com/identification/v1/persons/{phone_number}/identification'
url: ClassVar[str] = (
'https://edge.qiwi.com/identification/v1/persons/{phone_number}/identification'
)
http_method: ClassVar[str] = 'POST'

passport: str
Expand Down
6 changes: 3 additions & 3 deletions glQiwiApi/qiwi/clients/wallet/methods/check_restriction.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@


class GetRestrictions(QiwiAPIMethod[List[Restriction]]):
url: ClassVar[
str
] = 'https://edge.qiwi.com/person-profile/v1/persons/{phone_number}/status/restrictions'
url: ClassVar[str] = (
'https://edge.qiwi.com/person-profile/v1/persons/{phone_number}/status/restrictions'
)
http_method: ClassVar[str] = 'GET'
6 changes: 3 additions & 3 deletions glQiwiApi/qiwi/clients/wallet/methods/fetch_statistics.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@


class FetchStatistics(QiwiAPIMethod[Statistic]):
url: ClassVar[
str
] = 'https://edge.qiwi.com/payment-history/v2/persons/{phone_number}/payments/total'
url: ClassVar[str] = (
'https://edge.qiwi.com/payment-history/v2/persons/{phone_number}/payments/total'
)
http_method: ClassVar[str] = 'GET'

start_date: datetime = Field(default_factory=datetime.now)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@

class GetAvailableBalances(QiwiAPIMethod[List[AvailableBalance]]):
http_method: ClassVar[str] = 'GET'
url: ClassVar[
str
] = 'https://edge.qiwi.com/funding-sources/v2/persons/{phone_number}/accounts/offer'
url: ClassVar[str] = (
'https://edge.qiwi.com/funding-sources/v2/persons/{phone_number}/accounts/offer'
)
6 changes: 3 additions & 3 deletions glQiwiApi/qiwi/clients/wallet/methods/get_identification.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@

class GetIdentification(QiwiAPIMethod[Identification]):
http_method: ClassVar[str] = 'GET'
url: ClassVar[
str
] = 'https://edge.qiwi.com/identification/v1/persons/{phone_number}/identification'
url: ClassVar[str] = (
'https://edge.qiwi.com/identification/v1/persons/{phone_number}/identification'
)
6 changes: 3 additions & 3 deletions glQiwiApi/qiwi/clients/wallet/methods/get_receipt.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@


class GetReceipt(QiwiAPIMethod[File]):
url: ClassVar[
str
] = 'https://edge.qiwi.com/payment-history/v1/transactions/{transaction_id}/cheque/file'
url: ClassVar[str] = (
'https://edge.qiwi.com/payment-history/v1/transactions/{transaction_id}/cheque/file'
)
http_method: ClassVar[str] = 'GET'

transaction_id: Union[str, int] = Field(..., path_runtime_value=True)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@


class ConfirmQiwiMasterPurchaseOrder(QiwiAPIMethod[OrderDetails]):
url: ClassVar[
str
] = 'https://edge.qiwi.com/cards/v2/persons/{phone_number}/orders/{order_id}/submit'
url: ClassVar[str] = (
'https://edge.qiwi.com/cards/v2/persons/{phone_number}/orders/{order_id}/submit'
)
http_method: ClassVar[str] = 'PUT'

order_id: str = Field(..., path_runtime_value=True)
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@


class GetQiwiMasterStatement(QiwiAPIMethod[File]):
url: ClassVar[
str
] = 'https://edge.qiwi.com/payment-history/v1/persons/{phone_number}/cards/{card_id}/statement'
url: ClassVar[str] = (
'https://edge.qiwi.com/payment-history/v1/persons/{phone_number}/cards/{card_id}/statement'
)
http_method: ClassVar[str] = 'GET'

card_id: str = Field(..., path_runtime_value=True)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@


class UnblockQiwiMasterCard(QiwiAPIMethod[Dict[str, Any]]):
url: ClassVar[
str
] = 'https://edge.qiwi.com/cards/v2/persons/{phone_number}/cards/{card_id}/unblock'
url: ClassVar[str] = (
'https://edge.qiwi.com/cards/v2/persons/{phone_number}/cards/{card_id}/unblock'
)
http_method: ClassVar[str] = 'GET'

card_id: str = Field(..., path_runtime_value=True)
Expand Down
6 changes: 3 additions & 3 deletions glQiwiApi/qiwi/clients/wallet/methods/set_default_balance.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@

class SetDefaultBalance(QiwiAPIMethod[Dict[Any, Any]]):
http_method: ClassVar[str] = 'PATCH'
url: ClassVar[
str
] = 'https://edge.qiwi.com/funding-sources/v2/persons/{phone_number}/accounts/{account_alias}'
url: ClassVar[str] = (
'https://edge.qiwi.com/funding-sources/v2/persons/{phone_number}/accounts/{account_alias}'
)

account_alias: str = Field(..., path_runtime_value=True)
1 change: 1 addition & 0 deletions glQiwiApi/qiwi/clients/wallet/types/partner.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Main model: Partner"""

from typing import List, Optional

from glQiwiApi.types.base import Base
Expand Down
6 changes: 2 additions & 4 deletions glQiwiApi/types/amount.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,17 +39,15 @@ def humanize_pay_currency(cls, v): # type: ignore
return Currency.get(str(v))


class HashableSum(HashableBase, AmountWithCurrency):
...
class HashableSum(HashableBase, AmountWithCurrency): ...

Check notice

Code scanning / CodeQL

Statement has no effect Note

This statement has no effect.


class PlainAmount(BaseModel):
value: float
currency: str


class HashablePlainAmount(HashableBase, PlainAmount):
...
class HashablePlainAmount(HashableBase, PlainAmount): ...

Check notice

Code scanning / CodeQL

Statement has no effect Note

This statement has no effect.


class Type(BaseModel):
Expand Down
3 changes: 1 addition & 2 deletions glQiwiApi/types/arbitrary/inputs.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ def __init__(self, input_: InputType) -> None:
self._file_descriptor: Optional[BinaryIO] = None

@abc.abstractmethod
def get_file(self) -> BinaryIO:
...
def get_file(self) -> BinaryIO: ...

Check notice

Code scanning / CodeQL

Statement has no effect Note

This statement has no effect.

def get_path(self) -> str:
raise TypeError(
Expand Down
12 changes: 4 additions & 8 deletions glQiwiApi/utils/validators.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,13 +111,11 @@ def _validate(self, value: _FieldType) -> None:


@overload
def String(optional: Literal[True], **options: Any) -> Field[Optional[str]]:
...
def String(optional: Literal[True], **options: Any) -> Field[Optional[str]]: ...

Check notice

Code scanning / CodeQL

Statement has no effect Note

This statement has no effect.


@overload
def String(optional: Literal[False], **options: Any) -> Field[str]:
...
def String(optional: Literal[False], **options: Any) -> Field[str]: ...

Check notice

Code scanning / CodeQL

Statement has no effect Note

This statement has no effect.


def String(optional: bool = False, **options: Any) -> Union[Field[Optional[str]], Field[str]]:
Expand All @@ -129,13 +127,11 @@ def PhoneNumber(**options: Any) -> Field[Optional[str]]:


@overload
def Integer(optional: Literal[True]) -> Field[Optional[int]]:
...
def Integer(optional: Literal[True]) -> Field[Optional[int]]: ...

Check notice

Code scanning / CodeQL

Statement has no effect Note

This statement has no effect.


@overload
def Integer(optional: Literal[False]) -> Field[int]:
...
def Integer(optional: Literal[False]) -> Field[int]: ...

Check notice

Code scanning / CodeQL

Statement has no effect Note

This statement has no effect.


def Integer(optional: bool = False) -> Union[Field[Optional[int]], Field[int]]:
Expand Down
1 change: 1 addition & 0 deletions glQiwiApi/yoo_money/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
Provides effortless work with YooMoney API using asynchronous requests.
"""

from __future__ import annotations

import asyncio
Expand Down

0 comments on commit d747f62

Please sign in to comment.