Skip to content

Commit 807295d

Browse files
release: 0.1.0-alpha.9 (#12)
* chore: update github action * chore(internal): change ci workflow machines * fix: avoid newer type syntax * chore(internal): update pyright exclude list * chore(internal): add Sequence related utils * 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(internal): update pydantic dependency * chore(types): change optional parameter type from NotGiven to Omit * chore: do not install brew dependencies in ./scripts/bootstrap by default * feat(runner): add conversation history access and instructions parameter (#15) * feat(runner): add conversation history access and instructions parameter * chore(project): offload python-dotenv for now * fix(policy): use dict instead of Dict at runtime * release: 0.1.0-alpha.9 --------- Co-authored-by: stainless-app[bot] <142633134+stainless-app[bot]@users.noreply.github.com> Co-authored-by: Windsor Nguyễn <win@dedaluslabs.ai>
1 parent 2d1626c commit 807295d

39 files changed

Lines changed: 1356 additions & 835 deletions

.github/workflows/ci.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,13 @@ jobs:
3636
run: ./scripts/lint
3737

3838
build:
39-
if: github.repository == 'stainless-sdks/dedalus-sdk-python' && (github.event_name == 'push' || github.event.pull_request.head.repo.fork)
39+
if: github.event_name == 'push' || github.event.pull_request.head.repo.fork
4040
timeout-minutes: 10
4141
name: build
4242
permissions:
4343
contents: read
4444
id-token: write
45-
runs-on: depot-ubuntu-24.04
45+
runs-on: ${{ github.repository == 'stainless-sdks/dedalus-sdk-python' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
4646
steps:
4747
- uses: actions/checkout@v4
4848

@@ -61,12 +61,14 @@ jobs:
6161
run: rye build
6262

6363
- name: Get GitHub OIDC Token
64+
if: github.repository == 'stainless-sdks/dedalus-sdk-python'
6465
id: github-oidc
6566
uses: actions/github-script@v6
6667
with:
6768
script: core.setOutput('github_token', await core.getIDToken());
6869

6970
- name: Upload tarball
71+
if: github.repository == 'stainless-sdks/dedalus-sdk-python'
7072
env:
7173
URL: https://pkg.stainless.com/s
7274
AUTH: ${{ steps.github-oidc.outputs.github_token }}

.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.1.0-alpha.8"
2+
".": "0.1.0-alpha.9"
33
}

CHANGELOG.md

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

3+
## 0.1.0-alpha.9 (2025-09-20)
4+
5+
Full Changelog: [v0.1.0-alpha.8...v0.1.0-alpha.9](https://github.com/dedalus-labs/dedalus-sdk-python/compare/v0.1.0-alpha.8...v0.1.0-alpha.9)
6+
7+
### Features
8+
9+
* improve future compat with pydantic v3 ([a8fac0e](https://github.com/dedalus-labs/dedalus-sdk-python/commit/a8fac0ef8327430609f8bb15db096afecb3883ae))
10+
* **runner:** add conversation history access and instructions parameter ([#15](https://github.com/dedalus-labs/dedalus-sdk-python/issues/15)) ([80d431d](https://github.com/dedalus-labs/dedalus-sdk-python/commit/80d431d07a85d374c9f974e786395596f1ba87a7))
11+
* **types:** replace List[str] with SequenceNotStr in params ([470ee70](https://github.com/dedalus-labs/dedalus-sdk-python/commit/470ee7096075ac6298514ef751a8a6a6e296d0ab))
12+
13+
14+
### Bug Fixes
15+
16+
* avoid newer type syntax ([4c2f6a5](https://github.com/dedalus-labs/dedalus-sdk-python/commit/4c2f6a5fb9de912f51eaceb129404ba2a7de57fc))
17+
18+
19+
### Chores
20+
21+
* do not install brew dependencies in ./scripts/bootstrap by default ([b7e06d3](https://github.com/dedalus-labs/dedalus-sdk-python/commit/b7e06d307e626ae5d41189de50697f41c8bebfac))
22+
* **internal:** add Sequence related utils ([9745025](https://github.com/dedalus-labs/dedalus-sdk-python/commit/9745025a9810eebc01de9591d37a099a04184b84))
23+
* **internal:** change ci workflow machines ([733b93d](https://github.com/dedalus-labs/dedalus-sdk-python/commit/733b93d423e6ef1b4a33ae887ca472255afe4963))
24+
* **internal:** codegen related update ([3c37562](https://github.com/dedalus-labs/dedalus-sdk-python/commit/3c37562c59321946e9750170fcef203a9fe15266))
25+
* **internal:** move mypy configurations to `pyproject.toml` file ([ec3d564](https://github.com/dedalus-labs/dedalus-sdk-python/commit/ec3d56422bea912fafe9c43403dde7028fa97f75))
26+
* **internal:** update pydantic dependency ([70ab0cd](https://github.com/dedalus-labs/dedalus-sdk-python/commit/70ab0cdb89b9829a1203cb922dcc7f11474c2cd4))
27+
* **internal:** update pyright exclude list ([72ed0a3](https://github.com/dedalus-labs/dedalus-sdk-python/commit/72ed0a3bf91d86d18dddd90b3e95967cd3443f85))
28+
* **types:** change optional parameter type from NotGiven to Omit ([dc43898](https://github.com/dedalus-labs/dedalus-sdk-python/commit/dc438989d20a3501a99401ffc1f182b8d67672e5))
29+
* update github action ([cb4fefd](https://github.com/dedalus-labs/dedalus-sdk-python/commit/cb4fefd026cd176f56d3b5b12cdaffd2d7ddbdc6))
30+
331
## 0.1.0-alpha.8 (2025-08-21)
432

533
Full Changelog: [v0.1.0-alpha.7...v0.1.0-alpha.8](https://github.com/dedalus-labs/dedalus-sdk-python/compare/v0.1.0-alpha.7...v0.1.0-alpha.8)

mypy.ini

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

pyproject.toml

Lines changed: 54 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "dedalus_labs"
3-
version = "0.1.0-alpha.8"
3+
version = "0.1.0-alpha.9"
44
description = "The official Python library for the Dedalus 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
]
6261

@@ -148,6 +147,7 @@ exclude = [
148147
"_dev",
149148
".venv",
150149
".nox",
150+
".git",
151151
]
152152

153153
reportImplicitOverride = true
@@ -156,6 +156,58 @@ reportOverlappingOverload = false
156156
reportImportCycles = false
157157
reportPrivateUsage = false
158158

159+
[tool.mypy]
160+
pretty = true
161+
show_error_codes = true
162+
163+
# Exclude _files.py because mypy isn't smart enough to apply
164+
# the correct type narrowing and as this is an internal module
165+
# it's fine to just use Pyright.
166+
#
167+
# We also exclude our `tests` as mypy doesn't always infer
168+
# types correctly and Pyright will still catch any type errors.
169+
exclude = ['src/dedalus_labs/_files.py', '_dev/.*.py', 'tests/.*']
170+
171+
strict_equality = true
172+
implicit_reexport = true
173+
check_untyped_defs = true
174+
no_implicit_optional = true
175+
176+
warn_return_any = true
177+
warn_unreachable = true
178+
warn_unused_configs = true
179+
180+
# Turn these options off as it could cause conflicts
181+
# with the Pyright options.
182+
warn_unused_ignores = false
183+
warn_redundant_casts = false
184+
185+
disallow_any_generics = true
186+
disallow_untyped_defs = true
187+
disallow_untyped_calls = true
188+
disallow_subclassing_any = true
189+
disallow_incomplete_defs = true
190+
disallow_untyped_decorators = true
191+
cache_fine_grained = true
192+
193+
# By default, mypy reports an error if you assign a value to the result
194+
# of a function call that doesn't return anything. We do this in our test
195+
# cases:
196+
# ```
197+
# result = ...
198+
# assert result is None
199+
# ```
200+
# Changing this codegen to make mypy happy would increase complexity
201+
# and would not be worth it.
202+
disable_error_code = "func-returns-value,overload-cannot-match"
203+
204+
# https://github.com/python/mypy/issues/12162
205+
[[tool.mypy.overrides]]
206+
module = "black.files.*"
207+
ignore_errors = true
208+
ignore_missing_imports = true
209+
210+
159211
[tool.ruff]
160212
line-length = 120
161213
output-format = "grouped"

requirements-dev.lock

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,6 @@ multidict==6.4.4
7575
mypy==1.14.1
7676
mypy-extensions==1.0.0
7777
# via mypy
78-
nest-asyncio==1.6.0
7978
nodeenv==1.8.0
8079
# via pyright
8180
nox==2023.4.22
@@ -89,9 +88,9 @@ pluggy==1.5.0
8988
propcache==0.3.1
9089
# via aiohttp
9190
# via yarl
92-
pydantic==2.10.3
91+
pydantic==2.11.9
9392
# via dedalus-labs
94-
pydantic-core==2.27.1
93+
pydantic-core==2.33.2
9594
# via pydantic
9695
pygments==2.18.0
9796
# via rich
@@ -127,6 +126,9 @@ typing-extensions==4.12.2
127126
# via pydantic
128127
# via pydantic-core
129128
# via pyright
129+
# via typing-inspection
130+
typing-inspection==0.4.1
131+
# via pydantic
130132
virtualenv==20.24.5
131133
# via nox
132134
yarl==1.20.0

requirements.lock

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,9 @@ multidict==6.4.4
5555
propcache==0.3.1
5656
# via aiohttp
5757
# via yarl
58-
pydantic==2.10.3
58+
pydantic==2.11.9
5959
# via dedalus-labs
60-
pydantic-core==2.27.1
60+
pydantic-core==2.33.2
6161
# via pydantic
6262
sniffio==1.3.0
6363
# via anyio
@@ -68,5 +68,8 @@ typing-extensions==4.12.2
6868
# via multidict
6969
# via pydantic
7070
# via pydantic-core
71+
# via typing-inspection
72+
typing-inspection==0.4.1
73+
# via pydantic
7174
yarl==1.20.0
7275
# via aiohttp

scripts/bootstrap

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,18 @@ set -e
44

55
cd "$(dirname "$0")/.."
66

7-
if ! command -v rye >/dev/null 2>&1 && [ -f "Brewfile" ] && [ "$(uname -s)" = "Darwin" ]; then
7+
if [ -f "Brewfile" ] && [ "$(uname -s)" = "Darwin" ] && [ "$SKIP_BREW" != "1" ] && [ -t 0 ]; then
88
brew bundle check >/dev/null 2>&1 || {
9-
echo "==> Installing Homebrew dependencies…"
10-
brew bundle
9+
echo -n "==> Install Homebrew dependencies? (y/N): "
10+
read -r response
11+
case "$response" in
12+
[yY][eE][sS]|[yY])
13+
brew bundle
14+
;;
15+
*)
16+
;;
17+
esac
18+
echo
1119
}
1220
fi
1321

src/dedalus_labs/__init__.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import typing as _t
44

55
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
77
from ._utils import file_from_path
88
from ._client import (
99
ENVIRONMENTS,
@@ -52,7 +52,9 @@
5252
"ProxiesTypes",
5353
"NotGiven",
5454
"NOT_GIVEN",
55+
"not_given",
5556
"Omit",
57+
"omit",
5658
"DedalusError",
5759
"APIError",
5860
"APIStatusError",

src/dedalus_labs/_base_client.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@
4242
from ._qs import Querystring
4343
from ._files import to_httpx_files, async_to_httpx_files
4444
from ._types import (
45-
NOT_GIVEN,
4645
Body,
4746
Omit,
4847
Query,
@@ -57,9 +56,10 @@
5756
RequestOptions,
5857
HttpxRequestFiles,
5958
ModelBuilderProtocol,
59+
not_given,
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,
@@ -145,9 +145,9 @@ def __init__(
145145
def __init__(
146146
self,
147147
*,
148-
url: URL | NotGiven = NOT_GIVEN,
149-
json: Body | NotGiven = NOT_GIVEN,
150-
params: Query | NotGiven = NOT_GIVEN,
148+
url: URL | NotGiven = not_given,
149+
json: Body | NotGiven = not_given,
150+
params: Query | NotGiven = not_given,
151151
) -> None:
152152
self.url = url
153153
self.json = json
@@ -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
@@ -595,7 +595,7 @@ def _maybe_override_cast_to(self, cast_to: type[ResponseT], options: FinalReques
595595
# we internally support defining a temporary header to override the
596596
# default `cast_to` type for use with `.with_raw_response` and `.with_streaming_response`
597597
# see _response.py for implementation details
598-
override_cast_to = headers.pop(OVERRIDE_CAST_TO_HEADER, NOT_GIVEN)
598+
override_cast_to = headers.pop(OVERRIDE_CAST_TO_HEADER, not_given)
599599
if is_given(override_cast_to):
600600
options.headers = headers
601601
return cast(Type[ResponseT], override_cast_to)
@@ -825,7 +825,7 @@ def __init__(
825825
version: str,
826826
base_url: str | URL,
827827
max_retries: int = DEFAULT_MAX_RETRIES,
828-
timeout: float | Timeout | None | NotGiven = NOT_GIVEN,
828+
timeout: float | Timeout | None | NotGiven = not_given,
829829
http_client: httpx.Client | None = None,
830830
custom_headers: Mapping[str, str] | None = None,
831831
custom_query: Mapping[str, object] | None = None,
@@ -1356,7 +1356,7 @@ def __init__(
13561356
base_url: str | URL,
13571357
_strict_response_validation: bool,
13581358
max_retries: int = DEFAULT_MAX_RETRIES,
1359-
timeout: float | Timeout | None | NotGiven = NOT_GIVEN,
1359+
timeout: float | Timeout | None | NotGiven = not_given,
13601360
http_client: httpx.AsyncClient | None = None,
13611361
custom_headers: Mapping[str, str] | None = None,
13621362
custom_query: Mapping[str, object] | None = None,
@@ -1818,8 +1818,8 @@ def make_request_options(
18181818
extra_query: Query | None = None,
18191819
extra_body: Body | None = None,
18201820
idempotency_key: str | None = None,
1821-
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
1822-
post_parser: PostParser | NotGiven = NOT_GIVEN,
1821+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
1822+
post_parser: PostParser | NotGiven = not_given,
18231823
) -> RequestOptions:
18241824
"""Create a dict of type RequestOptions without keys of NotGiven values."""
18251825
options: RequestOptions = {}

0 commit comments

Comments
 (0)