Skip to content

Commit af56b87

Browse files
release: 0.2.1 (#10)
* codegen metadata * feat(types): replace List[str] with SequenceNotStr in params * feat: improve future compat with pydantic v3 * chore(internal): move mypy configurations to `pyproject.toml` file * chore(internal): codegen related update * chore(tests): simplify `get_platform` test `nest_asyncio` is archived and broken on some platforms so it's not worth keeping in our test suite. * feat(api): Allow nullable text schemas * update references to deprecated pydantic V2 * release: 0.2.1 --------- Co-authored-by: stainless-app[bot] <142633134+stainless-app[bot]@users.noreply.github.com> Co-authored-by: Kumar Saunack <kumar@shapley.ai>
1 parent 1bb1038 commit af56b87

28 files changed

+547
-260
lines changed

.release-please-manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
".": "0.2.0"
2+
".": "0.2.1"
33
}

.stats.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 12
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/parallel-web%2Fparallel-sdk-1aeb1c81a84999f2d27ca9e86b041d74b892926bed126dc9b0f3cff4d7b26963.yml
3-
openapi_spec_hash: 6280f6c6fb537f7c9ac5cc33ee2e433d
4-
config_hash: 451edf5a87ae14248aa336ffc08d216f
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/parallel-web%2Fparallel-sdk-ed59cb6466c038703341e4b1eacb013f08b1907b40a6cba7d39ff5396fb432f3.yml
3+
openapi_spec_hash: 9d983b5f712eb8b5531127543291c6e7
4+
config_hash: f9aa4d901581aaf70789dd0bc1b84597

CHANGELOG.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,22 @@
11
# Changelog
22

3+
## 0.2.1 (2025-09-15)
4+
5+
Full Changelog: [v0.2.0...v0.2.1](https://github.com/parallel-web/parallel-sdk-python/compare/v0.2.0...v0.2.1)
6+
7+
### Features
8+
9+
* **api:** Allow nullable text schemas ([dc87604](https://github.com/parallel-web/parallel-sdk-python/commit/dc87604a3c83bf7c30086c4c23c4e689628bc5a7))
10+
* improve future compat with pydantic v3 ([ea49f26](https://github.com/parallel-web/parallel-sdk-python/commit/ea49f26543681aa59de34577cae1fb8a57b077c5))
11+
* **types:** replace List[str] with SequenceNotStr in params ([6155c3f](https://github.com/parallel-web/parallel-sdk-python/commit/6155c3f30b46ce9bd39aaadc3dddf275d555e2ba))
12+
13+
14+
### Chores
15+
16+
* **internal:** codegen related update ([72ec907](https://github.com/parallel-web/parallel-sdk-python/commit/72ec90723bac0b80a9c8e79f7cab985425beedad))
17+
* **internal:** move mypy configurations to `pyproject.toml` file ([e03d641](https://github.com/parallel-web/parallel-sdk-python/commit/e03d64154278ebd8d844751d4d55e275177cf4f1))
18+
* **tests:** simplify `get_platform` test ([9862221](https://github.com/parallel-web/parallel-sdk-python/commit/9862221997402f105c75df206004fc8d6e206ce8))
19+
320
## 0.2.0 (2025-09-01)
421

522
Full Changelog: [v0.1.3...v0.2.0](https://github.com/parallel-web/parallel-sdk-python/compare/v0.1.3...v0.2.0)

mypy.ini

Lines changed: 0 additions & 50 deletions
This file was deleted.

pyproject.toml

Lines changed: 53 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "parallel-web"
3-
version = "0.2.0"
3+
version = "0.2.1"
44
description = "The official Python library for the Parallel API"
55
dynamic = ["readme"]
66
license = "MIT"
@@ -56,7 +56,6 @@ dev-dependencies = [
5656
"dirty-equals>=0.6.0",
5757
"importlib-metadata>=6.7.0",
5858
"rich>=13.7.1",
59-
"nest_asyncio==1.6.0",
6059
"pytest-xdist>=3.6.1",
6160
"griffe>=1",
6261
]
@@ -158,6 +157,58 @@ reportOverlappingOverload = false
158157
reportImportCycles = false
159158
reportPrivateUsage = false
160159

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+
161212
[tool.ruff]
162213
line-length = 120
163214
output-format = "grouped"

requirements-dev.lock

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@ multidict==6.4.4
7878
mypy==1.14.1
7979
mypy-extensions==1.0.0
8080
# via mypy
81-
nest-asyncio==1.6.0
8281
nodeenv==1.8.0
8382
# via pyright
8483
nox==2023.4.22

src/parallel/_base_client.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
ModelBuilderProtocol,
6060
)
6161
from ._utils import is_dict, is_list, asyncify, is_given, lru_cache, is_mapping
62-
from ._compat import PYDANTIC_V2, model_copy, model_dump
62+
from ._compat import PYDANTIC_V1, model_copy, model_dump
6363
from ._models import GenericModel, FinalRequestOptions, validate_type, construct_type
6464
from ._response import (
6565
APIResponse,
@@ -232,7 +232,7 @@ def _set_private_attributes(
232232
model: Type[_T],
233233
options: FinalRequestOptions,
234234
) -> None:
235-
if PYDANTIC_V2 and getattr(self, "__pydantic_private__", None) is None:
235+
if (not PYDANTIC_V1) and getattr(self, "__pydantic_private__", None) is None:
236236
self.__pydantic_private__ = {}
237237

238238
self._model = model
@@ -320,7 +320,7 @@ def _set_private_attributes(
320320
client: AsyncAPIClient,
321321
options: FinalRequestOptions,
322322
) -> None:
323-
if PYDANTIC_V2 and getattr(self, "__pydantic_private__", None) is None:
323+
if (not PYDANTIC_V1) and getattr(self, "__pydantic_private__", None) is None:
324324
self.__pydantic_private__ = {}
325325

326326
self._model = model

0 commit comments

Comments
 (0)