Skip to content

Commit 61946d9

Browse files
authored
Various updates (#158)
* - Update to later version of the protobuf tool chain - Update protobuf generation to produce .pyi files (this resolves some of the missing dependency errors seen in the IDE) - Re-generate the stubs from the latest protobuf files (exposes new features from the proxy) - Fix issues found by latest mypy refresh
1 parent 34ef3fc commit 61946d9

File tree

11 files changed

+608
-82
lines changed

11 files changed

+608
-82
lines changed

.pre-commit-config.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,17 @@ repos:
1616
- id: check-added-large-files
1717

1818
- repo: https://github.com/PyCQA/flake8
19-
rev: 7.0.0
19+
rev: 7.1.1
2020
hooks:
2121
- id: flake8
2222

2323
- repo: https://github.com/psf/black
24-
rev: 24.4.2
24+
rev: 24.8.0
2525
hooks:
2626
- id: black
2727

2828
- repo: https://github.com/pre-commit/mirrors-mypy
29-
rev: v1.10.0
29+
rev: v1.11.2
3030
hooks:
3131
- id: mypy
3232

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ generate-proto: ## Generate Proto Files
112112
mkdir -p $(PROTO_DIR) || true
113113
curl -o $(PROTO_DIR)/services.proto https://raw.githubusercontent.com/oracle/coherence/$(COHERENCE_VERSION)/prj/coherence-grpc/src/main/proto/services.proto
114114
curl -o $(PROTO_DIR)/messages.proto https://raw.githubusercontent.com/oracle/coherence/$(COHERENCE_VERSION)/prj/coherence-grpc/src/main/proto/messages.proto
115-
python -m grpc_tools.protoc --proto_path=$(CURRDIR)/etc/proto --python_out=$(CURRDIR)/src/coherence --grpc_python_out=$(CURRDIR)/src/coherence $(CURRDIR)/etc/proto/messages.proto $(CURRDIR)/etc/proto/services.proto
115+
python -m grpc_tools.protoc --proto_path=$(CURRDIR)/etc/proto --pyi_out=$(CURRDIR)/src/coherence --python_out=$(CURRDIR)/src/coherence --grpc_python_out=$(CURRDIR)/src/coherence $(CURRDIR)/etc/proto/messages.proto $(CURRDIR)/etc/proto/services.proto
116116
sed -e 's/import messages_pb2 as messages__pb2/import coherence.messages_pb2 as messages__pb2/' \
117117
< $(CURRDIR)/src/coherence/services_pb2_grpc.py > $(CURRDIR)/src/coherence/services_pb2_grpc.py.out
118118
mv $(CURRDIR)/src/coherence/services_pb2_grpc.py.out $(CURRDIR)/src/coherence/services_pb2_grpc.py

pyproject.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ classifiers = [
2222

2323
[tool.poetry.dependencies]
2424
python = "^3.8"
25-
protobuf = ">=4.23,<4.26"
26-
grpcio = ">=1.54,<1.67"
27-
grpcio-tools = ">=1.54,<1.63"
25+
protobuf = "5.28.0"
26+
grpcio = "1.66.1"
27+
grpcio-tools = "1.66.1"
2828
jsonpickle = ">=3.0,<3.4"
2929
pymitter = ">=0.4,<0.6"
3030
typing-extensions = ">=4.11,<4.13"

src/coherence/client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
from .event import MapLifecycleEvent, MapListener, SessionLifecycleEvent
3939
from .extractor import ValueExtractor
4040
from .filter import Filter
41-
from .messages_pb2 import PageRequest # type: ignore
41+
from .messages_pb2 import PageRequest
4242
from .processor import EntryProcessor
4343
from .serialization import Serializer, SerializerRegistry
4444
from .services_pb2_grpc import NamedCacheServiceStub

src/coherence/event.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
import coherence.client
1818

1919
from .filter import Filter, Filters, MapEventFilter
20-
from .messages_pb2 import MapEventResponse, MapListenerRequest, MapListenerResponse # type: ignore
20+
from .messages_pb2 import MapEventResponse, MapListenerRequest, MapListenerResponse
2121
from .serialization import Serializer
2222
from .services_pb2_grpc import NamedCacheServiceStub
2323
from .util import RequestFactory
@@ -104,9 +104,9 @@ def __init__(
104104
self._name: str = source.name
105105
self._source: coherence.client.NamedMap[K, V] = source
106106
self._serializer: Serializer = serializer
107-
self._key_bytes: bytearray = response.key
108-
self._new_value_bytes: bytearray = response.newValue
109-
self._old_value_bytes: bytearray = response.oldValue
107+
self._key_bytes: bytes = response.key
108+
self._new_value_bytes: bytes = response.newValue
109+
self._old_value_bytes: bytes = response.oldValue
110110

111111
@property
112112
def source(self) -> coherence.client.NamedMap[K, V]:

src/coherence/messages_pb2.py

Lines changed: 69 additions & 67 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)