Skip to content
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

chore(cd): fix protobuf import issue #204

Merged
merged 7 commits into from
May 30, 2023
Merged
Show file tree
Hide file tree
Changes from 6 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
10 changes: 1 addition & 9 deletions .github/workflows/cd-pydgraph.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,8 @@ 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
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
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 0 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion pydgraph/meta.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@

"""Metadata about this package."""

VERSION = '23.0.0'
VERSION = '23.0.1'
3 changes: 3 additions & 0 deletions pydgraph/proto/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import sys
from pathlib import Path
sys.path.append(str(Path(__file__).parent))
2 changes: 1 addition & 1 deletion pydgraph/proto/api_pb2_grpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down