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

Setup CI #6

Merged
merged 9 commits into from
Jan 28, 2024
Merged
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
8 changes: 4 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@ permissions:
contents: read

jobs:
build:
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-versions: ["3.11", "3.12"]
python: ["3.11", "3.12"]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
python-version: ${{ matrix.python }}
cache: 'pip'
- run: make dev
- run: make test
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
*.pyc
__pycache__
.proto
2 changes: 0 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,9 @@ PYTHON := python
all: test

install:
export PIP_EXTRA_INDEX_URL=https://buf.build/gen/python
$(PYTHON) -m pip install -e .

dev:
export PIP_EXTRA_INDEX_URL=https://buf.build/gen/python
$(PYTHON) -m pip install -e .[dev]

fmt:
Expand Down
2 changes: 2 additions & 0 deletions buf.gen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@ managed:
plugins:
- plugin: buf.build/protocolbuffers/python:v25.2
out: src/
- plugin: buf.build/grpc/python:v1.60.0
out: src/
7 changes: 3 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,10 @@ build-backend = "setuptools.build_meta"
[project]
name = "dispatch-sdk"
dynamic = ["version"]
requires-python = ">= 3.12"
requires-python = ">= 3.11"
dependencies = [
"stealthrocket_ring_grpc_python==1.60.0.1.20240126005632+6a2bbfaf59e6",
"stealthrocket_ring_protocolbuffers_python==25.2.0.1.20240126005632+6a2bbfaf59e6",
"stealthrocket_dispatch_protocolbuffers_python==25.2.0.1.20240119005337+14bf27236bb7",
"grpcio==1.60.0",
"protobuf==4.25.2"
]

[project.optional-dependencies]
Expand Down
3 changes: 3 additions & 0 deletions src/dispatch/http/v1/http_pb2_grpc.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
"""Client and server classes corresponding to protobuf-defined services."""
import grpc
3 changes: 3 additions & 0 deletions src/dispatch/security/v1/security_pb2_grpc.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
"""Client and server classes corresponding to protobuf-defined services."""
import grpc
3 changes: 3 additions & 0 deletions src/dispatch/v1/metadata_pb2_grpc.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
"""Client and server classes corresponding to protobuf-defined services."""
import grpc
304 changes: 304 additions & 0 deletions src/ring/admin/v1/cluster_pb2_grpc.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,304 @@
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
"""Client and server classes corresponding to protobuf-defined services."""
import grpc

from ring.admin.v1 import cluster_pb2 as ring_dot_admin_dot_v1_dot_cluster__pb2


class ClusterServiceStub(object):
"""Missing associated documentation comment in .proto file."""

def __init__(self, channel):
"""Constructor.

Args:
channel: A grpc.Channel.
"""
self.DescribeInstances = channel.unary_unary(
"/ring.admin.v1.ClusterService/DescribeInstances",
request_serializer=ring_dot_admin_dot_v1_dot_cluster__pb2.DescribeInstancesRequest.SerializeToString,
response_deserializer=ring_dot_admin_dot_v1_dot_cluster__pb2.DescribeInstancesResponse.FromString,
)
self.DescribePartitions = channel.unary_unary(
"/ring.admin.v1.ClusterService/DescribePartitions",
request_serializer=ring_dot_admin_dot_v1_dot_cluster__pb2.DescribePartitionsRequest.SerializeToString,
response_deserializer=ring_dot_admin_dot_v1_dot_cluster__pb2.DescribePartitionsResponse.FromString,
)
self.DescribeZones = channel.unary_unary(
"/ring.admin.v1.ClusterService/DescribeZones",
request_serializer=ring_dot_admin_dot_v1_dot_cluster__pb2.DescribeZonesRequest.SerializeToString,
response_deserializer=ring_dot_admin_dot_v1_dot_cluster__pb2.DescribeZonesResponse.FromString,
)
self.ListInstances = channel.unary_unary(
"/ring.admin.v1.ClusterService/ListInstances",
request_serializer=ring_dot_admin_dot_v1_dot_cluster__pb2.ListInstancesRequest.SerializeToString,
response_deserializer=ring_dot_admin_dot_v1_dot_cluster__pb2.ListInstancesResponse.FromString,
)
self.ListPartitions = channel.unary_unary(
"/ring.admin.v1.ClusterService/ListPartitions",
request_serializer=ring_dot_admin_dot_v1_dot_cluster__pb2.ListPartitionsRequest.SerializeToString,
response_deserializer=ring_dot_admin_dot_v1_dot_cluster__pb2.ListPartitionsResponse.FromString,
)
self.ListZones = channel.unary_unary(
"/ring.admin.v1.ClusterService/ListZones",
request_serializer=ring_dot_admin_dot_v1_dot_cluster__pb2.ListZonesRequest.SerializeToString,
response_deserializer=ring_dot_admin_dot_v1_dot_cluster__pb2.ListZonesResponse.FromString,
)


