tilebox-grpc 0.36.0__tar.gz → 0.37.0__tar.gz

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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: tilebox-grpc
3
- Version: 0.36.0
3
+ Version: 0.37.0
4
4
  Summary: GRPC / Protocol Buffers functions for Tilebox
5
5
  Project-URL: Homepage, https://tilebox.com
6
6
  Project-URL: Documentation, https://docs.tilebox.com/
@@ -39,6 +39,15 @@ Description-Content-Type: text/markdown
39
39
  <a href="https://pypi.org/project/tilebox-grpc/">
40
40
  <img src="https://img.shields.io/pypi/pyversions/tilebox-grpc.svg?style=flat-square&logo=python&color=f43f5e&logoColor=f43f5e" alt="Required Python Version badge"/>
41
41
  </a>
42
+ <a href="https://github.com/tilebox/tilebox-python/blob/main/LICENSE">
43
+ <img src="https://img.shields.io/github/license/tilebox/tilebox-python.svg?style=flat-square&color=f43f5e" alt="MIT License"/>
44
+ </a>
45
+ <a href="https://github.com/tilebox/tilebox-python/actions">
46
+ <img src="https://img.shields.io/github/actions/workflow/status/tilebox/tilebox-python/main.yml?style=flat-square&color=f43f5e" alt="Build Status"/>
47
+ </a>
48
+ <a href="https://tilebox.com/discord">
49
+ <img src="https://img.shields.io/badge/Discord-%235865F2.svg?style=flat-square&logo=discord&logoColor=white" alt="Join us on Discord"/>
50
+ </a>
42
51
  </div>
43
52
 
44
53
  <p align="center">
@@ -46,7 +55,7 @@ Description-Content-Type: text/markdown
46
55
  |
47
56
  <a href="https://console.tilebox.com/"><b>Console</b></a>
48
57
  |
49
- <a href="https://tilebox.com/discord"><b>Discord</b></a>
58
+ <a href="https://examples.tilebox.com/"><b>Example Gallery</b></a>
50
59
  </p>
51
60
 
52
61
  # Tilebox GRPC
@@ -10,6 +10,15 @@
10
10
  <a href="https://pypi.org/project/tilebox-grpc/">
11
11
  <img src="https://img.shields.io/pypi/pyversions/tilebox-grpc.svg?style=flat-square&logo=python&color=f43f5e&logoColor=f43f5e" alt="Required Python Version badge"/>
12
12
  </a>
13
+ <a href="https://github.com/tilebox/tilebox-python/blob/main/LICENSE">
14
+ <img src="https://img.shields.io/github/license/tilebox/tilebox-python.svg?style=flat-square&color=f43f5e" alt="MIT License"/>
15
+ </a>
16
+ <a href="https://github.com/tilebox/tilebox-python/actions">
17
+ <img src="https://img.shields.io/github/actions/workflow/status/tilebox/tilebox-python/main.yml?style=flat-square&color=f43f5e" alt="Build Status"/>
18
+ </a>
19
+ <a href="https://tilebox.com/discord">
20
+ <img src="https://img.shields.io/badge/Discord-%235865F2.svg?style=flat-square&logo=discord&logoColor=white" alt="Join us on Discord"/>
21
+ </a>
13
22
  </div>
14
23
 
15
24
  <p align="center">
@@ -17,7 +26,7 @@
17
26
  |
18
27
  <a href="https://console.tilebox.com/"><b>Console</b></a>
19
28
  |
20
- <a href="https://tilebox.com/discord"><b>Discord</b></a>
29
+ <a href="https://examples.tilebox.com/"><b>Example Gallery</b></a>
21
30
  </p>
22
31
 
23
32
  # Tilebox GRPC
@@ -1,4 +1,4 @@
1
- from collections.abc import Callable
1
+ from collections.abc import Callable, Sequence
2
2
  from typing import TypeVar
3
3
 
4
4
  from _tilebox.grpc.channel import CHANNEL_OPTIONS, ChannelInfo, add_metadata, parse_channel_info
@@ -6,11 +6,12 @@ from grpc import ssl_channel_credentials
6
6
  from grpc.aio import (
7
7
  Channel,
8
8
  ClientCallDetails,
9
+ ClientInterceptor,
9
10
  UnaryUnaryCall,
11
+ UnaryUnaryClientInterceptor,
10
12
  insecure_channel,
11
13
  secure_channel,
12
14
  )
13
- from grpc.aio._interceptor import UnaryUnaryClientInterceptor
14
15
 
15
16
 
16
17
  def open_channel(url: str, auth_token: str | None = None) -> Channel:
@@ -25,14 +26,14 @@ def open_channel(url: str, auth_token: str | None = None) -> Channel:
25
26
  A gRPC channel.
26
27
  """
27
28
  channel_info = parse_channel_info(url)
28
- interceptors: list[UnaryUnaryClientInterceptor] = []
29
+ interceptors: list[ClientInterceptor] = []
29
30
  if auth_token is not None:
30
31
  interceptors = [_AuthMetadataInterceptor(auth_token), *interceptors] # add auth interceptor as the first one
31
32
 
32
33
  return _open_channel(channel_info, interceptors)
33
34
 
34
35
 
35
- def _open_channel(channel_info: ChannelInfo, interceptors: list[UnaryUnaryClientInterceptor]) -> Channel:
36
+ def _open_channel(channel_info: ChannelInfo, interceptors: Sequence[ClientInterceptor]) -> Channel:
36
37
  if channel_info.use_ssl:
37
38
  return secure_channel(
38
39
  channel_info.url_without_protocol, ssl_channel_credentials(), CHANNEL_OPTIONS, interceptors=interceptors
File without changes