parallel-web 0.2.0__tar.gz → 0.2.2__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.
Potentially problematic release.
This version of parallel-web might be problematic. Click here for more details.
- parallel_web-0.2.2/.release-please-manifest.json +3 -0
- {parallel_web-0.2.0 → parallel_web-0.2.2}/CHANGELOG.md +38 -0
- {parallel_web-0.2.0 → parallel_web-0.2.2}/PKG-INFO +1 -1
- {parallel_web-0.2.0 → parallel_web-0.2.2}/pyproject.toml +57 -2
- {parallel_web-0.2.0 → parallel_web-0.2.2}/requirements-dev.lock +5 -3
- {parallel_web-0.2.0 → parallel_web-0.2.2}/requirements.lock +5 -2
- {parallel_web-0.2.0 → parallel_web-0.2.2}/src/parallel/__init__.py +3 -1
- {parallel_web-0.2.0 → parallel_web-0.2.2}/src/parallel/_base_client.py +12 -12
- {parallel_web-0.2.0 → parallel_web-0.2.2}/src/parallel/_client.py +8 -8
- {parallel_web-0.2.0 → parallel_web-0.2.2}/src/parallel/_compat.py +54 -54
- {parallel_web-0.2.0 → parallel_web-0.2.2}/src/parallel/_models.py +50 -44
- {parallel_web-0.2.0 → parallel_web-0.2.2}/src/parallel/_qs.py +7 -7
- {parallel_web-0.2.0 → parallel_web-0.2.2}/src/parallel/_types.py +18 -11
- {parallel_web-0.2.0 → parallel_web-0.2.2}/src/parallel/_utils/__init__.py +8 -2
- parallel_web-0.2.2/src/parallel/_utils/_compat.py +45 -0
- parallel_web-0.2.2/src/parallel/_utils/_datetime_parse.py +136 -0
- {parallel_web-0.2.0 → parallel_web-0.2.2}/src/parallel/_utils/_transform.py +13 -3
- {parallel_web-0.2.0 → parallel_web-0.2.2}/src/parallel/_utils/_typing.py +1 -1
- {parallel_web-0.2.0 → parallel_web-0.2.2}/src/parallel/_utils/_utils.py +4 -5
- {parallel_web-0.2.0 → parallel_web-0.2.2}/src/parallel/_version.py +1 -1
- {parallel_web-0.2.0 → parallel_web-0.2.2}/src/parallel/lib/_parsing/_task_run_result.py +2 -3
- {parallel_web-0.2.0 → parallel_web-0.2.2}/src/parallel/lib/_parsing/_task_spec.py +4 -4
- {parallel_web-0.2.0 → parallel_web-0.2.2}/src/parallel/lib/_pydantic.py +3 -3
- {parallel_web-0.2.0 → parallel_web-0.2.2}/src/parallel/resources/beta/beta.py +16 -16
- {parallel_web-0.2.0 → parallel_web-0.2.2}/src/parallel/resources/beta/task_group.py +53 -35
- {parallel_web-0.2.0 → parallel_web-0.2.2}/src/parallel/resources/beta/task_run.py +41 -41
- {parallel_web-0.2.0 → parallel_web-0.2.2}/src/parallel/resources/task_run.py +33 -33
- {parallel_web-0.2.0 → parallel_web-0.2.2}/src/parallel/types/beta/beta_run_input.py +6 -6
- {parallel_web-0.2.0 → parallel_web-0.2.2}/src/parallel/types/beta/beta_run_input_param.py +6 -6
- {parallel_web-0.2.0 → parallel_web-0.2.2}/src/parallel/types/beta/beta_search_params.py +3 -2
- {parallel_web-0.2.0 → parallel_web-0.2.2}/src/parallel/types/beta/mcp_server_param.py +4 -2
- {parallel_web-0.2.0 → parallel_web-0.2.2}/src/parallel/types/beta/search_result.py +1 -1
- {parallel_web-0.2.0 → parallel_web-0.2.2}/src/parallel/types/beta/task_run_create_params.py +6 -6
- {parallel_web-0.2.0 → parallel_web-0.2.2}/src/parallel/types/beta/task_run_events_response.py +6 -0
- {parallel_web-0.2.0 → parallel_web-0.2.2}/src/parallel/types/shared_params/source_policy.py +4 -3
- {parallel_web-0.2.0 → parallel_web-0.2.2}/src/parallel/types/text_schema.py +1 -1
- {parallel_web-0.2.0 → parallel_web-0.2.2}/src/parallel/types/text_schema_param.py +3 -2
- {parallel_web-0.2.0 → parallel_web-0.2.2}/tests/test_client.py +6 -47
- {parallel_web-0.2.0 → parallel_web-0.2.2}/tests/test_models.py +24 -24
- {parallel_web-0.2.0 → parallel_web-0.2.2}/tests/test_transform.py +17 -10
- parallel_web-0.2.2/tests/test_utils/test_datetime_parse.py +110 -0
- {parallel_web-0.2.0 → parallel_web-0.2.2}/tests/utils.py +4 -4
- parallel_web-0.2.0/.release-please-manifest.json +0 -3
- parallel_web-0.2.0/mypy.ini +0 -50
- {parallel_web-0.2.0 → parallel_web-0.2.2}/.gitignore +0 -0
- {parallel_web-0.2.0 → parallel_web-0.2.2}/CONTRIBUTING.md +0 -0
- {parallel_web-0.2.0 → parallel_web-0.2.2}/LICENSE +0 -0
- {parallel_web-0.2.0 → parallel_web-0.2.2}/README.md +0 -0
- {parallel_web-0.2.0 → parallel_web-0.2.2}/SECURITY.md +0 -0
- {parallel_web-0.2.0 → parallel_web-0.2.2}/api.md +0 -0
- {parallel_web-0.2.0 → parallel_web-0.2.2}/bin/check-release-environment +0 -0
- {parallel_web-0.2.0 → parallel_web-0.2.2}/bin/publish-pypi +0 -0
- {parallel_web-0.2.0 → parallel_web-0.2.2}/examples/.keep +0 -0
- {parallel_web-0.2.0 → parallel_web-0.2.2}/noxfile.py +0 -0
- {parallel_web-0.2.0 → parallel_web-0.2.2}/release-please-config.json +0 -0
- {parallel_web-0.2.0 → parallel_web-0.2.2}/src/parallel/_constants.py +0 -0
- {parallel_web-0.2.0 → parallel_web-0.2.2}/src/parallel/_exceptions.py +0 -0
- {parallel_web-0.2.0 → parallel_web-0.2.2}/src/parallel/_files.py +0 -0
- {parallel_web-0.2.0 → parallel_web-0.2.2}/src/parallel/_resource.py +0 -0
- {parallel_web-0.2.0 → parallel_web-0.2.2}/src/parallel/_response.py +0 -0
- {parallel_web-0.2.0 → parallel_web-0.2.2}/src/parallel/_streaming.py +0 -0
- {parallel_web-0.2.0 → parallel_web-0.2.2}/src/parallel/_utils/_logs.py +0 -0
- {parallel_web-0.2.0 → parallel_web-0.2.2}/src/parallel/_utils/_proxy.py +0 -0
- {parallel_web-0.2.0 → parallel_web-0.2.2}/src/parallel/_utils/_reflection.py +0 -0
- {parallel_web-0.2.0 → parallel_web-0.2.2}/src/parallel/_utils/_resources_proxy.py +0 -0
- {parallel_web-0.2.0 → parallel_web-0.2.2}/src/parallel/_utils/_streams.py +0 -0
- {parallel_web-0.2.0 → parallel_web-0.2.2}/src/parallel/_utils/_sync.py +0 -0
- {parallel_web-0.2.0 → parallel_web-0.2.2}/src/parallel/lib/.keep +0 -0
- {parallel_web-0.2.0 → parallel_web-0.2.2}/src/parallel/lib/__init__.py +0 -0
- {parallel_web-0.2.0 → parallel_web-0.2.2}/src/parallel/lib/_parsing/__init__.py +0 -0
- {parallel_web-0.2.0 → parallel_web-0.2.2}/src/parallel/lib/_time.py +0 -0
- {parallel_web-0.2.0 → parallel_web-0.2.2}/src/parallel/py.typed +0 -0
- {parallel_web-0.2.0 → parallel_web-0.2.2}/src/parallel/resources/__init__.py +0 -0
- {parallel_web-0.2.0 → parallel_web-0.2.2}/src/parallel/resources/beta/__init__.py +0 -0
- {parallel_web-0.2.0 → parallel_web-0.2.2}/src/parallel/types/__init__.py +0 -0
- {parallel_web-0.2.0 → parallel_web-0.2.2}/src/parallel/types/auto_schema.py +0 -0
- {parallel_web-0.2.0 → parallel_web-0.2.2}/src/parallel/types/auto_schema_param.py +0 -0
- {parallel_web-0.2.0 → parallel_web-0.2.2}/src/parallel/types/beta/__init__.py +0 -0
- {parallel_web-0.2.0 → parallel_web-0.2.2}/src/parallel/types/beta/beta_task_run_result.py +0 -0
- {parallel_web-0.2.0 → parallel_web-0.2.2}/src/parallel/types/beta/error_event.py +0 -0
- {parallel_web-0.2.0 → parallel_web-0.2.2}/src/parallel/types/beta/mcp_server.py +0 -0
- {parallel_web-0.2.0 → parallel_web-0.2.2}/src/parallel/types/beta/mcp_tool_call.py +0 -0
- {parallel_web-0.2.0 → parallel_web-0.2.2}/src/parallel/types/beta/parallel_beta_param.py +0 -0
- {parallel_web-0.2.0 → parallel_web-0.2.2}/src/parallel/types/beta/task_group.py +0 -0
- {parallel_web-0.2.0 → parallel_web-0.2.2}/src/parallel/types/beta/task_group_add_runs_params.py +0 -0
- {parallel_web-0.2.0 → parallel_web-0.2.2}/src/parallel/types/beta/task_group_create_params.py +0 -0
- {parallel_web-0.2.0 → parallel_web-0.2.2}/src/parallel/types/beta/task_group_events_params.py +0 -0
- {parallel_web-0.2.0 → parallel_web-0.2.2}/src/parallel/types/beta/task_group_events_response.py +0 -0
- {parallel_web-0.2.0 → parallel_web-0.2.2}/src/parallel/types/beta/task_group_get_runs_params.py +0 -0
- {parallel_web-0.2.0 → parallel_web-0.2.2}/src/parallel/types/beta/task_group_get_runs_response.py +0 -0
- {parallel_web-0.2.0 → parallel_web-0.2.2}/src/parallel/types/beta/task_group_run_response.py +0 -0
- {parallel_web-0.2.0 → parallel_web-0.2.2}/src/parallel/types/beta/task_group_status.py +0 -0
- {parallel_web-0.2.0 → parallel_web-0.2.2}/src/parallel/types/beta/task_run_event.py +0 -0
- {parallel_web-0.2.0 → parallel_web-0.2.2}/src/parallel/types/beta/task_run_result_params.py +0 -0
- {parallel_web-0.2.0 → parallel_web-0.2.2}/src/parallel/types/beta/web_search_result.py +0 -0
- {parallel_web-0.2.0 → parallel_web-0.2.2}/src/parallel/types/beta/webhook.py +0 -0
- {parallel_web-0.2.0 → parallel_web-0.2.2}/src/parallel/types/beta/webhook_param.py +0 -0
- {parallel_web-0.2.0 → parallel_web-0.2.2}/src/parallel/types/citation.py +0 -0
- {parallel_web-0.2.0 → parallel_web-0.2.2}/src/parallel/types/field_basis.py +0 -0
- {parallel_web-0.2.0 → parallel_web-0.2.2}/src/parallel/types/json_schema.py +0 -0
- {parallel_web-0.2.0 → parallel_web-0.2.2}/src/parallel/types/json_schema_param.py +0 -0
- {parallel_web-0.2.0 → parallel_web-0.2.2}/src/parallel/types/parsed_task_run_result.py +0 -0
- {parallel_web-0.2.0 → parallel_web-0.2.2}/src/parallel/types/shared/__init__.py +0 -0
- {parallel_web-0.2.0 → parallel_web-0.2.2}/src/parallel/types/shared/error_object.py +0 -0
- {parallel_web-0.2.0 → parallel_web-0.2.2}/src/parallel/types/shared/error_response.py +0 -0
- {parallel_web-0.2.0 → parallel_web-0.2.2}/src/parallel/types/shared/source_policy.py +0 -0
- {parallel_web-0.2.0 → parallel_web-0.2.2}/src/parallel/types/shared/warning.py +0 -0
- {parallel_web-0.2.0 → parallel_web-0.2.2}/src/parallel/types/shared_params/__init__.py +0 -0
- {parallel_web-0.2.0 → parallel_web-0.2.2}/src/parallel/types/task_run.py +0 -0
- {parallel_web-0.2.0 → parallel_web-0.2.2}/src/parallel/types/task_run_create_params.py +0 -0
- {parallel_web-0.2.0 → parallel_web-0.2.2}/src/parallel/types/task_run_json_output.py +0 -0
- {parallel_web-0.2.0 → parallel_web-0.2.2}/src/parallel/types/task_run_result.py +0 -0
- {parallel_web-0.2.0 → parallel_web-0.2.2}/src/parallel/types/task_run_result_params.py +0 -0
- {parallel_web-0.2.0 → parallel_web-0.2.2}/src/parallel/types/task_run_text_output.py +0 -0
- {parallel_web-0.2.0 → parallel_web-0.2.2}/src/parallel/types/task_spec.py +0 -0
- {parallel_web-0.2.0 → parallel_web-0.2.2}/src/parallel/types/task_spec_param.py +0 -0
- {parallel_web-0.2.0 → parallel_web-0.2.2}/tests/__init__.py +0 -0
- {parallel_web-0.2.0 → parallel_web-0.2.2}/tests/api_resources/__init__.py +0 -0
- {parallel_web-0.2.0 → parallel_web-0.2.2}/tests/api_resources/beta/__init__.py +0 -0
- {parallel_web-0.2.0 → parallel_web-0.2.2}/tests/api_resources/beta/test_task_group.py +0 -0
- {parallel_web-0.2.0 → parallel_web-0.2.2}/tests/api_resources/beta/test_task_run.py +0 -0
- {parallel_web-0.2.0 → parallel_web-0.2.2}/tests/api_resources/test_beta.py +0 -0
- {parallel_web-0.2.0 → parallel_web-0.2.2}/tests/api_resources/test_task_run.py +0 -0
- {parallel_web-0.2.0 → parallel_web-0.2.2}/tests/conftest.py +0 -0
- {parallel_web-0.2.0 → parallel_web-0.2.2}/tests/sample_file.txt +0 -0
- {parallel_web-0.2.0 → parallel_web-0.2.2}/tests/test_deepcopy.py +0 -0
- {parallel_web-0.2.0 → parallel_web-0.2.2}/tests/test_extract_files.py +0 -0
- {parallel_web-0.2.0 → parallel_web-0.2.2}/tests/test_files.py +0 -0
- {parallel_web-0.2.0 → parallel_web-0.2.2}/tests/test_qs.py +0 -0
- {parallel_web-0.2.0 → parallel_web-0.2.2}/tests/test_required_args.py +0 -0
- {parallel_web-0.2.0 → parallel_web-0.2.2}/tests/test_response.py +0 -0
- {parallel_web-0.2.0 → parallel_web-0.2.2}/tests/test_streaming.py +0 -0
- {parallel_web-0.2.0 → parallel_web-0.2.2}/tests/test_utils/test_proxy.py +0 -0
- {parallel_web-0.2.0 → parallel_web-0.2.2}/tests/test_utils/test_typing.py +0 -0
|
@@ -1,5 +1,43 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.2.2 (2025-10-16)
|
|
4
|
+
|
|
5
|
+
Full Changelog: [v0.2.1...v0.2.2](https://github.com/parallel-web/parallel-sdk-python/compare/v0.2.1...v0.2.2)
|
|
6
|
+
|
|
7
|
+
### Features
|
|
8
|
+
|
|
9
|
+
* **api:** Add progress meter to Task Run events ([176f9d3](https://github.com/parallel-web/parallel-sdk-python/commit/176f9d318d9d9367b61e40fb6f8c27576e75deb4))
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
### Bug Fixes
|
|
13
|
+
|
|
14
|
+
* do not set headers with default to omit ([8989f91](https://github.com/parallel-web/parallel-sdk-python/commit/8989f9120217bba2c95b2b256a2767f885311652))
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Chores
|
|
18
|
+
|
|
19
|
+
* do not install brew dependencies in ./scripts/bootstrap by default ([c3250e2](https://github.com/parallel-web/parallel-sdk-python/commit/c3250e26311cc9b767d06a112317b74f73f78644))
|
|
20
|
+
* **internal:** detect missing future annotations with ruff ([db5980c](https://github.com/parallel-web/parallel-sdk-python/commit/db5980ce6d58ac926eea60d836b36dc8bdd651d7))
|
|
21
|
+
* **internal:** update pydantic dependency ([96f50db](https://github.com/parallel-web/parallel-sdk-python/commit/96f50dbffc919f591a149f89b387ebf19bd4deb0))
|
|
22
|
+
* **types:** change optional parameter type from NotGiven to Omit ([0f0fa20](https://github.com/parallel-web/parallel-sdk-python/commit/0f0fa20994ddb2c89d0def2a16a68b9499e1abd4))
|
|
23
|
+
|
|
24
|
+
## 0.2.1 (2025-09-15)
|
|
25
|
+
|
|
26
|
+
Full Changelog: [v0.2.0...v0.2.1](https://github.com/parallel-web/parallel-sdk-python/compare/v0.2.0...v0.2.1)
|
|
27
|
+
|
|
28
|
+
### Features
|
|
29
|
+
|
|
30
|
+
* **api:** Allow nullable text schemas ([dc87604](https://github.com/parallel-web/parallel-sdk-python/commit/dc87604a3c83bf7c30086c4c23c4e689628bc5a7))
|
|
31
|
+
* improve future compat with pydantic v3 ([ea49f26](https://github.com/parallel-web/parallel-sdk-python/commit/ea49f26543681aa59de34577cae1fb8a57b077c5))
|
|
32
|
+
* **types:** replace List[str] with SequenceNotStr in params ([6155c3f](https://github.com/parallel-web/parallel-sdk-python/commit/6155c3f30b46ce9bd39aaadc3dddf275d555e2ba))
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
### Chores
|
|
36
|
+
|
|
37
|
+
* **internal:** codegen related update ([72ec907](https://github.com/parallel-web/parallel-sdk-python/commit/72ec90723bac0b80a9c8e79f7cab985425beedad))
|
|
38
|
+
* **internal:** move mypy configurations to `pyproject.toml` file ([e03d641](https://github.com/parallel-web/parallel-sdk-python/commit/e03d64154278ebd8d844751d4d55e275177cf4f1))
|
|
39
|
+
* **tests:** simplify `get_platform` test ([9862221](https://github.com/parallel-web/parallel-sdk-python/commit/9862221997402f105c75df206004fc8d6e206ce8))
|
|
40
|
+
|
|
3
41
|
## 0.2.0 (2025-09-01)
|
|
4
42
|
|
|
5
43
|
Full Changelog: [v0.1.3...v0.2.0](https://github.com/parallel-web/parallel-sdk-python/compare/v0.1.3...v0.2.0)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: parallel-web
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.2
|
|
4
4
|
Summary: The official Python library for the Parallel API
|
|
5
5
|
Project-URL: Homepage, https://github.com/parallel-web/parallel-sdk-python
|
|
6
6
|
Project-URL: Repository, https://github.com/parallel-web/parallel-sdk-python
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "parallel-web"
|
|
3
|
-
version = "0.2.
|
|
3
|
+
version = "0.2.2"
|
|
4
4
|
description = "The official Python library for the Parallel API"
|
|
5
5
|
dynamic = ["readme"]
|
|
6
6
|
license = "MIT"
|
|
@@ -56,7 +56,6 @@ dev-dependencies = [
|
|
|
56
56
|
"dirty-equals>=0.6.0",
|
|
57
57
|
"importlib-metadata>=6.7.0",
|
|
58
58
|
"rich>=13.7.1",
|
|
59
|
-
"nest_asyncio==1.6.0",
|
|
60
59
|
"pytest-xdist>=3.6.1",
|
|
61
60
|
"griffe>=1",
|
|
62
61
|
]
|
|
@@ -158,6 +157,58 @@ reportOverlappingOverload = false
|
|
|
158
157
|
reportImportCycles = false
|
|
159
158
|
reportPrivateUsage = false
|
|
160
159
|
|
|
160
|
+
[tool.mypy]
|
|
161
|
+
pretty = true
|
|
162
|
+
show_error_codes = true
|
|
163
|
+
|
|
164
|
+
# Exclude _files.py because mypy isn't smart enough to apply
|
|
165
|
+
# the correct type narrowing and as this is an internal module
|
|
166
|
+
# it's fine to just use Pyright.
|
|
167
|
+
#
|
|
168
|
+
# We also exclude our `tests` as mypy doesn't always infer
|
|
169
|
+
# types correctly and Pyright will still catch any type errors.
|
|
170
|
+
exclude = ['src/parallel/_files.py', '_dev/.*.py', 'tests/.*']
|
|
171
|
+
|
|
172
|
+
strict_equality = true
|
|
173
|
+
implicit_reexport = true
|
|
174
|
+
check_untyped_defs = true
|
|
175
|
+
no_implicit_optional = true
|
|
176
|
+
|
|
177
|
+
warn_return_any = true
|
|
178
|
+
warn_unreachable = true
|
|
179
|
+
warn_unused_configs = true
|
|
180
|
+
|
|
181
|
+
# Turn these options off as it could cause conflicts
|
|
182
|
+
# with the Pyright options.
|
|
183
|
+
warn_unused_ignores = false
|
|
184
|
+
warn_redundant_casts = false
|
|
185
|
+
|
|
186
|
+
disallow_any_generics = true
|
|
187
|
+
disallow_untyped_defs = true
|
|
188
|
+
disallow_untyped_calls = true
|
|
189
|
+
disallow_subclassing_any = true
|
|
190
|
+
disallow_incomplete_defs = true
|
|
191
|
+
disallow_untyped_decorators = true
|
|
192
|
+
cache_fine_grained = true
|
|
193
|
+
|
|
194
|
+
# By default, mypy reports an error if you assign a value to the result
|
|
195
|
+
# of a function call that doesn't return anything. We do this in our test
|
|
196
|
+
# cases:
|
|
197
|
+
# ```
|
|
198
|
+
# result = ...
|
|
199
|
+
# assert result is None
|
|
200
|
+
# ```
|
|
201
|
+
# Changing this codegen to make mypy happy would increase complexity
|
|
202
|
+
# and would not be worth it.
|
|
203
|
+
disable_error_code = "func-returns-value,overload-cannot-match"
|
|
204
|
+
|
|
205
|
+
# https://github.com/python/mypy/issues/12162
|
|
206
|
+
[[tool.mypy.overrides]]
|
|
207
|
+
module = "black.files.*"
|
|
208
|
+
ignore_errors = true
|
|
209
|
+
ignore_missing_imports = true
|
|
210
|
+
|
|
211
|
+
|
|
161
212
|
[tool.ruff]
|
|
162
213
|
line-length = 120
|
|
163
214
|
output-format = "grouped"
|
|
@@ -174,6 +225,8 @@ select = [
|
|
|
174
225
|
"B",
|
|
175
226
|
# remove unused imports
|
|
176
227
|
"F401",
|
|
228
|
+
# check for missing future annotations
|
|
229
|
+
"FA102",
|
|
177
230
|
# bare except statements
|
|
178
231
|
"E722",
|
|
179
232
|
# unused arguments
|
|
@@ -196,6 +249,8 @@ unfixable = [
|
|
|
196
249
|
"T203",
|
|
197
250
|
]
|
|
198
251
|
|
|
252
|
+
extend-safe-fixes = ["FA102"]
|
|
253
|
+
|
|
199
254
|
[tool.ruff.lint.flake8-tidy-imports.banned-api]
|
|
200
255
|
"functools.lru_cache".msg = "This function does not retain type information for the wrapped function's arguments; The `lru_cache` function from `_utils` should be used instead"
|
|
201
256
|
|
|
@@ -78,7 +78,6 @@ multidict==6.4.4
|
|
|
78
78
|
mypy==1.14.1
|
|
79
79
|
mypy-extensions==1.0.0
|
|
80
80
|
# via mypy
|
|
81
|
-
nest-asyncio==1.6.0
|
|
82
81
|
nodeenv==1.8.0
|
|
83
82
|
# via pyright
|
|
84
83
|
nox==2023.4.22
|
|
@@ -92,9 +91,9 @@ pluggy==1.5.0
|
|
|
92
91
|
propcache==0.3.1
|
|
93
92
|
# via aiohttp
|
|
94
93
|
# via yarl
|
|
95
|
-
pydantic==2.
|
|
94
|
+
pydantic==2.11.9
|
|
96
95
|
# via parallel-web
|
|
97
|
-
pydantic-core==2.
|
|
96
|
+
pydantic-core==2.33.2
|
|
98
97
|
# via pydantic
|
|
99
98
|
pygments==2.18.0
|
|
100
99
|
# via rich
|
|
@@ -130,6 +129,9 @@ typing-extensions==4.12.2
|
|
|
130
129
|
# via pydantic
|
|
131
130
|
# via pydantic-core
|
|
132
131
|
# via pyright
|
|
132
|
+
# via typing-inspection
|
|
133
|
+
typing-inspection==0.4.1
|
|
134
|
+
# via pydantic
|
|
133
135
|
virtualenv==20.24.5
|
|
134
136
|
# via nox
|
|
135
137
|
yarl==1.20.0
|
|
@@ -55,9 +55,9 @@ multidict==6.4.4
|
|
|
55
55
|
propcache==0.3.1
|
|
56
56
|
# via aiohttp
|
|
57
57
|
# via yarl
|
|
58
|
-
pydantic==2.
|
|
58
|
+
pydantic==2.11.9
|
|
59
59
|
# via parallel-web
|
|
60
|
-
pydantic-core==2.
|
|
60
|
+
pydantic-core==2.33.2
|
|
61
61
|
# via pydantic
|
|
62
62
|
sniffio==1.3.0
|
|
63
63
|
# via anyio
|
|
@@ -68,5 +68,8 @@ typing-extensions==4.12.2
|
|
|
68
68
|
# via parallel-web
|
|
69
69
|
# via pydantic
|
|
70
70
|
# via pydantic-core
|
|
71
|
+
# via typing-inspection
|
|
72
|
+
typing-inspection==0.4.1
|
|
73
|
+
# via pydantic
|
|
71
74
|
yarl==1.20.0
|
|
72
75
|
# via aiohttp
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import typing as _t
|
|
4
4
|
|
|
5
5
|
from . import types
|
|
6
|
-
from ._types import NOT_GIVEN, Omit, NoneType, NotGiven, Transport, ProxiesTypes
|
|
6
|
+
from ._types import NOT_GIVEN, Omit, NoneType, NotGiven, Transport, ProxiesTypes, omit, not_given
|
|
7
7
|
from ._utils import file_from_path
|
|
8
8
|
from ._client import (
|
|
9
9
|
Client,
|
|
@@ -48,7 +48,9 @@ __all__ = [
|
|
|
48
48
|
"ProxiesTypes",
|
|
49
49
|
"NotGiven",
|
|
50
50
|
"NOT_GIVEN",
|
|
51
|
+
"not_given",
|
|
51
52
|
"Omit",
|
|
53
|
+
"omit",
|
|
52
54
|
"ParallelError",
|
|
53
55
|
"APIError",
|
|
54
56
|
"APIStatusError",
|
|
@@ -42,7 +42,6 @@ from . import _exceptions
|
|
|
42
42
|
from ._qs import Querystring
|
|
43
43
|
from ._files import to_httpx_files, async_to_httpx_files
|
|
44
44
|
from ._types import (
|
|
45
|
-
NOT_GIVEN,
|
|
46
45
|
Body,
|
|
47
46
|
Omit,
|
|
48
47
|
Query,
|
|
@@ -57,9 +56,10 @@ from ._types import (
|
|
|
57
56
|
RequestOptions,
|
|
58
57
|
HttpxRequestFiles,
|
|
59
58
|
ModelBuilderProtocol,
|
|
59
|
+
not_given,
|
|
60
60
|
)
|
|
61
61
|
from ._utils import is_dict, is_list, asyncify, is_given, lru_cache, is_mapping
|
|
62
|
-
from ._compat import
|
|
62
|
+
from ._compat import PYDANTIC_V1, model_copy, model_dump
|
|
63
63
|
from ._models import GenericModel, FinalRequestOptions, validate_type, construct_type
|
|
64
64
|
from ._response import (
|
|
65
65
|
APIResponse,
|
|
@@ -145,9 +145,9 @@ class PageInfo:
|
|
|
145
145
|
def __init__(
|
|
146
146
|
self,
|
|
147
147
|
*,
|
|
148
|
-
url: URL | NotGiven =
|
|
149
|
-
json: Body | NotGiven =
|
|
150
|
-
params: Query | NotGiven =
|
|
148
|
+
url: URL | NotGiven = not_given,
|
|
149
|
+
json: Body | NotGiven = not_given,
|
|
150
|
+
params: Query | NotGiven = not_given,
|
|
151
151
|
) -> None:
|
|
152
152
|
self.url = url
|
|
153
153
|
self.json = json
|
|
@@ -232,7 +232,7 @@ class BaseSyncPage(BasePage[_T], Generic[_T]):
|
|
|
232
232
|
model: Type[_T],
|
|
233
233
|
options: FinalRequestOptions,
|
|
234
234
|
) -> None:
|
|
235
|
-
if
|
|
235
|
+
if (not PYDANTIC_V1) and getattr(self, "__pydantic_private__", None) is None:
|
|
236
236
|
self.__pydantic_private__ = {}
|
|
237
237
|
|
|
238
238
|
self._model = model
|
|
@@ -320,7 +320,7 @@ class BaseAsyncPage(BasePage[_T], Generic[_T]):
|
|
|
320
320
|
client: AsyncAPIClient,
|
|
321
321
|
options: FinalRequestOptions,
|
|
322
322
|
) -> None:
|
|
323
|
-
if
|
|
323
|
+
if (not PYDANTIC_V1) and getattr(self, "__pydantic_private__", None) is None:
|
|
324
324
|
self.__pydantic_private__ = {}
|
|
325
325
|
|
|
326
326
|
self._model = model
|
|
@@ -595,7 +595,7 @@ class BaseClient(Generic[_HttpxClientT, _DefaultStreamT]):
|
|
|
595
595
|
# we internally support defining a temporary header to override the
|
|
596
596
|
# default `cast_to` type for use with `.with_raw_response` and `.with_streaming_response`
|
|
597
597
|
# see _response.py for implementation details
|
|
598
|
-
override_cast_to = headers.pop(OVERRIDE_CAST_TO_HEADER,
|
|
598
|
+
override_cast_to = headers.pop(OVERRIDE_CAST_TO_HEADER, not_given)
|
|
599
599
|
if is_given(override_cast_to):
|
|
600
600
|
options.headers = headers
|
|
601
601
|
return cast(Type[ResponseT], override_cast_to)
|
|
@@ -825,7 +825,7 @@ class SyncAPIClient(BaseClient[httpx.Client, Stream[Any]]):
|
|
|
825
825
|
version: str,
|
|
826
826
|
base_url: str | URL,
|
|
827
827
|
max_retries: int = DEFAULT_MAX_RETRIES,
|
|
828
|
-
timeout: float | Timeout | None | NotGiven =
|
|
828
|
+
timeout: float | Timeout | None | NotGiven = not_given,
|
|
829
829
|
http_client: httpx.Client | None = None,
|
|
830
830
|
custom_headers: Mapping[str, str] | None = None,
|
|
831
831
|
custom_query: Mapping[str, object] | None = None,
|
|
@@ -1356,7 +1356,7 @@ class AsyncAPIClient(BaseClient[httpx.AsyncClient, AsyncStream[Any]]):
|
|
|
1356
1356
|
base_url: str | URL,
|
|
1357
1357
|
_strict_response_validation: bool,
|
|
1358
1358
|
max_retries: int = DEFAULT_MAX_RETRIES,
|
|
1359
|
-
timeout: float | Timeout | None | NotGiven =
|
|
1359
|
+
timeout: float | Timeout | None | NotGiven = not_given,
|
|
1360
1360
|
http_client: httpx.AsyncClient | None = None,
|
|
1361
1361
|
custom_headers: Mapping[str, str] | None = None,
|
|
1362
1362
|
custom_query: Mapping[str, object] | None = None,
|
|
@@ -1818,8 +1818,8 @@ def make_request_options(
|
|
|
1818
1818
|
extra_query: Query | None = None,
|
|
1819
1819
|
extra_body: Body | None = None,
|
|
1820
1820
|
idempotency_key: str | None = None,
|
|
1821
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
|
1822
|
-
post_parser: PostParser | NotGiven =
|
|
1821
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
1822
|
+
post_parser: PostParser | NotGiven = not_given,
|
|
1823
1823
|
) -> RequestOptions:
|
|
1824
1824
|
"""Create a dict of type RequestOptions without keys of NotGiven values."""
|
|
1825
1825
|
options: RequestOptions = {}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
5
|
import os
|
|
6
|
-
from typing import Any,
|
|
6
|
+
from typing import Any, Mapping
|
|
7
7
|
from typing_extensions import Self, override
|
|
8
8
|
|
|
9
9
|
import httpx
|
|
@@ -11,13 +11,13 @@ import httpx
|
|
|
11
11
|
from . import _exceptions
|
|
12
12
|
from ._qs import Querystring
|
|
13
13
|
from ._types import (
|
|
14
|
-
NOT_GIVEN,
|
|
15
14
|
Omit,
|
|
16
15
|
Timeout,
|
|
17
16
|
NotGiven,
|
|
18
17
|
Transport,
|
|
19
18
|
ProxiesTypes,
|
|
20
19
|
RequestOptions,
|
|
20
|
+
not_given,
|
|
21
21
|
)
|
|
22
22
|
from ._utils import is_given, get_async_library
|
|
23
23
|
from ._version import __version__
|
|
@@ -57,7 +57,7 @@ class Parallel(SyncAPIClient):
|
|
|
57
57
|
*,
|
|
58
58
|
api_key: str | None = None,
|
|
59
59
|
base_url: str | httpx.URL | None = None,
|
|
60
|
-
timeout:
|
|
60
|
+
timeout: float | Timeout | None | NotGiven = not_given,
|
|
61
61
|
max_retries: int = DEFAULT_MAX_RETRIES,
|
|
62
62
|
default_headers: Mapping[str, str] | None = None,
|
|
63
63
|
default_query: Mapping[str, object] | None = None,
|
|
@@ -133,9 +133,9 @@ class Parallel(SyncAPIClient):
|
|
|
133
133
|
*,
|
|
134
134
|
api_key: str | None = None,
|
|
135
135
|
base_url: str | httpx.URL | None = None,
|
|
136
|
-
timeout: float | Timeout | None | NotGiven =
|
|
136
|
+
timeout: float | Timeout | None | NotGiven = not_given,
|
|
137
137
|
http_client: httpx.Client | None = None,
|
|
138
|
-
max_retries: int | NotGiven =
|
|
138
|
+
max_retries: int | NotGiven = not_given,
|
|
139
139
|
default_headers: Mapping[str, str] | None = None,
|
|
140
140
|
set_default_headers: Mapping[str, str] | None = None,
|
|
141
141
|
default_query: Mapping[str, object] | None = None,
|
|
@@ -227,7 +227,7 @@ class AsyncParallel(AsyncAPIClient):
|
|
|
227
227
|
*,
|
|
228
228
|
api_key: str | None = None,
|
|
229
229
|
base_url: str | httpx.URL | None = None,
|
|
230
|
-
timeout:
|
|
230
|
+
timeout: float | Timeout | None | NotGiven = not_given,
|
|
231
231
|
max_retries: int = DEFAULT_MAX_RETRIES,
|
|
232
232
|
default_headers: Mapping[str, str] | None = None,
|
|
233
233
|
default_query: Mapping[str, object] | None = None,
|
|
@@ -303,9 +303,9 @@ class AsyncParallel(AsyncAPIClient):
|
|
|
303
303
|
*,
|
|
304
304
|
api_key: str | None = None,
|
|
305
305
|
base_url: str | httpx.URL | None = None,
|
|
306
|
-
timeout: float | Timeout | None | NotGiven =
|
|
306
|
+
timeout: float | Timeout | None | NotGiven = not_given,
|
|
307
307
|
http_client: httpx.AsyncClient | None = None,
|
|
308
|
-
max_retries: int | NotGiven =
|
|
308
|
+
max_retries: int | NotGiven = not_given,
|
|
309
309
|
default_headers: Mapping[str, str] | None = None,
|
|
310
310
|
set_default_headers: Mapping[str, str] | None = None,
|
|
311
311
|
default_query: Mapping[str, object] | None = None,
|
|
@@ -12,14 +12,13 @@ from ._types import IncEx, StrBytesIntFloat
|
|
|
12
12
|
_T = TypeVar("_T")
|
|
13
13
|
_ModelT = TypeVar("_ModelT", bound=pydantic.BaseModel)
|
|
14
14
|
|
|
15
|
-
# --------------- Pydantic v2 compatibility ---------------
|
|
15
|
+
# --------------- Pydantic v2, v3 compatibility ---------------
|
|
16
16
|
|
|
17
17
|
# Pyright incorrectly reports some of our functions as overriding a method when they don't
|
|
18
18
|
# pyright: reportIncompatibleMethodOverride=false
|
|
19
19
|
|
|
20
|
-
|
|
20
|
+
PYDANTIC_V1 = pydantic.VERSION.startswith("1.")
|
|
21
21
|
|
|
22
|
-
# v1 re-exports
|
|
23
22
|
if TYPE_CHECKING:
|
|
24
23
|
|
|
25
24
|
def parse_date(value: date | StrBytesIntFloat) -> date: # noqa: ARG001
|
|
@@ -44,90 +43,92 @@ if TYPE_CHECKING:
|
|
|
44
43
|
...
|
|
45
44
|
|
|
46
45
|
else:
|
|
47
|
-
|
|
48
|
-
|
|
46
|
+
# v1 re-exports
|
|
47
|
+
if PYDANTIC_V1:
|
|
48
|
+
from pydantic.typing import (
|
|
49
49
|
get_args as get_args,
|
|
50
50
|
is_union as is_union,
|
|
51
51
|
get_origin as get_origin,
|
|
52
52
|
is_typeddict as is_typeddict,
|
|
53
53
|
is_literal_type as is_literal_type,
|
|
54
54
|
)
|
|
55
|
-
from pydantic.
|
|
55
|
+
from pydantic.datetime_parse import parse_date as parse_date, parse_datetime as parse_datetime
|
|
56
56
|
else:
|
|
57
|
-
from
|
|
57
|
+
from ._utils import (
|
|
58
58
|
get_args as get_args,
|
|
59
59
|
is_union as is_union,
|
|
60
60
|
get_origin as get_origin,
|
|
61
|
+
parse_date as parse_date,
|
|
61
62
|
is_typeddict as is_typeddict,
|
|
63
|
+
parse_datetime as parse_datetime,
|
|
62
64
|
is_literal_type as is_literal_type,
|
|
63
65
|
)
|
|
64
|
-
from pydantic.datetime_parse import parse_date as parse_date, parse_datetime as parse_datetime
|
|
65
66
|
|
|
66
67
|
|
|
67
68
|
# refactored config
|
|
68
69
|
if TYPE_CHECKING:
|
|
69
70
|
from pydantic import ConfigDict as ConfigDict
|
|
70
71
|
else:
|
|
71
|
-
if
|
|
72
|
-
from pydantic import ConfigDict
|
|
73
|
-
else:
|
|
72
|
+
if PYDANTIC_V1:
|
|
74
73
|
# TODO: provide an error message here?
|
|
75
74
|
ConfigDict = None
|
|
75
|
+
else:
|
|
76
|
+
from pydantic import ConfigDict as ConfigDict
|
|
76
77
|
|
|
77
78
|
|
|
78
79
|
# renamed methods / properties
|
|
79
80
|
def parse_obj(model: type[_ModelT], value: object) -> _ModelT:
|
|
80
|
-
if
|
|
81
|
-
return model.model_validate(value)
|
|
82
|
-
else:
|
|
81
|
+
if PYDANTIC_V1:
|
|
83
82
|
return cast(_ModelT, model.parse_obj(value)) # pyright: ignore[reportDeprecated, reportUnnecessaryCast]
|
|
83
|
+
else:
|
|
84
|
+
return model.model_validate(value)
|
|
84
85
|
|
|
85
86
|
|
|
86
87
|
def field_is_required(field: FieldInfo) -> bool:
|
|
87
|
-
if
|
|
88
|
-
return field.
|
|
89
|
-
return field.
|
|
88
|
+
if PYDANTIC_V1:
|
|
89
|
+
return field.required # type: ignore
|
|
90
|
+
return field.is_required()
|
|
90
91
|
|
|
91
92
|
|
|
92
93
|
def field_get_default(field: FieldInfo) -> Any:
|
|
93
94
|
value = field.get_default()
|
|
94
|
-
if
|
|
95
|
-
from pydantic_core import PydanticUndefined
|
|
96
|
-
|
|
97
|
-
if value == PydanticUndefined:
|
|
98
|
-
return None
|
|
95
|
+
if PYDANTIC_V1:
|
|
99
96
|
return value
|
|
97
|
+
from pydantic_core import PydanticUndefined
|
|
98
|
+
|
|
99
|
+
if value == PydanticUndefined:
|
|
100
|
+
return None
|
|
100
101
|
return value
|
|
101
102
|
|
|
102
103
|
|
|
103
104
|
def field_outer_type(field: FieldInfo) -> Any:
|
|
104
|
-
if
|
|
105
|
-
return field.
|
|
106
|
-
return field.
|
|
105
|
+
if PYDANTIC_V1:
|
|
106
|
+
return field.outer_type_ # type: ignore
|
|
107
|
+
return field.annotation
|
|
107
108
|
|
|
108
109
|
|
|
109
110
|
def get_model_config(model: type[pydantic.BaseModel]) -> Any:
|
|
110
|
-
if
|
|
111
|
-
return model.
|
|
112
|
-
return model.
|
|
111
|
+
if PYDANTIC_V1:
|
|
112
|
+
return model.__config__ # type: ignore
|
|
113
|
+
return model.model_config
|
|
113
114
|
|
|
114
115
|
|
|
115
116
|
def get_model_fields(model: type[pydantic.BaseModel]) -> dict[str, FieldInfo]:
|
|
116
|
-
if
|
|
117
|
-
return model.
|
|
118
|
-
return model.
|
|
117
|
+
if PYDANTIC_V1:
|
|
118
|
+
return model.__fields__ # type: ignore
|
|
119
|
+
return model.model_fields
|
|
119
120
|
|
|
120
121
|
|
|
121
122
|
def model_copy(model: _ModelT, *, deep: bool = False) -> _ModelT:
|
|
122
|
-
if
|
|
123
|
-
return model.
|
|
124
|
-
return model.
|
|
123
|
+
if PYDANTIC_V1:
|
|
124
|
+
return model.copy(deep=deep) # type: ignore
|
|
125
|
+
return model.model_copy(deep=deep)
|
|
125
126
|
|
|
126
127
|
|
|
127
128
|
def model_json(model: pydantic.BaseModel, *, indent: int | None = None) -> str:
|
|
128
|
-
if
|
|
129
|
-
return model.
|
|
130
|
-
return model.
|
|
129
|
+
if PYDANTIC_V1:
|
|
130
|
+
return model.json(indent=indent) # type: ignore
|
|
131
|
+
return model.model_dump_json(indent=indent)
|
|
131
132
|
|
|
132
133
|
|
|
133
134
|
def model_dump(
|
|
@@ -139,14 +140,14 @@ def model_dump(
|
|
|
139
140
|
warnings: bool = True,
|
|
140
141
|
mode: Literal["json", "python"] = "python",
|
|
141
142
|
) -> dict[str, Any]:
|
|
142
|
-
if
|
|
143
|
+
if (not PYDANTIC_V1) or hasattr(model, "model_dump"):
|
|
143
144
|
return model.model_dump(
|
|
144
145
|
mode=mode,
|
|
145
146
|
exclude=exclude,
|
|
146
147
|
exclude_unset=exclude_unset,
|
|
147
148
|
exclude_defaults=exclude_defaults,
|
|
148
149
|
# warnings are not supported in Pydantic v1
|
|
149
|
-
warnings=
|
|
150
|
+
warnings=True if PYDANTIC_V1 else warnings,
|
|
150
151
|
)
|
|
151
152
|
return cast(
|
|
152
153
|
"dict[str, Any]",
|
|
@@ -159,21 +160,21 @@ def model_dump(
|
|
|
159
160
|
|
|
160
161
|
|
|
161
162
|
def model_parse(model: type[_ModelT], data: Any) -> _ModelT:
|
|
162
|
-
if
|
|
163
|
-
return model.
|
|
164
|
-
return model.
|
|
163
|
+
if PYDANTIC_V1:
|
|
164
|
+
return model.parse_obj(data) # pyright: ignore[reportDeprecated]
|
|
165
|
+
return model.model_validate(data)
|
|
165
166
|
|
|
166
167
|
|
|
167
168
|
def model_parse_json(model: type[_ModelT], data: str | bytes) -> _ModelT:
|
|
168
|
-
if
|
|
169
|
-
return model.
|
|
170
|
-
return model.
|
|
169
|
+
if PYDANTIC_V1:
|
|
170
|
+
return model.parse_raw(data) # pyright: ignore[reportDeprecated]
|
|
171
|
+
return model.model_validate_json(data)
|
|
171
172
|
|
|
172
173
|
|
|
173
174
|
def model_json_schema(model: type[_ModelT]) -> dict[str, Any]:
|
|
174
|
-
if
|
|
175
|
-
return model.
|
|
176
|
-
return model.
|
|
175
|
+
if PYDANTIC_V1:
|
|
176
|
+
return model.schema() # pyright: ignore[reportDeprecated]
|
|
177
|
+
return model.model_json_schema()
|
|
177
178
|
|
|
178
179
|
|
|
179
180
|
# generic models
|
|
@@ -182,17 +183,16 @@ if TYPE_CHECKING:
|
|
|
182
183
|
class GenericModel(pydantic.BaseModel): ...
|
|
183
184
|
|
|
184
185
|
else:
|
|
185
|
-
if
|
|
186
|
+
if PYDANTIC_V1:
|
|
187
|
+
import pydantic.generics
|
|
188
|
+
|
|
189
|
+
class GenericModel(pydantic.generics.GenericModel, pydantic.BaseModel): ...
|
|
190
|
+
else:
|
|
186
191
|
# there no longer needs to be a distinction in v2 but
|
|
187
192
|
# we still have to create our own subclass to avoid
|
|
188
193
|
# inconsistent MRO ordering errors
|
|
189
194
|
class GenericModel(pydantic.BaseModel): ...
|
|
190
195
|
|
|
191
|
-
else:
|
|
192
|
-
import pydantic.generics
|
|
193
|
-
|
|
194
|
-
class GenericModel(pydantic.generics.GenericModel, pydantic.BaseModel): ...
|
|
195
|
-
|
|
196
196
|
|
|
197
197
|
# cached properties
|
|
198
198
|
if TYPE_CHECKING:
|