class ClusterServiceServicer(object):
"""Missing associated documentation comment in .proto file."""

def DescribeInstances(self, request, context):
"""Missing associated documentation comment in .proto file."""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details("Method not implemented!")
raise NotImplementedError("Method not implemented!")

def DescribePartitions(self, request, context):
"""Missing associated documentation comment in .proto file."""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details("Method not implemented!")
raise NotImplementedError("Method not implemented!")

def DescribeZones(self, request, context):
"""Missing associated documentation comment in .proto file."""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details("Method not implemented!")
raise NotImplementedError("Method not implemented!")

def ListInstances(self, request, context):
"""Missing associated documentation comment in .proto file."""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details("Method not implemented!")
raise NotImplementedError("Method not implemented!")

def ListPartitions(self, request, context):
"""Missing associated documentation comment in .proto file."""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details("Method not implemented!")
raise NotImplementedError("Method not implemented!")

def ListZones(self, request, context):
"""Missing associated documentation comment in .proto file."""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details("Method not implemented!")
raise NotImplementedError("Method not implemented!")


def add_ClusterServiceServicer_to_server(servicer, server):
rpc_method_handlers = {
"DescribeInstances": grpc.unary_unary_rpc_method_handler(
servicer.DescribeInstances,
request_deserializer=ring_dot_admin_dot_v1_dot_cluster__pb2.DescribeInstancesRequest.FromString,
response_serializer=ring_dot_admin_dot_v1_dot_cluster__pb2.DescribeInstancesResponse.SerializeToString,
),
"DescribePartitions": grpc.unary_unary_rpc_method_handler(
servicer.DescribePartitions,
request_deserializer=ring_dot_admin_dot_v1_dot_cluster__pb2.DescribePartitionsRequest.FromString,
response_serializer=ring_dot_admin_dot_v1_dot_cluster__pb2.DescribePartitionsResponse.SerializeToString,
),
"DescribeZones": grpc.unary_unary_rpc_method_handler(
servicer.DescribeZones,
request_deserializer=ring_dot_admin_dot_v1_dot_cluster__pb2.DescribeZonesRequest.FromString,
response_serializer=ring_dot_admin_dot_v1_dot_cluster__pb2.DescribeZonesResponse.SerializeToString,
),
"ListInstances": grpc.unary_unary_rpc_method_handler(
servicer.ListInstances,
request_deserializer=ring_dot_admin_dot_v1_dot_cluster__pb2.ListInstancesRequest.FromString,
response_serializer=ring_dot_admin_dot_v1_dot_cluster__pb2.ListInstancesResponse.SerializeToString,
),
"ListPartitions": grpc.unary_unary_rpc_method_handler(
servicer.ListPartitions,
request_deserializer=ring_dot_admin_dot_v1_dot_cluster__pb2.ListPartitionsRequest.FromString,
response_serializer=ring_dot_admin_dot_v1_dot_cluster__pb2.ListPartitionsResponse.SerializeToString,
),
"ListZones": grpc.unary_unary_rpc_method_handler(
servicer.ListZones,
request_deserializer=ring_dot_admin_dot_v1_dot_cluster__pb2.ListZonesRequest.FromString,
response_serializer=ring_dot_admin_dot_v1_dot_cluster__pb2.ListZonesResponse.SerializeToString,
),
}
generic_handler = grpc.method_handlers_generic_handler(
"ring.admin.v1.ClusterService", rpc_method_handlers
)
server.add_generic_rpc_handlers((generic_handler,))


