netherframe.protocol.tfplugin 0.3.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. netherframe/protocol/tfplugin/__init__.py +1 -0
  2. netherframe/protocol/tfplugin/_sources/MPL-2.0.txt +353 -0
  3. netherframe/protocol/tfplugin/_sources/NOTICE.md +19 -0
  4. netherframe/protocol/tfplugin/_sources/SOURCES.json +34 -0
  5. netherframe/protocol/tfplugin/_sources/grpc_controller.proto +11 -0
  6. netherframe/protocol/tfplugin/_sources/grpc_stdio.proto +30 -0
  7. netherframe/protocol/tfplugin/_sources/tfplugin5.proto +1013 -0
  8. netherframe/protocol/tfplugin/_sources/tfplugin6.proto +1092 -0
  9. netherframe/protocol/tfplugin/grpc_controller_pb2.py +41 -0
  10. netherframe/protocol/tfplugin/grpc_controller_pb2.pyi +11 -0
  11. netherframe/protocol/tfplugin/grpc_controller_pb2_grpc.py +102 -0
  12. netherframe/protocol/tfplugin/grpc_stdio_pb2.py +44 -0
  13. netherframe/protocol/tfplugin/grpc_stdio_pb2.pyi +25 -0
  14. netherframe/protocol/tfplugin/grpc_stdio_pb2_grpc.py +114 -0
  15. netherframe/protocol/tfplugin/py.typed +0 -0
  16. netherframe/protocol/tfplugin/tfplugin5_pb2.py +344 -0
  17. netherframe/protocol/tfplugin/tfplugin5_pb2.pyi +1096 -0
  18. netherframe/protocol/tfplugin/tfplugin5_pb2_grpc.py +1440 -0
  19. netherframe/protocol/tfplugin/tfplugin6_pb2.py +380 -0
  20. netherframe/protocol/tfplugin/tfplugin6_pb2.pyi +1207 -0
  21. netherframe/protocol/tfplugin/tfplugin6_pb2_grpc.py +1634 -0
  22. netherframe_protocol_tfplugin-0.3.0.dist-info/METADATA +29 -0
  23. netherframe_protocol_tfplugin-0.3.0.dist-info/RECORD +37 -0
  24. netherframe_protocol_tfplugin-0.3.0.dist-info/WHEEL +4 -0
  25. netherframe_protocol_tfplugin-0.3.0.dist-info/licenses/LICENSE +21 -0
  26. netherframe_protocol_tfplugin-0.3.0.dist-info/licenses/LICENSES/MPL-2.0.txt +353 -0
  27. netherframe_protocol_tfplugin-0.3.0.dist-info/licenses/NOTICE.md +19 -0
  28. nf/protocol/tfplugin/__init__.py +4 -0
  29. nf/protocol/tfplugin/grpc_controller_pb2.py +4 -0
  30. nf/protocol/tfplugin/grpc_controller_pb2_grpc.py +4 -0
  31. nf/protocol/tfplugin/grpc_stdio_pb2.py +4 -0
  32. nf/protocol/tfplugin/grpc_stdio_pb2_grpc.py +4 -0
  33. nf/protocol/tfplugin/py.typed +0 -0
  34. nf/protocol/tfplugin/tfplugin5_pb2.py +4 -0
  35. nf/protocol/tfplugin/tfplugin5_pb2_grpc.py +4 -0
  36. nf/protocol/tfplugin/tfplugin6_pb2.py +4 -0
  37. nf/protocol/tfplugin/tfplugin6_pb2_grpc.py +4 -0
