Skip to content

Commit 2e7d958

Browse files
maksim-grebeniuk-sonarsourcethomas-serre-sonarsource
authored andcommitted
SONARPY-3212 Create custom stubs for boto3.client (#412)
Co-authored-by: Thomas Serre <[email protected]> GitOrigin-RevId: fb83bdf542484b67e9ce1ef23834797cebc83e9b
1 parent 118b8b4 commit 2e7d958

File tree

18 files changed

+151
-14
lines changed

18 files changed

+151
-14
lines changed

python-frontend/src/main/resources/org/sonar/python/types/custom_protobuf/boto3.protobuf

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
2+
boto3x
3+
client boto3.client"8
4+
botocore.client.BaseClient"botocore.client.BaseClient*
5+
args
6+
Any*
7+
kwargs
8+
Any*f
9+
__path__boto3.__path__J
10+
builtins.list[builtins.str]
11+
builtins.str" builtins.str"builtins.list*�
12+
__annotations__boto3.__annotations__W
13+
builtins.dict[builtins.str,Any]
14+
builtins.str" builtins.str
15+
Any"builtins.dict

python-frontend/src/main/resources/org/sonar/python/types/custom_protobuf/botocore.client.protobuf

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
2+
botocore.client�
3+
4+
BaseClientbotocore.client.BaseClient"*SonarPythonAnalyzerFakeStub.CustomStubBase*�
5+
invoke!botocore.client.BaseClient.invoke"
6+
Any*B
7+
self8
8+
botocore.client.BaseClient"botocore.client.BaseClient*.
9+
FunctionName
10+
builtins.str" builtins.str*0
11+
InvocationType
12+
builtins.str" builtins.str*)
13+
Payload
14+
builtins.str" builtins.str*�
15+
__annotations__botocore.client.__annotations__W
16+
builtins.dict[builtins.str,Any]
17+
builtins.str" builtins.str
18+
Any"builtins.dict

python-frontend/src/main/resources/org/sonar/python/types/custom_protobuf/botocore.protobuf

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
2+
botocore*i
3+
__path__botocore.__path__J
4+
builtins.list[builtins.str]
5+
builtins.str" builtins.str"builtins.list*�
6+
__annotations__botocore.__annotations__W
7+
builtins.dict[builtins.str,Any]
8+
builtins.str" builtins.str
9+
Any"builtins.dict
565 Bytes
Binary file not shown.

python-frontend/src/main/resources/org/sonar/python/types/third_party_protobuf_mypy/importlib_metadata._typing.protobuf

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
2+
importlib_metadata._typing*�
3+
__annotations__*importlib_metadata._typing.__annotations__W
4+
builtins.dict[builtins.str,Any]
5+
builtins.str" builtins.str
6+
Any"builtins.dict*�
7+
md_none"importlib_metadata._typing.md_noneu
8+
functools.partial[typing._T]B
9+
typing._T"
10+
builtins.object"builtins.object"builtins.object"functools.partial
3.84 KB
Binary file not shown.

python-frontend/typeshed_serializer/build-with-docker.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@
22

33
export USER_ID="$(id -u)"
44
export GROUP_ID="$(id -g)"
5-
docker compose -f ./docker/docker-compose.yml --project-directory ./docker up
5+
docker compose -f ./docker/docker-compose.yml --project-directory ./docker down
6+
docker compose -f ./docker/docker-compose.yml --project-directory ./docker up
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
77a91b4649947b77b314140e6c29c78f69cbe4303e4e007ac97938a7d4bbef31
2-
4a3074a882ea1c3b01720906430df1bf100c2edf10ba8b5fbc750e7961a404ea
1+
89637a19e32c219552eca326cce354337caa0b2033e092712dbb81fffbb5ad4b
2+
23cc6fb7a4cce09f3b84d2fbd0cdc0f2eb5b910f035bda950d5f840e80335468

python-frontend/typeshed_serializer/docker/Dockerfile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
FROM python:3.9
22

3+
RUN apt-get update && \
4+
apt-get install -y protobuf-compiler && \
5+
rm -rf /var/lib/apt/lists/*
6+
7+
# Verify that protoc is installed and accessible on the PATH
8+
# This command will print the version of protoc, confirming its installation
9+
RUN protoc --version
10+
311
# Install tox
412
RUN pip install --no-cache-dir tox
513

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
#!/bin/sh
22

3+
mkdir -p /sonar-python/python-frontend/typeshed_serializer/serializer/proto_out
4+
cd /sonar-python/python-frontend/src/main/protobuf
5+
6+
# SONARPY-3216 - to investigate how to deal with it properly
7+
protoc -I=. --python_out=../../../typeshed_serializer/serializer/proto_out ./symbols.proto
8+
39
cd /sonar-python/python-frontend/typeshed_serializer
410
# Recreate the env to make sure that latest dependencies will be downloaded
511
python -m tox --recreate --notest
6-
python runners/tox_runner.py --skip_tests=true
12+
python runners/tox_runner.py --skip_tests=false

0 commit comments

Comments
 (0)