UncountablePythonSDK 0.0.26__py3-none-any.whl → 0.0.27__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.

Potentially problematic release.


This version of UncountablePythonSDK might be problematic. Click here for more details.

@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: UncountablePythonSDK
3
- Version: 0.0.26
3
+ Version: 0.0.27
4
4
  Summary: Uncountable SDK
5
5
  Project-URL: Homepage, https://github.com/uncountableinc/uncountable-python-sdk
6
6
  Project-URL: Repository, https://github.com/uncountableinc/uncountable-python-sdk.git
@@ -16,21 +16,21 @@ Classifier: Topic :: Utilities
16
16
  Classifier: Typing :: Typed
17
17
  Requires-Python: >=3.11
18
18
  Description-Content-Type: text/markdown
19
- Requires-Dist: aiotus ==0.1.15
20
- Requires-Dist: aiohttp ==3.9.5
21
- Requires-Dist: requests ==2.31.0
22
- Requires-Dist: SQLAlchemy ==1.4.52
23
- Requires-Dist: APScheduler ==3.10.4
24
- Requires-Dist: python-dateutil ==2.9.0.post0
25
- Requires-Dist: shelljob ==0.6.3
26
- Requires-Dist: PyYAML ==6.0.1
19
+ Requires-Dist: aiotus ==0.*
20
+ Requires-Dist: aiohttp ==3.*
21
+ Requires-Dist: requests ==2.*
22
+ Requires-Dist: SQLAlchemy ==1.4.*
23
+ Requires-Dist: APScheduler ==3.*
24
+ Requires-Dist: python-dateutil ==2.*
25
+ Requires-Dist: shelljob ==0.*
26
+ Requires-Dist: PyYAML ==6.*
27
27
  Provides-Extra: test
28
- Requires-Dist: mypy >=1.8.1 ; extra == 'test'
29
- Requires-Dist: ruff >=0.2.1 ; extra == 'test'
30
- Requires-Dist: pytest >=7.4.3 ; extra == 'test'
31
- Requires-Dist: coverage[toml] >=6.5.0 ; extra == 'test'
32
- Requires-Dist: pytest-cov >=4.1.0 ; extra == 'test'
33
- Requires-Dist: pytest-xdist >=3.5.0 ; extra == 'test'
28
+ Requires-Dist: mypy ==1.* ; extra == 'test'
29
+ Requires-Dist: ruff ==0.* ; extra == 'test'
30
+ Requires-Dist: pytest ==7.* ; extra == 'test'
31
+ Requires-Dist: coverage[toml] ==6.* ; extra == 'test'
32
+ Requires-Dist: pytest-cov ==4.* ; extra == 'test'
33
+ Requires-Dist: pytest-xdist ==3.* ; extra == 'test'
34
34
 
35
35
  # Uncountable Python SDK
36
36
 
@@ -38,7 +38,7 @@ pkgs/type_spec/__main__.py,sha256=5bJaX9Y_-FavP0qwzhk-z-V97UY7uaezJTa1zhO_HHQ,10
38
38
  pkgs/type_spec/builder.py,sha256=S7lZCbGbeQ9cUQHnhY9vvpgFUQj8DjsOaNBVqRUff6Y,43253
39
39
  pkgs/type_spec/config.py,sha256=INfEiDcUsZFUKasHprsE6i33siPB0RnfmTKOsWcGnQ8,5043
40
40
  pkgs/type_spec/emit_io_ts.py,sha256=Ghd8XYqyNYldHQDepwa9GLfHXcoi48ztBw84K28ETic,5707
41
- pkgs/type_spec/emit_open_api.py,sha256=nDUlVSmzqc1GkbyND9rbeM2AHOO-mbtzRmdOqA6KKXE,23821
41
+ pkgs/type_spec/emit_open_api.py,sha256=rAxfPVsqJU7ass76dPhImgPao6AW6xyz-rMaQDhSp1I,23822
42
42
  pkgs/type_spec/emit_open_api_util.py,sha256=XAA6zH59aZWLVl0BvKAICXXl4sdBqx01QAtv5oB0bMI,2266
