From abc927b99f1bf96a521640f5d6fc98606052db88 Mon Sep 17 00:00:00 2001 From: Vlad Emelianov Date: Sat, 30 Jul 2022 05:38:38 +0300 Subject: [PATCH] Type-ignored AwsCredentials --- botocore-stubs/crt/auth.pyi | 20 +++-- botocore-stubs/py.typed | 1 - istub.yml | 145 +----------------------------------- scripts/before_commit.sh | 1 + 4 files changed, 18 insertions(+), 149 deletions(-) diff --git a/botocore-stubs/crt/auth.pyi b/botocore-stubs/crt/auth.pyi index 08cdc0f..5cf077b 100644 --- a/botocore-stubs/crt/auth.pyi +++ b/botocore-stubs/crt/auth.pyi @@ -1,7 +1,7 @@ from typing import Dict # FIXME: awscrt is untyped -from awscrt.auth import AwsCredentials # type: ignore +from awscrt.auth import AwsCredentials from botocore.auth import SIGNED_HEADERS_BLACKLIST as SIGNED_HEADERS_BLACKLIST from botocore.auth import STREAMING_UNSIGNED_PAYLOAD_TRAILER as STREAMING_UNSIGNED_PAYLOAD_TRAILER from botocore.auth import UNSIGNED_PAYLOAD as UNSIGNED_PAYLOAD @@ -17,7 +17,12 @@ from botocore.utils import percent_encode_sequence as percent_encode_sequence class CrtSigV4Auth(BaseSigner): REQUIRES_REGION: bool = ... - def __init__(self, credentials: AwsCredentials, service_name: str, region_name: str) -> None: + def __init__( + self, + credentials: AwsCredentials, # type: ignore + service_name: str, + region_name: str, + ) -> None: self.credentials: AwsCredentials = ... def add_auth(self, request: AWSRequest) -> None: ... @@ -26,7 +31,12 @@ class CrtS3SigV4Auth(CrtSigV4Auth): ... class CrtSigV4AsymAuth(BaseSigner): REQUIRES_REGION: bool = ... - def __init__(self, credentials: AwsCredentials, service_name: str, region_name: str) -> None: + def __init__( + self, + credentials: AwsCredentials, # type: ignore + service_name: str, + region_name: str, + ) -> None: self.credentials: AwsCredentials = ... def add_auth(self, request: AWSRequest) -> None: ... @@ -37,7 +47,7 @@ class CrtSigV4AsymQueryAuth(CrtSigV4AsymAuth): def __init__( self, - credentials: AwsCredentials, + credentials: AwsCredentials, # type: ignore service_name: str, region_name: str, expires: int = ..., @@ -49,7 +59,7 @@ class CrtSigV4QueryAuth(CrtSigV4Auth): DEFAULT_EXPIRES: int = ... def __init__( self, - credentials: AwsCredentials, + credentials: AwsCredentials, # type: ignore service_name: str, region_name: str, expires: int = ..., diff --git a/botocore-stubs/py.typed b/botocore-stubs/py.typed index b648ac9..e69de29 100644 --- a/botocore-stubs/py.typed +++ b/botocore-stubs/py.typed @@ -1 +0,0 @@ -partial diff --git a/istub.yml b/istub.yml index bb23989..4853850 100644 --- a/istub.yml +++ b/istub.yml @@ -8,146 +8,5 @@ packages: stubtest: true snapshots: stubtest: |- - error: botocore.docs failed to find stubs - Stub: - MISSING - Runtime: - - - error: botocore.docs.bcdoc failed to find stubs - Stub: - MISSING - Runtime: - - - error: botocore.docs.bcdoc.docstringparser failed to find stubs - Stub: - MISSING - Runtime: - - - error: botocore.docs.bcdoc.restdoc failed to find stubs - Stub: - MISSING - Runtime: - - - error: botocore.docs.bcdoc.style failed to find stubs - Stub: - MISSING - Runtime: - - - error: botocore.docs.client failed to find stubs - Stub: - MISSING - Runtime: - - - error: botocore.docs.docstring failed to find stubs - Stub: - MISSING - Runtime: - - - error: botocore.docs.example failed to find stubs - Stub: - MISSING - Runtime: - - - error: botocore.docs.method failed to find stubs - Stub: - MISSING - Runtime: - - - error: botocore.docs.paginator failed to find stubs - Stub: - MISSING - Runtime: - - - error: botocore.docs.params failed to find stubs - Stub: - MISSING - Runtime: - - - error: botocore.docs.service failed to find stubs - Stub: - MISSING - Runtime: - - - error: botocore.docs.shape failed to find stubs - Stub: - MISSING - Runtime: - - - error: botocore.docs.sharedexample failed to find stubs - Stub: - MISSING - Runtime: - - - error: botocore.docs.utils failed to find stubs - Stub: - MISSING - Runtime: - - - error: botocore.docs.waiter failed to find stubs - Stub: - MISSING - Runtime: - - - error: botocore.httpchecksum failed to find stubs - Stub: - MISSING - Runtime: - - - error: botocore.vendored failed to find stubs - Stub: - MISSING - Runtime: - - - error: botocore.vendored.requests failed to find stubs - Stub: - MISSING - Runtime: - - - error: botocore.vendored.requests.exceptions failed to find stubs - Stub: - MISSING - Runtime: - - - error: botocore.vendored.requests.packages failed to find stubs - Stub: - MISSING - Runtime: - - - error: botocore.vendored.requests.packages.urllib3 failed to find stubs - Stub: - MISSING - Runtime: - - - error: botocore.vendored.requests.packages.urllib3.exceptions failed to find stubs - Stub: - MISSING - Runtime: - - - error: botocore.vendored.six failed to find stubs - Stub: - MISSING - Runtime: - + error: not checking stubs due to mypy build errors: + botocore-stubs/crt/auth.pyi:4: error: Skipping analyzing "awscrt.auth": module is installed, but missing library stubs or py.typed marker diff --git a/scripts/before_commit.sh b/scripts/before_commit.sh index c760c51..b39e610 100755 --- a/scripts/before_commit.sh +++ b/scripts/before_commit.sh @@ -4,6 +4,7 @@ set -e ROOT_PATH=$(dirname $(dirname $0)) cd $ROOT_PATH +poetry run npx pyright botocore-stubs poetry run flake8 botocore-stubs poetry run black botocore-stubs poetry run isort botocore-stubs