Skip to content

update testenv with protobuf runtime v5.26 #563

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

Closed
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
6 changes: 4 additions & 2 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,16 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: [3.8]
environment: [py, py-tls, py-proto3, py-tls-proto3]
python-version: [3.9]
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

first version of yandexcloudsdk that supports protobuf runtime 5+ is 0.329.0 which also requires python 3.9

temporary bump python version in test matrix to see test results

environment: [py, py-tls, py-proto3, py-tls-proto3, py-proto5, py-tls-proto5]
folder: [ydb, tests]
exclude:
- environment: py-tls
folder: ydb
- environment: py-tls-proto3
folder: ydb
- environment: py-tls-proto5
folder: ydb

steps:
- uses: actions/checkout@v1
Expand Down
10 changes: 8 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
protobuf: protobuf-3 protobuf-4

protobuf: protobuf-3 protobuf-4 protobuf-5
protobuf-3:
docker build -f generate-protobuf.Dockerfile . -t ydb-python-sdk-proto-generator-env-3 --build-arg GRPCIO_VER=1.39.0 --build-arg PY_PROTOBUF_VER=3.20.3
docker run --rm -it -v $${PWD}:$${PWD} -w $${PWD} ydb-python-sdk-proto-generator-env-3 python generate_protoc.py --target-version=v3

protobuf-4:
docker build -f generate-protobuf.Dockerfile . -t ydb-python-sdk-proto-generator-env-4
docker run --rm -it -v $${PWD}:$${PWD} -w $${PWD} ydb-python-sdk-proto-generator-env-4 python generate_protoc.py

protobuf-5:
# yandexcloud 0.329.0 depends on grpcio<2 and >=1.64.0
# --build-arg GRPCIO_VER=1.64.0
docker build -f generate-protobuf.Dockerfile . -t ydb-python-sdk-proto-generator-env-5 --build-arg PY_PROTOBUF_VER=5.26.1 --build-arg PROTOC_VER=26.1
docker run --rm -it -v $${PWD}:$${PWD} -w $${PWD} ydb-python-sdk-proto-generator-env-5 python generate_protoc.py --target-version=v5

2 changes: 1 addition & 1 deletion generate-protobuf.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ RUN \
python -m pip install grpcio-tools==${GRPCIO_VER} && \
python -m pip install protobuf==${PY_PROTOBUF_VER}

ENV PROTOC_VER=21.8
ARG PROTOC_VER=21.8
RUN wget https://github.com/protocolbuffers/protobuf/releases/download/v${PROTOC_VER}/protoc-${PROTOC_VER}-linux-x86_64.zip && \
unzip protoc-*.zip && \
rm -f protoc-*.zip && \
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
grpcio>=1.42.0
packaging
protobuf>=3.13.0,<5.0.0
protobuf>=3.13.0,<6.0.0
aiohttp<4
51 changes: 51 additions & 0 deletions test-requirements-proto5.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
attrs==21.2.0
bcrypt==3.2.0
black==22.12.0
cached-property==1.5.2
certifi==2024.7.4
cffi==1.14.6
charset-normalizer==2.0.1
cryptography==41.0.7
distro==1.5.0
docker==5.0.0
docker-compose==1.29.2
dockerpty==0.4.1
docopt==0.6.2
grpcio==1.68.1
idna==3.2
importlib-metadata==4.6.1
iniconfig==1.1.1
jsonschema==3.2.0
packaging==21.0
paramiko==2.10.1
pluggy==0.13.1
protobuf>=5.0.0
py==1.10.0
pycparser==2.20
PyNaCl==1.4.0
pyparsing==2.4.7
pyrsistent==0.18.0
pytest==7.2.2
pytest-asyncio==0.21.0
pytest-docker-compose==3.2.1
python-dotenv==0.18.0
PyYAML==5.3.1
pyjwt==2.8.0
requests==2.32.3
texttable==1.6.4
toml==0.10.2
typing-extensions==4.12.2
urllib3==1.26.6
websocket-client==0.59.0
zipp==3.19.1
aiohttp==3.7.4
pytest-pep8
pytest-flake8
flake8==3.9.2
sqlalchemy==1.4.26
pylint-protobuf
cython
freezegun==1.2.2
pytest-cov
yandexcloud==0.329.0
-e .
23 changes: 20 additions & 3 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tox]
envlist = py,py-proto3,py-tls,py-tls-proto3,style,pylint,black,protoc,py-cov
envlist = py,py-proto3,py-proto5,py-tls,py-tls-proto3,py-tls-proto5,style,pylint,black,protoc,py-cov
minversion = 4.2.6
skipsdist = True
ignore_basepython_conflict = true
Expand All @@ -21,6 +21,11 @@ deps =
-r{toxinidir}/test-requirements.txt
protobuf<4.0.0

[testenv:dev-proto5]
commands =
deps =
-r{toxinidir}/test-requirements-proto5.txt

[testenv:py]
commands =
pytest -v -m "not tls" --docker-compose-remove-volumes --docker-compose=docker-compose.yml {posargs}
Expand All @@ -38,6 +43,12 @@ deps =
-r{toxinidir}/test-requirements.txt
protobuf<4.0.0

[testenv:py-proto5]
commands =
pytest -v -m "not tls" --docker-compose-remove-volumes --docker-compose=docker-compose.yml {posargs}
deps =
-r{toxinidir}/test-requirements-proto5.txt

[testenv:py-tls]
commands =
pytest -v -m tls --docker-compose-remove-volumes --docker-compose=docker-compose-tls.yml {posargs}
Expand All @@ -49,15 +60,21 @@ deps =
-r{toxinidir}/test-requirements.txt
protobuf<4.0.0

[testenv:py-tls-proto5]
commands =
pytest -v -m tls --docker-compose-remove-volumes --docker-compose=docker-compose-tls.yml {posargs}
deps =
-r{toxinidir}/test-requirements-proto5.txt

[testenv:black-format]
skip_install = true
commands =
black ydb examples tests --extend-exclude "ydb/_grpc/v3|ydb/_grpc/v4"
black ydb examples tests --extend-exclude "ydb/_grpc/v3|ydb/_grpc/v4|ydb/_grpc/v5"

[testenv:black]
skip_install = true
commands =
black --diff --check ydb examples tests --extend-exclude "ydb/_grpc/v3|ydb/_grpc/v4"
black --diff --check ydb examples tests --extend-exclude "ydb/_grpc/v3|ydb/_grpc/v4|ydb/_grpc/v5"

[testenv:pylint]
deps = pylint
Expand Down
Loading