From 8dc506ead74c4afd6bfe258cc110bdda427c1989 Mon Sep 17 00:00:00 2001 From: Joshua Goldstein Date: Mon, 29 May 2023 22:53:11 +0300 Subject: [PATCH 1/7] fix protobuf import issue --- pydgraph/proto/__init__.py | 3 +++ pydgraph/proto/api_pb2_grpc.py | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/pydgraph/proto/__init__.py b/pydgraph/proto/__init__.py index e69de29..4efbfe3 100644 --- a/pydgraph/proto/__init__.py +++ b/pydgraph/proto/__init__.py @@ -0,0 +1,3 @@ +import sys +from pathlib import Path +sys.path.append(str(Path(__file__).parent)) \ No newline at end of file diff --git a/pydgraph/proto/api_pb2_grpc.py b/pydgraph/proto/api_pb2_grpc.py index 0d3c871..ed4c71d 100644 --- a/pydgraph/proto/api_pb2_grpc.py +++ b/pydgraph/proto/api_pb2_grpc.py @@ -2,7 +2,7 @@ """Client and server classes corresponding to protobuf-defined services.""" import grpc -from . import api_pb2 as api__pb2 +import api_pb2 as api__pb2 class DgraphStub(object): From 80278d9cf2c00a9d224d5ee9065ab1acf345923d Mon Sep 17 00:00:00 2001 From: Joshua Goldstein Date: Mon, 29 May 2023 23:42:37 +0300 Subject: [PATCH 2/7] check diff code after generating protobufs --- .github/workflows/cd-pydgraph.yml | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/.github/workflows/cd-pydgraph.yml b/.github/workflows/cd-pydgraph.yml index 9816287..a083d98 100644 --- a/.github/workflows/cd-pydgraph.yml +++ b/.github/workflows/cd-pydgraph.yml @@ -32,14 +32,7 @@ jobs: run: | # we modify one line in proto/api_pb2_grpc.py as described in readme python scripts/protogen.py - ACTUAL_DIFF=$(git diff --shortstat) - EXPECTED_DIFF=" 1 file changed, 1 insertion(+), 1 deletion(-)" - if [[ "$ACTUAL_DIFF" == "$EXPECTED_DIFF" ]]; then - echo "found expected difference" - else - echo "unexpected difference when regenerating protobufs, verify they are checked in" - exit 1 - fi + git diff --exit-code -- . - name: Build pydgraph run: | rm -rf dist From 2917530a4a5b6d45de9ea7d8f468da118ea836ee Mon Sep 17 00:00:00 2001 From: Joshua Goldstein Date: Mon, 29 May 2023 23:44:09 +0300 Subject: [PATCH 3/7] update to v23.0.1 --- pydgraph/meta.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pydgraph/meta.py b/pydgraph/meta.py index 6411fdb..6487800 100644 --- a/pydgraph/meta.py +++ b/pydgraph/meta.py @@ -14,4 +14,4 @@ """Metadata about this package.""" -VERSION = '23.0.0' +VERSION = '23.0.1' From 6b38f8e0f0246607f766ba6b912b47637a4e8e0e Mon Sep 17 00:00:00 2001 From: Joshua Goldstein Date: Mon, 29 May 2023 23:55:21 +0300 Subject: [PATCH 4/7] update docs --- CHANGELOG.md | 6 ++++++ README.md | 8 -------- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f8a8dde..7e49def 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ 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). +## [v23.0.1] - 2023-05-29 + +### Added + +- chore(cd): fix protobuf import issue (#204) + ## [v23.0.0] - 2023-05-15 ### Breaking diff --git a/README.md b/README.md index 83c13ef..84983f6 100644 --- a/README.md +++ b/README.md @@ -523,14 +523,6 @@ command: python scripts/protogen.py ``` -The generated file `api_pb2_grpc.py` needs to be changed in recent versions of python. -The required change is outlined below as a diff. - -```diff --import api_pb2 as api__pb2 -+from . import api_pb2 as api__pb2 -``` - ### Running tests To run the tests in your local machine, run: From f0b1c7161de363d585799ffcae3763489586633d Mon Sep 17 00:00:00 2001 From: Joshua Goldstein Date: Mon, 29 May 2023 23:56:24 +0300 Subject: [PATCH 5/7] space --- pydgraph/proto/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pydgraph/proto/__init__.py b/pydgraph/proto/__init__.py index 4efbfe3..3dc3922 100644 --- a/pydgraph/proto/__init__.py +++ b/pydgraph/proto/__init__.py @@ -1,3 +1,3 @@ import sys from pathlib import Path -sys.path.append(str(Path(__file__).parent)) \ No newline at end of file +sys.path.append(str(Path(__file__).parent)) From 640b0ae6e7dd31aa6d5450ebfde15bd4219da3c9 Mon Sep 17 00:00:00 2001 From: Joshua Goldstein Date: Mon, 29 May 2023 23:58:43 +0300 Subject: [PATCH 6/7] remove comment --- .github/workflows/cd-pydgraph.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/cd-pydgraph.yml b/.github/workflows/cd-pydgraph.yml index a083d98..d4d4fac 100644 --- a/.github/workflows/cd-pydgraph.yml +++ b/.github/workflows/cd-pydgraph.yml @@ -30,7 +30,6 @@ jobs: python -m pip install twine - name: Verify that protobufs are checked in run: | - # we modify one line in proto/api_pb2_grpc.py as described in readme python scripts/protogen.py git diff --exit-code -- . - name: Build pydgraph From 0cbf160b3d60aaa7c47b2dd4db38892706e03213 Mon Sep 17 00:00:00 2001 From: Joshua Goldstein <92491720+joshua-goldstein@users.noreply.github.com> Date: Tue, 30 May 2023 12:54:51 +0300 Subject: [PATCH 7/7] Update meta.py to v23.0.1rc1 --- pydgraph/meta.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pydgraph/meta.py b/pydgraph/meta.py index 6487800..a7420fc 100644 --- a/pydgraph/meta.py +++ b/pydgraph/meta.py @@ -14,4 +14,4 @@ """Metadata about this package.""" -VERSION = '23.0.1' +VERSION = '23.0.1rc1'