Skip to content

Commit

Permalink
Type-ignored AwsCredentials
Browse files Browse the repository at this point in the history
  • Loading branch information
vemel committed Jul 30, 2022
1 parent 66067ab commit abc927b
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 149 deletions.
20 changes: 15 additions & 5 deletions botocore-stubs/crt/auth.pyi
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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: ...

Expand All @@ -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: ...

Expand All @@ -37,7 +47,7 @@ class CrtSigV4AsymQueryAuth(CrtSigV4AsymAuth):

def __init__(
self,
credentials: AwsCredentials,
credentials: AwsCredentials, # type: ignore
service_name: str,
region_name: str,
expires: int = ...,
Expand All @@ -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 = ...,
Expand Down
1 change: 0 additions & 1 deletion botocore-stubs/py.typed
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@
partial
145 changes: 2 additions & 143 deletions istub.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,146 +8,5 @@ packages:
stubtest: true
snapshots:
stubtest: |-
error: botocore.docs failed to find stubs
Stub:
MISSING
Runtime:
<module 'botocore.docs' from './botocore/docs/__init__.py'>
error: botocore.docs.bcdoc failed to find stubs
Stub:
MISSING
Runtime:
<module 'botocore.docs.bcdoc' from './botocore/docs/bcdoc/__init__.py'>
error: botocore.docs.bcdoc.docstringparser failed to find stubs
Stub:
MISSING
Runtime:
<module 'botocore.docs.bcdoc.docstringparser' from './botocore/docs/bcdoc/docstringparser.py'>
error: botocore.docs.bcdoc.restdoc failed to find stubs
Stub:
MISSING
Runtime:
<module 'botocore.docs.bcdoc.restdoc' from './botocore/docs/bcdoc/restdoc.py'>
error: botocore.docs.bcdoc.style failed to find stubs
Stub:
MISSING
Runtime:
<module 'botocore.docs.bcdoc.style' from './botocore/docs/bcdoc/style.py'>
error: botocore.docs.client failed to find stubs
Stub:
MISSING
Runtime:
<module 'botocore.docs.client' from './botocore/docs/client.py'>
error: botocore.docs.docstring failed to find stubs
Stub:
MISSING
Runtime:
<module 'botocore.docs.docstring' from './botocore/docs/docstring.py'>
error: botocore.docs.example failed to find stubs
Stub:
MISSING
Runtime:
<module 'botocore.docs.example' from './botocore/docs/example.py'>
error: botocore.docs.method failed to find stubs
Stub:
MISSING
Runtime:
<module 'botocore.docs.method' from './botocore/docs/method.py'>
error: botocore.docs.paginator failed to find stubs
Stub:
MISSING
Runtime:
<module 'botocore.docs.paginator' from './botocore/docs/paginator.py'>
error: botocore.docs.params failed to find stubs
Stub:
MISSING
Runtime:
<module 'botocore.docs.params' from './botocore/docs/params.py'>
error: botocore.docs.service failed to find stubs
Stub:
MISSING
Runtime:
<module 'botocore.docs.service' from './botocore/docs/service.py'>
error: botocore.docs.shape failed to find stubs
Stub:
MISSING
Runtime:
<module 'botocore.docs.shape' from './botocore/docs/shape.py'>
error: botocore.docs.sharedexample failed to find stubs
Stub:
MISSING
Runtime:
<module 'botocore.docs.sharedexample' from './botocore/docs/sharedexample.py'>
error: botocore.docs.utils failed to find stubs
Stub:
MISSING
Runtime:
<module 'botocore.docs.utils' from './botocore/docs/utils.py'>
error: botocore.docs.waiter failed to find stubs
Stub:
MISSING
Runtime:
<module 'botocore.docs.waiter' from './botocore/docs/waiter.py'>
error: botocore.httpchecksum failed to find stubs
Stub:
MISSING
Runtime:
<module 'botocore.httpchecksum' from './botocore/httpchecksum.py'>
error: botocore.vendored failed to find stubs
Stub:
MISSING
Runtime:
<module 'botocore.vendored' from './botocore/vendored/__init__.py'>
error: botocore.vendored.requests failed to find stubs
Stub:
MISSING
Runtime:
<module 'botocore.vendored.requests' from './botocore/vendored/requests/__init__.py'>
error: botocore.vendored.requests.exceptions failed to find stubs
Stub:
MISSING
Runtime:
<module 'botocore.vendored.requests.exceptions' from './botocore/vendored/requests/exceptions.py'>
error: botocore.vendored.requests.packages failed to find stubs
Stub:
MISSING
Runtime:
<module 'botocore.vendored.requests.packages' from './botocore/vendored/requests/packages/__init__.py'>
error: botocore.vendored.requests.packages.urllib3 failed to find stubs
Stub:
MISSING
Runtime:
<module 'botocore.vendored.requests.packages.urllib3' from './botocore/vendored/requests/packages/urllib3/__init__.py'>
error: botocore.vendored.requests.packages.urllib3.exceptions failed to find stubs
Stub:
MISSING
Runtime:
<module 'botocore.vendored.requests.packages.urllib3.exceptions' from './botocore/vendored/requests/packages/urllib3/exceptions.py'>
error: botocore.vendored.six failed to find stubs
Stub:
MISSING
Runtime:
<module 'botocore.vendored.six' from './botocore/vendored/six.py'>
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
1 change: 1 addition & 0 deletions scripts/before_commit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit abc927b

Please sign in to comment.