43
43
  pkgs/type_spec/emit_python.py,sha256=aGPnp86DZN0N7c5eiBHVAT_smDf1uCLmRldDhxmWx9g,42673
44
44
  pkgs/type_spec/emit_typescript.py,sha256=4hpCJwiDf-v8LJaNFVfFtf8zvtG73YNPFwwa_5NuffI,17729
@@ -114,9 +114,9 @@ uncountable/__init__.py,sha256=281cC2hs8pbrD0jVKMol-tbWSh7Zcsc8oRT42dKteyE,102
114
114
  uncountable/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
115
115
  uncountable/core/__init__.py,sha256=J0CeeztqyJe7klvHM-8fwSivN1sud6xZThOdaThnQrU,314
116
116
  uncountable/core/async_batch.py,sha256=0cRmCr6Z9sNxZyfY9Dl8wlCA4anISVZuHGgBegHhUbc,749
117
- uncountable/core/client.py,sha256=cP6yEHv5KGE2NJn0BAQh470mirBfITMLsfEs-zj-6Ys,9024
118
- uncountable/core/file_upload.py,sha256=zTpAFSd7_-TmEVWxOn1rDznyWE6_AdZyuDQC3LP34iI,2667
119
- uncountable/core/types.py,sha256=RaNVuUPpcMBCfk-stS4Jh-9WBFzKK6_cVgRfPv7Dz6g,280
117
+ uncountable/core/client.py,sha256=1a8vstovmqsRvrE4YsKCoZAKDNWXMECnR-BlKEWsxoY,9033
118
+ uncountable/core/file_upload.py,sha256=YWOay69i_-sNGBNnwzKb3bY3OMaV4lRsdVZZK-ScXVc,2829
119
+ uncountable/core/types.py,sha256=zM_FqVT41qqZAhXxKSK_kQccArfw6B_p2qMYBRKJHqE,332
120
120
  uncountable/integration/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
121
121
  uncountable/integration/construct_client.py,sha256=r6M5pnIO0fKcjf5d_AREPtWZ6AkWgcjkdu_jHQEYlT8,1084
122
122
  uncountable/integration/cron.py,sha256=TIPqMPMSMtMJTu4aXwLf6QY-OLrpmyITLDp48UIr4Ok,919
@@ -226,7 +226,7 @@ uncountable/types/api/recipes/set_recipe_tags.py,sha256=U710hgq9-t6QZGRB-ZGHskpt
226
226
  uncountable/types/api/recipes/unarchive_recipes.py,sha256=WcwFYbBsX2SKXnoBQ8locnRn7Bj1rHdtrURQVOfqgfU,814
227
227
  uncountable/types/api/triggers/__init__.py,sha256=gCgbynxG3jA8FQHzercKtrHKHkiIKr8APdZYUniAor8,55
228
228
  uncountable/types/api/triggers/run_trigger.py,sha256=9m9M8-nlGB_sAU2Qm2lWugp4h4Osqj6QpjNfU8osd1U,901
