Commit d5b09cd9 authored by Carlos Natalino's avatar Carlos Natalino
Browse files

Initial migration of the context component to Python 3.13.

parent ee95258b
Loading
Loading
Loading
Loading
+12 −12
Original line number Diff line number Diff line
@@ -12,16 +12,16 @@
# See the License for the specific language governing permissions and
# limitations under the License.

coverage==6.3
grpcio==1.47.*
grpcio-health-checking==1.47.*
grpcio-reflection==1.47.*
grpcio-tools==1.47.*
grpclib==0.4.4
prettytable==3.5.0
prometheus-client==0.13.0
protobuf==3.20.*
pytest==6.2.5
pytest-benchmark==3.4.1
python-dateutil==2.8.2
coverage==7.9.*
grpcio==1.73.*
grpcio-health-checking==1.73.*
grpcio-reflection==1.73.*
grpcio-tools==1.73.*
grpclib==0.4.8
prettytable==3.16.0
prometheus-client==0.22.*
protobuf==6.32.*
pytest==8.4.1
pytest-benchmark==5.1.0
python-dateutil==2.9.0
pytest-depends==1.0.1
+16 −3
Original line number Diff line number Diff line
@@ -13,15 +13,28 @@
# limitations under the License.

import json
import warnings
from google import protobuf
from google.protobuf.json_format import MessageToDict

def grpc_message_to_json(
        message, including_default_value_fields=True, preserving_proto_field_name=True, use_integers_for_enums=False
    ):
    if not hasattr(message, 'DESCRIPTOR'): return json.dumps(str(message), sort_keys=True) # not a gRPC message
    if including_default_value_fields is not True:
        warnings.warn(
            "The 'including_default_value_fields' argument is deprecated and will have no effect in future versions.",
            DeprecationWarning,
            stacklevel=2
        )
    if protobuf.__version__ < '4.0.0':
        return MessageToDict(
                message, including_default_value_fields=including_default_value_fields,
                preserving_proto_field_name=preserving_proto_field_name, use_integers_for_enums=use_integers_for_enums)
    else:
        return MessageToDict(
            message,
            preserving_proto_field_name=preserving_proto_field_name, use_integers_for_enums=use_integers_for_enums)

def grpc_message_list_to_json(message_list):
    if message_list is None: return None
+2 −2
Original line number Diff line number Diff line
@@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

FROM python:3.9-slim
FROM python:3.13-slim

# Install dependencies
RUN apt-get --yes --quiet --quiet update && \
@@ -23,7 +23,7 @@ RUN apt-get --yes --quiet --quiet update && \
ENV PYTHONUNBUFFERED=0

# Download the gRPC health probe
RUN GRPC_HEALTH_PROBE_VERSION=v0.2.0 && \
RUN GRPC_HEALTH_PROBE_VERSION=v0.4.40 && \
    wget -qO/bin/grpc_health_probe https://github.com/grpc-ecosystem/grpc-health-probe/releases/download/${GRPC_HEALTH_PROBE_VERSION}/grpc_health_probe-linux-amd64 && \
    chmod +x /bin/grpc_health_probe

+4 −4
Original line number Diff line number Diff line
@@ -12,8 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.

nats-py==2.6.*
nats-py==2.10.*
psycopg2-binary==2.9.*
SQLAlchemy==1.4.*
sqlalchemy-cockroachdb==1.4.*
SQLAlchemy-Utils==0.38.*
SQLAlchemy==1.4.*  # TODO: Update to 2.0 due to deprecated build step
sqlalchemy-cockroachdb==1.4.*  # TODO: Update to 2.0 due to deprecated build step
SQLAlchemy-Utils==0.41.*