-
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 2 commits
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
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,2 @@ | ||
| # Default code owner for nipanel-python | ||
| mikeprosserni |
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 |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| ### What does this Pull Request accomplish? | ||
|
|
||
| TODO: Include high-level description of the changes in this pull request. | ||
|
|
||
| ### Why should this Pull Request be merged? | ||
|
|
||
| TODO: Justify why this contribution should be part of the project. | ||
|
|
||
| ### What testing has been done? | ||
|
|
||
| TODO: Detail what testing has been done to ensure this submission meets requirements. |
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,62 @@ | ||
| # Contributing to nipanel-python | ||
|
|
||
| Contributions to nipanel-python are welcome from all! | ||
|
|
||
| nipanel-python is managed via [git](https://git-scm.com), with the canonical upstream | ||
| repository hosted on [GitHub](https://github.com/ni/<reponame>/). | ||
|
|
||
| nipanel-python follows a pull-request model for development. If you wish to | ||
| contribute, you will need to create a GitHub account, fork this project, push a | ||
| branch with your changes to your project, and then submit a pull request. | ||
|
|
||
| Please remember to sign off your commits (e.g., by using `git commit -s` if you | ||
| are using the command line client). This amends your git commit message with a line | ||
| of the form `Signed-off-by: Name Lastname <[email protected]>`. Please | ||
| include all authors of any given commit into the commit message with a | ||
| `Signed-off-by` line. This indicates that you have read and signed the Developer | ||
| Certificate of Origin (see below) and are able to legally submit your code to | ||
| this repository. | ||
|
|
||
| See [GitHub's official documentation](https://help.github.com/articles/using-pull-requests/) for more details. | ||
|
|
||
| # Getting Started | ||
|
|
||
| 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` | ||
|
|
||
| # Testing | ||
|
|
||
| - TODO: include testing steps here. | ||
|
|
||
| # Developer Certificate of Origin (DCO) | ||
|
|
||
| Developer's Certificate of Origin 1.1 | ||
|
|
||
| By making a contribution to this project, I certify that: | ||
|
|
||
| (a) The contribution was created in whole or in part by me and I | ||
| have the right to submit it under the open source license | ||
| indicated in the file; or | ||
|
|
||
| (b) The contribution is based upon previous work that, to the best | ||
| of my knowledge, is covered under an appropriate open source | ||
| license and I have the right under that license to submit that | ||
| work with modifications, whether created in whole or in part | ||
| by me, under the same open source license (unless I am | ||
| permitted to submit under a different license), as indicated | ||
| in the file; or | ||
|
|
||
| (c) The contribution was provided directly to me by some other | ||
| person who certified (a), (b) or (c) and I have not modified | ||
| it. | ||
|
|
||
| (d) I understand and agree that this project and the contribution | ||
| are public and that a record of the contribution (including all | ||
| personal information I submit with it, including my sign-off) is | ||
| maintained indefinitely and may be redistributed consistent with | ||
| this project or the open source license(s) involved. | ||
|
|
||
| (taken from [developercertificate.org](https://developercertificate.org/)) | ||
|
|
||
| See [LICENSE](https://github.com/ni/<reponame>/blob/main/LICENSE) | ||
| for details about how \<reponame\> is licensed. |
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,20 @@ | ||
| Copyright (c) 2025, National Instruments Corp. | ||
|
|
||
| Permission is hereby granted, free of charge, to any person obtaining | ||
| a copy of this software and associated documentation files (the | ||
| "Software"), to deal in the Software without restriction, including | ||
| without limitation the rights to use, copy, modify, merge, publish, | ||
| distribute, sublicense, and/or sell copies of the Software, and to | ||
| permit persons to whom the Software is furnished to do so, subject to | ||
| the following conditions: | ||
|
|
||
| The above copyright notice and this permission notice shall be included | ||
| in all copies or substantial portions of the Software. | ||
|
|
||
| THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | ||
| EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | ||
| MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | ||
| IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY | ||
| CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, | ||
| TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE | ||
| SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
mikeprosserni marked this conversation as resolved.
Show resolved
Hide resolved
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` | ||
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,19 @@ | ||
| <!-- Begin NI SECURITY.md V1.0 --> | ||
|
|
||
| # Security | ||
|
|
||
| NI views the security of our software products as an important part of our commitment to our users. This includes source code repositories managed through the [NI](https://github.com/ni) GitHub organization. | ||
|
|
||
| ## Reporting Security Issues | ||
|
|
||
| We encourage you to report security vulnerabilities to us privately so we can follow the principle of [Coordinated Vulnerability Disclosure (CVD)](https://vuls.cert.org/confluence/display/CVD). This allows us time to thoroughly investigate security issues and publicly disclose them when appropriate. | ||
|
|
||
| **Please do not report security vulnerabilities through public GitHub issues.** | ||
|
|
||
| Instead, please report them by sending an email to [[email protected]](mailto:[email protected]) with sufficient details about the type of issue, the impact of the issue, and how to reproduce the issue. You may use the [NI PGP key](https://www.ni.com/en/support/security/pgp.html) to encrypt any sensitive communications you send to us. When you notify us of a potential security issue, our remediation process includes acknowledging receipt and coordinating any necessary response activities with you. | ||
|
|
||
| ## Learn More | ||
|
|
||
| To learn more about NI Security, please see [https://ni.com/security](https://ni.com/security) | ||
|
|
||
| <!-- End NI SECURITY.md --> |
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.