Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pre-commit.ci] pre-commit autoupdate #101

Open
wants to merge 2 commits into
base: dev-2.x
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v5.0.0
hooks:
- id: "trailing-whitespace"
- id: "check-case-conflict"
Expand All @@ -18,19 +18,19 @@ repos:
- id: black
files: &files '^(glQiwiApi|tests|examples|benchmarks|docs)'

- repo: https://github.com/pre-commit/mirrors-isort
rev: v5.10.1
- repo: https://github.com/PyCQA/isort
rev: 6.0.0
hooks:
- id: isort
additional_dependencies: [ toml ]
files: *files

- repo: https://github.com/floatingpurr/sync_with_poetry
rev: 0.4.0
rev: 1.2.0
hooks:
- id: sync_with_poetry

- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: v0.0.204
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.0.189
hooks:
- id: ruff
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@


@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 @@


@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
Loading