229
- UncountablePythonSDK-0.0.26.dist-info/METADATA,sha256=4LIsxPuj2u8AZ23XHXjF3L1mQdcVsa_renQYEwZhNJM,1613
230
- UncountablePythonSDK-0.0.26.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
231
- UncountablePythonSDK-0.0.26.dist-info/top_level.txt,sha256=HaMiBnH1wA7SG9-RVHIJPBH3l8X5gee2jUf-77Nz-Dk,41
232
- UncountablePythonSDK-0.0.26.dist-info/RECORD,,
229
+ UncountablePythonSDK-0.0.27.dist-info/METADATA,sha256=yVmNKAUq4GanaGOubm1rLlAzKLIxqJjgU0hFWmbCv_w,1577
230
+ UncountablePythonSDK-0.0.27.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
231
+ UncountablePythonSDK-0.0.27.dist-info/top_level.txt,sha256=HaMiBnH1wA7SG9-RVHIJPBH3l8X5gee2jUf-77Nz-Dk,41
232
+ UncountablePythonSDK-0.0.27.dist-info/RECORD,,
@@ -63,7 +63,7 @@ base_name_map = {
63
63
  def _rewrite_with_notice(
64
64
  file_path: str, file_content: str, *, notice: str = MODIFY_NOTICE
65
65
  ) -> bool:
66
- pattern = re.compile("^\S", re.MULTILINE)
66
+ pattern = re.compile(r"^\S", re.MULTILINE)
67
67
 
68
68
  file_lines = file_content.split("\n")
69
69
  comment_lines = []
@@ -15,7 +15,7 @@ from pkgs.serialization_util.serialization_helpers import JsonValue
15
15
  from uncountable.types.client_base import APIRequest, ClientMethods
16
16
 
17
17
  from .file_upload import FileUpload, FileUploader, UploadedFile
18
- from .types import AuthDetails, AuthDetailsApiKey, AuthDetailsOAuth
18
+ from .types import AuthDetailsAll, AuthDetailsApiKey, AuthDetailsOAuth
19
19
 
20
20
  DT = typing.TypeVar("DT")
21
21
 
@@ -129,7 +129,7 @@ oauth_bearer_token_data_parser = CachedParser(GetOauthBearerTokenData)
129
129
 
130
130
  class Client(ClientMethods):
131
131
  _parser_map: dict[type, CachedParser] = {}
132
- _auth_details: AuthDetails
132
+ _auth_details: AuthDetailsAll
133
133
  _base_url: str
134
134
  _file_uploader: FileUploader
135
135
  _cfg: ClientConfig
@@ -139,7 +139,7 @@ class Client(ClientMethods):
139
139
  self,
140
140
  *,
141
141
  base_url: str,
142
- auth_details: AuthDetails,
142
+ auth_details: AuthDetailsAll,
143
143
  config: ClientConfig | None = None,
144
144
  ):
145
145
  self._auth_details = auth_details
@@ -4,12 +4,12 @@ from dataclasses import dataclass
4
4
  from enum import StrEnum
5
5
  from io import BytesIO
6
6
  from pathlib import Path
7
- from typing import Generator, Literal, Self
7
+ from typing import Generator, Self
8
8
 
9
9
  import aiohttp
10
10
  import aiotus
11
11
 
12
- from .types import AuthDetails
12
+ from .types import AuthDetailsAll, AuthDetailsApiKey
13
13
 
14
14
  _CHUNK_SIZE = 5 * 1024 * 1024 # s3 requires 5MiB minimum
15
15
 
@@ -56,15 +56,18 @@ class UploadFailed(Exception):
56
56
 
57
57
 
58
58
  class FileUploader:
59
- _auth_details: AuthDetails
59
+ _auth_details: AuthDetailsAll
60
60
  _base_url: str
61
61
 
62
- def __init__(self: Self, base_url: str, auth_details: AuthDetails) -> None:
62
+ def __init__(self: Self, base_url: str, auth_details: AuthDetailsAll) -> None:
63
63
  self._base_url = base_url
64
64
  self._auth_details = auth_details
65
65
 
66
66
  async def _upload_file(self: Self, file_upload: FileUpload) -> UploadedFile:
67
67
  creation_url = f"{self._base_url}/api/external/file_upload/files"
68
+ if not isinstance(self._auth_details, AuthDetailsApiKey):
69
+ raise NotImplementedError("Unsupported authentication method.")
70
+
68
71
  auth = aiohttp.BasicAuth(
69
72
  self._auth_details.api_id, self._auth_details.api_secret_key
70
73
  )
uncountable/core/types.py CHANGED
@@ -13,4 +13,5 @@ class AuthDetailsOAuth:
13
13
  scope: str = "unc.rnd"
14
14
 
15
15
 
16
- AuthDetails = AuthDetailsApiKey | AuthDetailsOAuth
16
+ AuthDetails = AuthDetailsApiKey # Legacy Mapping
17
+ AuthDetailsAll = AuthDetailsApiKey | AuthDetailsOAuth