diff --git a/.github/workflows/ci-pydgraph-tests.yml b/.github/workflows/ci-pydgraph-tests.yml index 11a6435..b22c174 100644 --- a/.github/workflows/ci-pydgraph-tests.yml +++ b/.github/workflows/ci-pydgraph-tests.yml @@ -55,6 +55,8 @@ jobs: python -m pip install --upgrade pip python -m pip install .[dev] - name: Verify that updated protobufs are checked in + if: matrix.python-version != '3.13' + # Python 3.13 uses grpcio-tools >= 1.66.2, which generates backwards incompatible source files run: | cd pydgraph python scripts/protogen.py diff --git a/CHANGELOG.md b/CHANGELOG.md index ee7f7be..eaad110 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,11 +5,13 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). -## [v24.2.1] 2025-04-02 +## [v24.3.0] 2025-07-23 -**_Chore_** +**Chore** - Updated generated modules following a grpc deps update +- Bump down dev dependency `grpcio-tools` to <1.66.0 to allow `grpcio` compatibility with <1.66.0 + (broken in v24.0.2) (#270). ## [v24.2.0] - 2025-04-01 diff --git a/README.md b/README.md index d9b3d93..d05168c 100644 --- a/README.md +++ b/README.md @@ -60,6 +60,7 @@ version of this client. | :------------: | :--------------: | | 21.03.x | _21.03.x_ | | 23.0.x+ | _23.0.x_ | +| 24.0.x+ | _24.0.x_ | ## Quickstart @@ -606,6 +607,10 @@ source files generated by Protocol Buffer tools. To do that, install the python scripts/protogen.py ``` +**NOTE:** `grpcio-tools` >= 1.66.0 will generate backwards-incompatible source files. To maintain +compatibility with older versions of `grpcio`, you should only commit regenerated source files from +Python <3.13 (which is compatible with `grpcio-tools` < 1.66.0). + ### Running tests To run the tests in your local machine, run: diff --git a/pydgraph/meta.py b/pydgraph/meta.py index 812302c..5336ef2 100644 --- a/pydgraph/meta.py +++ b/pydgraph/meta.py @@ -3,4 +3,4 @@ """Metadata about this package.""" -VERSION = "24.2.1" +VERSION = "24.3.0" diff --git a/pydgraph/proto/api_pb2.py b/pydgraph/proto/api_pb2.py index d891f39..413f23b 100644 --- a/pydgraph/proto/api_pb2.py +++ b/pydgraph/proto/api_pb2.py @@ -1,22 +1,12 @@ # -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! -# NO CHECKED-IN PROTOBUF GENCODE # source: api.proto -# Protobuf Python Version: 5.29.0 +# Protobuf Python Version: 5.26.1 """Generated protocol buffer code.""" from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import runtime_version as _runtime_version from google.protobuf import symbol_database as _symbol_database from google.protobuf.internal import builder as _builder -_runtime_version.ValidateProtobufRuntimeVersion( - _runtime_version.Domain.PUBLIC, - 5, - 29, - 0, - '', - 'api.proto' -) # @@protoc_insertion_point(imports) _sym_db = _symbol_database.Default() diff --git a/pydgraph/proto/api_pb2_grpc.py b/pydgraph/proto/api_pb2_grpc.py index 24dec7b..4b689dd 100644 --- a/pydgraph/proto/api_pb2_grpc.py +++ b/pydgraph/proto/api_pb2_grpc.py @@ -5,8 +5,10 @@ import api_pb2 as api__pb2 -GRPC_GENERATED_VERSION = '1.71.0' +GRPC_GENERATED_VERSION = '1.65.5' GRPC_VERSION = grpc.__version__ +EXPECTED_ERROR_RELEASE = '1.66.0' +SCHEDULED_RELEASE_DATE = 'August 6, 2024' _version_not_supported = False try: @@ -16,12 +18,15 @@ _version_not_supported = True if _version_not_supported: - raise RuntimeError( + warnings.warn( f'The grpc package installed is at version {GRPC_VERSION},' + f' but the generated code in api_pb2_grpc.py depends on' + f' grpcio>={GRPC_GENERATED_VERSION}.' + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.' + + f' This warning will become an error in {EXPECTED_ERROR_RELEASE},' + + f' scheduled for release on {SCHEDULED_RELEASE_DATE}.', + RuntimeWarning ) diff --git a/pyproject.toml b/pyproject.toml index 3052276..8b93a85 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -21,6 +21,7 @@ classifiers = [ 'Programming Language :: Python :: 3.10', 'Programming Language :: Python :: 3.11', 'Programming Language :: Python :: 3.12', + 'Programming Language :: Python :: 3.13', ] dependencies = ["grpcio>=1.56.0,<2.0.0", "protobuf>=4.23.0,<7.0.0"] dynamic = ["version"] @@ -29,7 +30,15 @@ dynamic = ["version"] version = { attr = "pydgraph.meta.VERSION" } [project.optional-dependencies] -dev = ["build>=1.2.2.post1", "grpcio-tools>=1.68.0", "pytest>=8.3.3"] +dev = [ + "build>=1.2.2.post1", + # grpcio-tools >= 1.66.0 breaks compatibility with grpcio <1.66.0 + # but does not currently change the generated gRPC output for pydgraph + "grpcio-tools>=1.65.0,<1.66.0; python_version<'3.13'", + # Python 3.13 requires grpcio-tools >=1.66.2 + "grpcio-tools>=1.66.2; python_version>='3.13'", + "pytest>=8.3.3", +] [project.urls] "Homepage" = "https://github.com/hypermodeinc/pydgraph" diff --git a/scripts/local-test.sh b/scripts/local-test.sh index c683070..7b647c3 100755 --- a/scripts/local-test.sh +++ b/scripts/local-test.sh @@ -33,6 +33,24 @@ function stopCluster() { DockerCompose down -t 5 } +function displayDgraphVersion() { + python3 -c " +import sys +sys.path.insert(0, '.') +from pydgraph.client_stub import DgraphClientStub +from pydgraph.client import DgraphClient + +try: + client_stub = DgraphClientStub('${TEST_SERVER_ADDR}') + client = DgraphClient(client_stub) + version = client.check_version() + print(f'Dgraph server version: {version}') + client.close() +except Exception as e: + print(f'Failed to get Dgraph version: {e}') +" +} + readonly SRCDIR=$(readlink -f "${BASH_SOURCE[0]%/*}") # Run cluster and tests @@ -43,6 +61,8 @@ alphaGrpcPort=$(DockerCompose port alpha1 9080 | awk -F: '{print $2}') popd || exit export TEST_SERVER_ADDR="localhost:${alphaGrpcPort}" echo "Using TEST_SERVER_ADDR=${TEST_SERVER_ADDR}" +displayDgraphVersion + if [[ $# -eq 0 ]]; then # No arguments provided, run all tests pytest