Skip to content
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
2 changes: 2 additions & 0 deletions .github/workflows/ci-pydgraph-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 4 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion pydgraph/meta.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@

"""Metadata about this package."""

VERSION = "24.2.1"
VERSION = "24.3.0"
12 changes: 1 addition & 11 deletions pydgraph/proto/api_pb2.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 7 additions & 2 deletions pydgraph/proto/api_pb2_grpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
)


Expand Down
11 changes: 10 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand All @@ -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"
20 changes: 20 additions & 0 deletions scripts/local-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
Loading