@@ -0,0 +1,41 @@
1
+ # SPDX-License-Identifier: MPL-2.0
2
+ # Generated from the corresponding MPL-2.0 source in _sources/.
3
+ # -*- coding: utf-8 -*-
4
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
5
+ # NO CHECKED-IN PROTOBUF GENCODE
6
+ # source: grpc_controller.proto
7
+ # Protobuf Python Version: 7.35.1
8
+ """Generated protocol buffer code."""
9
+ from google.protobuf import descriptor as _descriptor
10
+ from google.protobuf import descriptor_pool as _descriptor_pool
11
+ from google.protobuf import runtime_version as _runtime_version
12
+ from google.protobuf import symbol_database as _symbol_database
13
+ from google.protobuf.internal import builder as _builder
14
+ _runtime_version.ValidateProtobufRuntimeVersion(
15
+ _runtime_version.Domain.PUBLIC,
16
+ 7,
17
+ 35,
18
+ 1,
19
+ '',
20
+ 'grpc_controller.proto'
21
+ )
22
+ # @@protoc_insertion_point(imports)
23
+
24
+ _sym_db = _symbol_database.Default()
25
+
26
+
27
+
28
+
29
+ DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x15grpc_controller.proto\x12\x06plugin\"\x07\n\x05\x45mpty2:\n\x0eGRPCController\x12(\n\x08Shutdown\x12\r.plugin.Empty\x1a\r.plugin.EmptyB\x08Z\x06pluginb\x06proto3')
30
+
31
+ _globals = globals()
32
+ _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
33
+ _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'grpc_controller_pb2', _globals)
34
+ if not _descriptor._USE_C_DESCRIPTORS:
35
+ _globals['DESCRIPTOR']._loaded_options = None
36
+ _globals['DESCRIPTOR']._serialized_options = b'Z\006plugin'
37
+ _globals['_EMPTY']._serialized_start=33
38
+ _globals['_EMPTY']._serialized_end=40
39
+ _globals['_GRPCCONTROLLER']._serialized_start=42
40
+ _globals['_GRPCCONTROLLER']._serialized_end=100
41
+ # @@protoc_insertion_point(module_scope)
@@ -0,0 +1,11 @@
1
+ # SPDX-License-Identifier: MPL-2.0
2
+ # Generated from the corresponding MPL-2.0 source in _sources/.
3
+ from google.protobuf import descriptor as _descriptor
4
+ from google.protobuf import message as _message
5
+ from typing import ClassVar as _ClassVar
6
+
7
+ DESCRIPTOR: _descriptor.FileDescriptor
8
+
9
+ class Empty(_message.Message):
10
+ __slots__ = ()
11
+ def __init__(self) -> None: ...
@@ -0,0 +1,102 @@
1
+ # SPDX-License-Identifier: MPL-2.0
2
+ # Generated from the corresponding MPL-2.0 source in _sources/.
3
+ # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
4
+ """Client and server classes corresponding to protobuf-defined services."""
5
+ import grpc
6
+ import warnings
7
+
8
+ from . import grpc_controller_pb2 as grpc__controller__pb2
9
+
10
+ GRPC_GENERATED_VERSION = '1.85.1'
11
+ GRPC_VERSION = grpc.__version__
12
+ _version_not_supported = False
13
+
14
+ try:
15
+ from grpc._utilities import first_version_is_lower
16
+ _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION)
17
+ except ImportError:
18
+ _version_not_supported = True
19
+
20
+ if _version_not_supported:
21
+ raise RuntimeError(
22
+ f'The grpc package installed is at version {GRPC_VERSION},'
23
+ + ' but the generated code in grpc_controller_pb2_grpc.py depends on'
24
+ + f' grpcio>={GRPC_GENERATED_VERSION}.'
25
+ + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}'
26
+ + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.'
27
+ )
28
+
29
+
30
+ class GRPCControllerStub:
31
+ """The GRPCController is responsible for telling the plugin server to shutdown.
32
+ """
33
+
34
+ def __init__(self, channel):
35
+ """Constructor.
36
+
37
+ Args:
38
+ channel: A grpc.Channel.
39
+ """
40
+ self.Shutdown = channel.unary_unary(
41
+ '/plugin.GRPCController/Shutdown',
42
+ request_serializer=grpc__controller__pb2.Empty.SerializeToString,
43
+ response_deserializer=grpc__controller__pb2.Empty.FromString,
44
+ _registered_method=True)
45
+
46
+
47
+ class GRPCControllerServicer:
48
+ """The GRPCController is responsible for telling the plugin server to shutdown.
49
+ """
50
+
51
+ def Shutdown(self, request, context):
52
+ """Missing associated documentation comment in .proto file."""
53
+ context.set_code(grpc.StatusCode.UNIMPLEMENTED)
54
+ context.set_details('Method not implemented!')
55
+ raise NotImplementedError('Method not implemented!')
56
+
57
+
58
+ def add_GRPCControllerServicer_to_server(servicer, server):
59
+ rpc_method_handlers = {
60
+ 'Shutdown': grpc.unary_unary_rpc_method_handler(
61
+ servicer.Shutdown,
62
+ request_deserializer=grpc__controller__pb2.Empty.FromString,
63
+ response_serializer=grpc__controller__pb2.Empty.SerializeToString,
64
+ ),
65
+ }
66
+ generic_handler = grpc.method_handlers_generic_handler(
67
+ 'plugin.GRPCController', rpc_method_handlers)
68
+ server.add_generic_rpc_handlers((generic_handler,))
69
+ server.add_registered_method_handlers('plugin.GRPCController', rpc_method_handlers)
70
+
71
+
72
+ # This class is part of an EXPERIMENTAL API.
73
+ class GRPCController:
74
+ """The GRPCController is responsible for telling the plugin server to shutdown.
75
+ """
76
+
77
+ @staticmethod
78
+ def Shutdown(request,
79
+ target,
80
+ options=(),
81
+ channel_credentials=None,
82
+ call_credentials=None,
83
+ insecure=False,
84
+ compression=None,
85
+ wait_for_ready=None,
86
+ timeout=None,
87
+ metadata=None):
88
+ return grpc.experimental.unary_unary(
89
+ request,
90
+ target,
91
+ '/plugin.GRPCController/Shutdown',
92
+ grpc__controller__pb2.Empty.SerializeToString,
93
+ grpc__controller__pb2.Empty.FromString,
94
+ options,
95
+ channel_credentials,
96
+ insecure,
97
+ call_credentials,
98
+ compression,
99
+ wait_for_ready,
100
+ timeout,
101
+ metadata,
102
+ _registered_method=True)
@@ -0,0 +1,44 @@
1
+ # SPDX-License-Identifier: MPL-2.0
2
+ # Generated from the corresponding MPL-2.0 source in _sources/.
3
+ # -*- coding: utf-8 -*-
4
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
5
+ # NO CHECKED-IN PROTOBUF GENCODE
6
+ # source: grpc_stdio.proto
7
+ # Protobuf Python Version: 7.35.1
8
+ """Generated protocol buffer code."""
9
+ from google.protobuf import descriptor as _descriptor
10
+ from google.protobuf import descriptor_pool as _descriptor_pool
11
+ from google.protobuf import runtime_version as _runtime_version
12
+ from google.protobuf import symbol_database as _symbol_database
13
+ from google.protobuf.internal import builder as _builder
14
+ _runtime_version.ValidateProtobufRuntimeVersion(
15
+ _runtime_version.Domain.PUBLIC,
16
+ 7,
17
+ 35,
18
+ 1,
19
+ '',
20
+ 'grpc_stdio.proto'
21
+ )
22
+ # @@protoc_insertion_point(imports)
23
+
24
+ _sym_db = _symbol_database.Default()
25
+
26
+
27
+ from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2
28
+
29
+
30
+ DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x10grpc_stdio.proto\x12\x06plugin\x1a\x1bgoogle/protobuf/empty.proto\"u\n\tStdioData\x12*\n\x07\x63hannel\x18\x01 \x01(\x0e\x32\x19.plugin.StdioData.Channel\x12\x0c\n\x04\x64\x61ta\x18\x02 \x01(\x0c\".\n\x07\x43hannel\x12\x0b\n\x07INVALID\x10\x00\x12\n\n\x06STDOUT\x10\x01\x12\n\n\x06STDERR\x10\x02\x32G\n\tGRPCStdio\x12:\n\x0bStreamStdio\x12\x16.google.protobuf.Empty\x1a\x11.plugin.StdioData0\x01\x42\x08Z\x06pluginb\x06proto3')
31
+
32
+ _globals = globals()
33
+ _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
34
+ _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'grpc_stdio_pb2', _globals)
35
+ if not _descriptor._USE_C_DESCRIPTORS:
36
+ _globals['DESCRIPTOR']._loaded_options = None
37
+ _globals['DESCRIPTOR']._serialized_options = b'Z\006plugin'
38
+ _globals['_STDIODATA']._serialized_start=57
39
+ _globals['_STDIODATA']._serialized_end=174
40
+ _globals['_STDIODATA_CHANNEL']._serialized_start=128
41
+ _globals['_STDIODATA_CHANNEL']._serialized_end=174
42
+ _globals['_GRPCSTDIO']._serialized_start=176
43
+ _globals['_GRPCSTDIO']._serialized_end=247
44
+ # @@protoc_insertion_point(module_scope)
@@ -0,0 +1,25 @@
1
+ # SPDX-License-Identifier: MPL-2.0
2
+ # Generated from the corresponding MPL-2.0 source in _sources/.
3
+ from google.protobuf import empty_pb2 as _empty_pb2
4
+ from google.protobuf.internal import enum_type_wrapper as _enum_type_wrapper
5
+ from google.protobuf import descriptor as _descriptor
6
+ from google.protobuf import message as _message
7
+ from typing import ClassVar as _ClassVar, Optional as _Optional, Union as _Union
8
+
9
+ DESCRIPTOR: _descriptor.FileDescriptor
10
+
11
+ class StdioData(_message.Message):
12
+ __slots__ = ("channel", "data")
13
+ class Channel(int, metaclass=_enum_type_wrapper.EnumTypeWrapper):
14
+ __slots__ = ()
15
+ INVALID: _ClassVar[StdioData.Channel]
16
+ STDOUT: _ClassVar[StdioData.Channel]
17
+ STDERR: _ClassVar[StdioData.Channel]
18
+ INVALID: StdioData.Channel
19
+ STDOUT: StdioData.Channel
20
+ STDERR: StdioData.Channel
21
+ CHANNEL_FIELD_NUMBER: _ClassVar[int]
22
+ DATA_FIELD_NUMBER: _ClassVar[int]
23
+ channel: StdioData.Channel
24
+ data: bytes
25
+ def __init__(self, channel: _Optional[_Union[StdioData.Channel, str]] = ..., data: _Optional[bytes] = ...) -> None: ...
@@ -0,0 +1,114 @@
1
+ # SPDX-License-Identifier: MPL-2.0
2
+ # Generated from the corresponding MPL-2.0 source in _sources/.
3
+ # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
4
+ """Client and server classes corresponding to protobuf-defined services."""
5
+ import grpc
6
+ import warnings
7
+
8
+ from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2
9
+ from . import grpc_stdio_pb2 as grpc__stdio__pb2
10
+
11
+ GRPC_GENERATED_VERSION = '1.85.1'
12
+ GRPC_VERSION = grpc.__version__
13
+ _version_not_supported = False
14
+
15
+ try:
16
+ from grpc._utilities import first_version_is_lower
17
+ _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION)
18
+ except ImportError:
19
+ _version_not_supported = True
20
+
21
+ if _version_not_supported:
22
+ raise RuntimeError(
23
+ f'The grpc package installed is at version {GRPC_VERSION},'
24
+ + ' but the generated code in grpc_stdio_pb2_grpc.py depends on'
25
+ + f' grpcio>={GRPC_GENERATED_VERSION}.'
26
+ + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}'
27
+ + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.'
28
+ )
29
+
30
+
31
+ class GRPCStdioStub:
32
+ """GRPCStdio is a service that is automatically run by the plugin process
33
+ to stream any stdout/err data so that it can be mirrored on the plugin
34
+ host side.
35
+ """
36
+
37
+ def __init__(self, channel):
38
+ """Constructor.
39
+
40
+ Args:
41
+ channel: A grpc.Channel.
42
+ """
43
+ self.StreamStdio = channel.unary_stream(
44
+ '/plugin.GRPCStdio/StreamStdio',
45
+ request_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
46
+ response_deserializer=grpc__stdio__pb2.StdioData.FromString,
47
+ _registered_method=True)
48
+
49
+
50
+ class GRPCStdioServicer:
51
+ """GRPCStdio is a service that is automatically run by the plugin process
52
+ to stream any stdout/err data so that it can be mirrored on the plugin
53
+ host side.
54
+ """
55
+
56
+ def StreamStdio(self, request, context):
57
+ """StreamStdio returns a stream that contains all the stdout/stderr.
58
+ This RPC endpoint must only be called ONCE. Once stdio data is consumed
59
+ it is not sent again.
60
+
61
+ Callers should connect early to prevent blocking on the plugin process.
62
+ """
63
+ context.set_code(grpc.StatusCode.UNIMPLEMENTED)
64
+ context.set_details('Method not implemented!')
65
+ raise NotImplementedError('Method not implemented!')
66
+
67
+
68
+ def add_GRPCStdioServicer_to_server(servicer, server):
69
+ rpc_method_handlers = {
70
+ 'StreamStdio': grpc.unary_stream_rpc_method_handler(
71
+ servicer.StreamStdio,
72
+ request_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString,
73
+ response_serializer=grpc__stdio__pb2.StdioData.SerializeToString,
74
+ ),
75
+ }
76
+ generic_handler = grpc.method_handlers_generic_handler(
77
+ 'plugin.GRPCStdio', rpc_method_handlers)
78
+ server.add_generic_rpc_handlers((generic_handler,))
79
+ server.add_registered_method_handlers('plugin.GRPCStdio', rpc_method_handlers)
80
+
81
+
82
+ # This class is part of an EXPERIMENTAL API.
83
+ class GRPCStdio:
84
+ """GRPCStdio is a service that is automatically run by the plugin process
85
+ to stream any stdout/err data so that it can be mirrored on the plugin
86
+ host side.
87
+ """
88
+
89
+ @staticmethod
90
+ def StreamStdio(request,
91
+ target,
92
+ options=(),
93
+ channel_credentials=None,
94
+ call_credentials=None,
95
+ insecure=False,
96
+ compression=None,
97
+ wait_for_ready=None,
98
+ timeout=None,
99
+ metadata=None):
100
+ return grpc.experimental.unary_stream(
101
+ request,
102
+ target,
103
+ '/plugin.GRPCStdio/StreamStdio',
104
+ google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString,
105
+ grpc__stdio__pb2.StdioData.FromString,
106
+ options,
107
+ channel_credentials,
108
+ insecure,
109
+ call_credentials,
110
+ compression,
111
+ wait_for_ready,
112
+ timeout,
113
+ metadata,
114
+ _registered_method=True)
File without changes