# This class is part of an EXPERIMENTAL API.
class ClusterService(object):
"""Missing associated documentation comment in .proto file."""

@staticmethod
def DescribeInstances(
request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None,
):
return grpc.experimental.unary_unary(
request,
target,
"/ring.admin.v1.ClusterService/DescribeInstances",
ring_dot_admin_dot_v1_dot_cluster__pb2.DescribeInstancesRequest.SerializeToString,
ring_dot_admin_dot_v1_dot_cluster__pb2.DescribeInstancesResponse.FromString,
options,
channel_credentials,
insecure,
call_credentials,
compression,
wait_for_ready,
timeout,
metadata,
)

@staticmethod
def DescribePartitions(
request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None,
):
return grpc.experimental.unary_unary(
request,
target,
"/ring.admin.v1.ClusterService/DescribePartitions",
ring_dot_admin_dot_v1_dot_cluster__pb2.DescribePartitionsRequest.SerializeToString,
ring_dot_admin_dot_v1_dot_cluster__pb2.DescribePartitionsResponse.FromString,
options,
channel_credentials,
insecure,
call_credentials,
compression,
wait_for_ready,
timeout,
metadata,
)

@staticmethod
def DescribeZones(
request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None,
):
return grpc.experimental.unary_unary(
request,
target,
"/ring.admin.v1.ClusterService/DescribeZones",
ring_dot_admin_dot_v1_dot_cluster__pb2.DescribeZonesRequest.SerializeToString,
ring_dot_admin_dot_v1_dot_cluster__pb2.DescribeZonesResponse.FromString,
options,
channel_credentials,
insecure,
call_credentials,
compression,
wait_for_ready,
timeout,
metadata,
)

@staticmethod
def ListInstances(
request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None,
):
return grpc.experimental.unary_unary(
request,
target,
"/ring.admin.v1.ClusterService/ListInstances",
ring_dot_admin_dot_v1_dot_cluster__pb2.ListInstancesRequest.SerializeToString,
ring_dot_admin_dot_v1_dot_cluster__pb2.ListInstancesResponse.FromString,
options,
channel_credentials,
insecure,
call_credentials,
compression,
wait_for_ready,
timeout,
metadata,
)

@staticmethod
def ListPartitions(
request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None,
):
return grpc.experimental.unary_unary(
request,
target,
"/ring.admin.v1.ClusterService/ListPartitions",
ring_dot_admin_dot_v1_dot_cluster__pb2.ListPartitionsRequest.SerializeToString,
ring_dot_admin_dot_v1_dot_cluster__pb2.ListPartitionsResponse.FromString,
options,
channel_credentials,
insecure,
call_credentials,
compression,
wait_for_ready,
timeout,
metadata,
)

@staticmethod
def ListZones(
request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None,
):
return grpc.experimental.unary_unary(
request,
target,
"/ring.admin.v1.ClusterService/ListZones",
ring_dot_admin_dot_v1_dot_cluster__pb2.ListZonesRequest.SerializeToString,
ring_dot_admin_dot_v1_dot_cluster__pb2.ListZonesResponse.FromString,
options,
channel_credentials,
insecure,
call_credentials,
compression,
wait_for_ready,
timeout,
metadata,
)
Loading
Loading