-
Couldn't load subscription status.
- Fork 0
Implement Task AB#3090157 - Create poetry project and generate gRPC stubs #1
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
Merged
mikeprosserni
merged 8 commits into
main
from
users/mprosser/task-3090157-poetry-and-stubs
Apr 18, 2025
Merged
Changes from 1 commit
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
0f20ae1
poetry project and generated gRPC stubs
01d3ec4
add files from github-repo-template
05837fc
fill out workflows, issue template, folder structure, etc
0eec50f
exclude generated stubs from ni-python-styleguide and fix black issues
6964d06
add settings for mypy (excluding generated stub files)
6c2c7ed
add tool.poetry.group.test.dependencies
edf01a2
poetry lock
af5873d
clean up yml and toml files
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
mikeprosserni marked this conversation as resolved.
Show resolved
Hide resolved
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,6 @@ | ||
| # nipanel-python | ||
| Source for the nipanel python package | ||
|
|
||
| # Generated code | ||
mikeprosserni marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| This is the command to generate the files in \generated\python_panel_service\_stubs: | ||
| `poetry run python -m grpc_tools.protoc --proto_path=src/codegen/protos --python_out=generated/python_panel_service/_stubs --grpc_python_out=generated/python_panel_service/_stubs src/codegen/protos/python_panel_service.proto` | ||
43 changes: 43 additions & 0 deletions
43
generated/python_panel_service/_stubs/python_panel_service_pb2.py
mikeprosserni marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
180 changes: 180 additions & 0 deletions
180
generated/python_panel_service/_stubs/python_panel_service_pb2_grpc.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,180 @@ | ||
| # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! | ||
| """Client and server classes corresponding to protobuf-defined services.""" | ||
| import grpc | ||
|
|
||
| import python_panel_service_pb2 as python__panel__service__pb2 | ||
|
|
||
|
|
||
| class PythonPanelServiceStub(object): | ||
| """Service interface for connecting to python panels | ||
| """ | ||
|
|
||
| def __init__(self, channel): | ||
| """Constructor. | ||
|
|
||
| Args: | ||
| channel: A grpc.Channel. | ||
| """ | ||
| self.Connect = channel.unary_unary( | ||
| '/ni.pythonpanel.v1.PythonPanelService/Connect', | ||
| request_serializer=python__panel__service__pb2.ConnectRequest.SerializeToString, | ||
| response_deserializer=python__panel__service__pb2.ConnectResponse.FromString, | ||
| ) | ||
| self.Disconnect = channel.unary_unary( | ||
| '/ni.pythonpanel.v1.PythonPanelService/Disconnect', | ||
| request_serializer=python__panel__service__pb2.DisconnectRequest.SerializeToString, | ||
| response_deserializer=python__panel__service__pb2.DisconnectResponse.FromString, | ||
| ) | ||
| self.GetValue = channel.unary_unary( | ||
| '/ni.pythonpanel.v1.PythonPanelService/GetValue', | ||
| request_serializer=python__panel__service__pb2.GetValueRequest.SerializeToString, | ||
| response_deserializer=python__panel__service__pb2.GetValueResponse.FromString, | ||
| ) | ||
| self.SetValue = channel.unary_unary( | ||
| '/ni.pythonpanel.v1.PythonPanelService/SetValue', | ||
| request_serializer=python__panel__service__pb2.SetValueRequest.SerializeToString, | ||
| response_deserializer=python__panel__service__pb2.SetValueResponse.FromString, | ||
| ) | ||
|
|
||
|
|
||
| class PythonPanelServiceServicer(object): | ||
| """Service interface for connecting to python panels | ||
| """ | ||
|
|
||
| def Connect(self, request, context): | ||
| """Connect to a panel and open it | ||
| Status Codes for errors: | ||
| - NOT_FOUND: the file for the panel was not found | ||
| """ | ||
| context.set_code(grpc.StatusCode.UNIMPLEMENTED) | ||
| context.set_details('Method not implemented!') | ||
| raise NotImplementedError('Method not implemented!') | ||
|
|
||
| def Disconnect(self, request, context): | ||
| """Disconnect from a panel (does not close the panel) | ||
| Status Codes for errors: | ||
| - NOT_FOUND: the panel with the specified id was not found | ||
| """ | ||
| context.set_code(grpc.StatusCode.UNIMPLEMENTED) | ||
| context.set_details('Method not implemented!') | ||
| raise NotImplementedError('Method not implemented!') | ||
|
|
||
| def GetValue(self, request, context): | ||
| """Get a value for a control on the panel | ||
| Status Codes for errors: | ||
| - NOT_FOUND: the panel with the specified id was not found | ||
| """ | ||
| context.set_code(grpc.StatusCode.UNIMPLEMENTED) | ||
| context.set_details('Method not implemented!') | ||
| raise NotImplementedError('Method not implemented!') | ||
|
|
||
| def SetValue(self, request, context): | ||
| """Set a value for a control on the panel | ||
| Status Codes for errors: | ||
| - NOT_FOUND: the panel with the specified id was not found | ||
| """ | ||
| context.set_code(grpc.StatusCode.UNIMPLEMENTED) | ||
| context.set_details('Method not implemented!') | ||
| raise NotImplementedError('Method not implemented!') | ||
|
|
||
|
|
||
| def add_PythonPanelServiceServicer_to_server(servicer, server): | ||
| rpc_method_handlers = { | ||
| 'Connect': grpc.unary_unary_rpc_method_handler( | ||
| servicer.Connect, | ||
| request_deserializer=python__panel__service__pb2.ConnectRequest.FromString, | ||
| response_serializer=python__panel__service__pb2.ConnectResponse.SerializeToString, | ||
| ), | ||
| 'Disconnect': grpc.unary_unary_rpc_method_handler( | ||
| servicer.Disconnect, | ||
| request_deserializer=python__panel__service__pb2.DisconnectRequest.FromString, | ||
| response_serializer=python__panel__service__pb2.DisconnectResponse.SerializeToString, | ||
| ), | ||
| 'GetValue': grpc.unary_unary_rpc_method_handler( | ||
| servicer.GetValue, | ||
| request_deserializer=python__panel__service__pb2.GetValueRequest.FromString, | ||
| response_serializer=python__panel__service__pb2.GetValueResponse.SerializeToString, | ||
| ), | ||
| 'SetValue': grpc.unary_unary_rpc_method_handler( | ||
| servicer.SetValue, | ||
| request_deserializer=python__panel__service__pb2.SetValueRequest.FromString, | ||
| response_serializer=python__panel__service__pb2.SetValueResponse.SerializeToString, | ||
| ), | ||
| } | ||
| generic_handler = grpc.method_handlers_generic_handler( | ||
| 'ni.pythonpanel.v1.PythonPanelService', rpc_method_handlers) | ||
| server.add_generic_rpc_handlers((generic_handler,)) | ||
|
|
||
|
|
||
| # This class is part of an EXPERIMENTAL API. | ||
| class PythonPanelService(object): | ||
| """Service interface for connecting to python panels | ||
| """ | ||
|
|
||
| @staticmethod | ||
| def Connect(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, '/ni.pythonpanel.v1.PythonPanelService/Connect', | ||
| python__panel__service__pb2.ConnectRequest.SerializeToString, | ||
| python__panel__service__pb2.ConnectResponse.FromString, | ||
| options, channel_credentials, | ||
| insecure, call_credentials, compression, wait_for_ready, timeout, metadata) | ||
|
|
||
| @staticmethod | ||
| def Disconnect(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, '/ni.pythonpanel.v1.PythonPanelService/Disconnect', | ||
| python__panel__service__pb2.DisconnectRequest.SerializeToString, | ||
| python__panel__service__pb2.DisconnectResponse.FromString, | ||
| options, channel_credentials, | ||
| insecure, call_credentials, compression, wait_for_ready, timeout, metadata) | ||
|
|
||
| @staticmethod | ||
| def GetValue(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, '/ni.pythonpanel.v1.PythonPanelService/GetValue', | ||
| python__panel__service__pb2.GetValueRequest.SerializeToString, | ||
| python__panel__service__pb2.GetValueResponse.FromString, | ||
| options, channel_credentials, | ||
| insecure, call_credentials, compression, wait_for_ready, timeout, metadata) | ||
|
|
||
| @staticmethod | ||
| def SetValue(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, '/ni.pythonpanel.v1.PythonPanelService/SetValue', | ||
| python__panel__service__pb2.SetValueRequest.SerializeToString, | ||
| python__panel__service__pb2.SetValueResponse.FromString, | ||
| options, channel_credentials, | ||
| insecure, call_credentials, compression, wait_for_ready, timeout, metadata) |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.