crossplane-function-sdk-python 0.13.0__py3-none-any.whl → 0.14.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.
@@ -15,4 +15,4 @@
15
15
  """The version of function-sdk-python."""
16
16
 
17
17
  # This is set at build time, using "hatch version"
18
- __version__ = "0.13.0"
18
+ __version__ = "0.14.0"
@@ -163,13 +163,16 @@ def require_resources( # noqa: PLR0913
163
163
  namespace: The namespace to search in (optional).
164
164
 
165
165
  Raises:
166
- ValueError: If both match_name and match_labels are provided, or neither.
166
+ ValueError: If both match_name and match_labels are provided.
167
167
 
168
168
  This tells Crossplane to fetch the specified resources and include them
169
169
  in the next call to the function in req.required_resources[name].
170
+
171
+ If neither match_name nor match_labels is provided, all resources of the
172
+ given api_version and kind are matched.
170
173
  """
171
- if (match_name is None) == (match_labels is None):
172
- msg = "Exactly one of match_name or match_labels must be provided"
174
+ if match_name is not None and match_labels is not None:
175
+ msg = "match_name and match_labels are mutually exclusive"
173
176
  raise ValueError(msg)
174
177
 
175
178
  selector = fnv1.ResourceSelector(
@@ -70,7 +70,7 @@ def load_credentials(tls_certs_dir: str) -> grpc.ServerCredentials:
70
70
 
71
71
 
72
72
  def serve(
73
- function: grpcv1.FunctionRunnerService,
73
+ function: grpcv1.FunctionRunnerServiceServicer,
74
74
  address: str,
75
75
  *,
76
76
  creds: grpc.ServerCredentials,
@@ -134,20 +134,20 @@ def serve(
134
134
  loop.close()
135
135
 
136
136
 
137
- class BetaFunctionRunner(grpcv1beta1.FunctionRunnerService):
137
+ class BetaFunctionRunner(grpcv1beta1.FunctionRunnerServiceServicer):
138
138
  """A BetaFunctionRunner handles beta gRPC RunFunctionRequests.
139
139
 
140
- It handles requests by passing them to a wrapped v1.FunctionRunnerService.
140
+ It handles requests by passing them to a wrapped v1.FunctionRunnerServiceServicer.
141
141
  Incoming v1beta1 requests are converted to v1 by round-tripping them through
142
142
  serialization. Outgoing requests are converted from v1 to v1beta1 the same
143
143
  way.
144
144
  """
145
145
 
146
- def __init__(self, wrapped: grpcv1.FunctionRunnerService):
146
+ def __init__(self, wrapped: grpcv1.FunctionRunnerServiceServicer):
147
147
  """Create a new BetaFunctionRunner."""
148
148
  self.wrapped = wrapped
149
149
 
150
- async def RunFunction( # noqa: N802 # gRPC requires this name.
150
+ async def RunFunction( # noqa: N802 # gRPC requires this name. # pyright: ignore[reportIncompatibleMethodOverride]
151
151
  self, req: fnv1beta1.RunFunctionRequest, context: grpc.aio.ServicerContext
152
152
  ) -> fnv1beta1.RunFunctionResponse:
153
153
  """Run the underlying function."""
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: crossplane-function-sdk-python
3
- Version: 0.13.0
3
+ Version: 0.14.0
4
4
  Summary: The Python SDK for Crossplane composition functions
5
5
  Project-URL: Documentation, https://github.com/crossplane/function-sdk-python#readme
6
6
  Project-URL: Issues, https://github.com/crossplane/function-sdk-python/issues
@@ -1,10 +1,10 @@
1
- crossplane/function/__version__.py,sha256=nDbIp267a9k4yn3en2Axof0C8B4uXqp0JutLGsVZO-c,705
1
+ crossplane/function/__version__.py,sha256=oKtus0bQUO42aKqWWxuhQxgBpNDRCrC6BLgLMdh_1Vk,705
2
2
  crossplane/function/logging.py,sha256=Zawqq36FBzjkVg4bJ3VGK12-so7N8yAMoSPrhdwpBSA,2503
3
3
  crossplane/function/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
4
  crossplane/function/request.py,sha256=ncgGTyAvBOdZ8M7KPy_H9pL08_cYzKJ3D9q_rnSjPXo,8199
5
5
  crossplane/function/resource.py,sha256=D9OWyzfQNZhPQFDDFDBqva9bPiKV2nRuivG_L1mBjv4,8386
6
- crossplane/function/response.py,sha256=7LR5CFaMOpBU2Fv-TMFe_CFx0mgZXX9WDm7vV8FtwtY,6965
7
- crossplane/function/runtime.py,sha256=2S-AheR2o0pJxJRhDZDoWpJxCleIv_aHTnzRGgrZv_8,5415
6
+ crossplane/function/response.py,sha256=H5LnyBBTs6ZGmRfMOXew3o_3DkMEfhi77xG6xGZ8NLo,7072
7
+ crossplane/function/runtime.py,sha256=2Is5E2XuJibWH0CLULhJ_cmMcRYDeBApypZca97l8Xw,5499
8
8
  crossplane/function/proto/v1/run_function.proto,sha256=GbJ0wVUEjfpMsn2DsnhiPvtmL09z3oyMbWwf6viQtiw,16676
9
9
  crossplane/function/proto/v1/run_function_pb2.py,sha256=eeQajHePjvswGCEH2FRxyr8P-K0Go55U5L4rAa32JA8,14440
10
10
  crossplane/function/proto/v1/run_function_pb2.pyi,sha256=MvjcY39d1xJ4ZZmRibhehCKF1mHVGb6qfpoCQO8XYqE,14374
@@ -13,7 +13,7 @@ crossplane/function/proto/v1beta1/run_function.proto,sha256=EVYIEQCiPu1eOdGJQ3tu
13
13
  crossplane/function/proto/v1beta1/run_function_pb2.py,sha256=G4TTK_cYTOQlRN5byADcEFPjTILYYWj3b4m19iiPO4g,14664
14
14
  crossplane/function/proto/v1beta1/run_function_pb2.pyi,sha256=MvjcY39d1xJ4ZZmRibhehCKF1mHVGb6qfpoCQO8XYqE,14374
15
15
  crossplane/function/proto/v1beta1/run_function_pb2_grpc.py,sha256=Hj5KCSTyT_vIpTXWwc5MwiKxwxaOhjbfY5Iedidx9AQ,4033
16
- crossplane_function_sdk_python-0.13.0.dist-info/METADATA,sha256=nNoH1v97pxqquHlOuui-d2ZC04OC6wsNeNs-REjVzOg,3244
17
- crossplane_function_sdk_python-0.13.0.dist-info/WHEEL,sha256=mffPy8wBnZQn2VnJUU5jE99KsxaSfiyMHV9Yt0aLVxs,87
18
- crossplane_function_sdk_python-0.13.0.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
19
- crossplane_function_sdk_python-0.13.0.dist-info/RECORD,,
16
+ crossplane_function_sdk_python-0.14.0.dist-info/METADATA,sha256=I3UMTU0jZB9yFSy_w0zy65iIcNgkccljVz2dxGClTUU,3244
17
+ crossplane_function_sdk_python-0.14.0.dist-info/WHEEL,sha256=mffPy8wBnZQn2VnJUU5jE99KsxaSfiyMHV9Yt0aLVxs,87
18
+ crossplane_function_sdk_python-0.14.0.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
19
+ crossplane_function_sdk_python-0.14.0.dist-info/RECORD,,