Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "0.19.2"
".": "0.19.3"
}
4 changes: 2 additions & 2 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 5
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/isaacus%2Fisaacus-8cedb48141daf72e4c1a8b29dad13fb1025dd5edad384296be4bd28277b8d7cc.yml
openapi_spec_hash: 306db110474ab42cf13c1ce7cf178cb3
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/isaacus%2Fisaacus-baf5ebdd05d1b5192759a356c2701131c47cfb5b7239a49fcb94e68d4210648c.yml
openapi_spec_hash: 6ea786d56726e18156adf57915fcbe5f
config_hash: 9040e7359f066240ad536041fb2c5185
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
# Changelog

## 0.19.3 (2026-03-03)

Full Changelog: [v0.19.2...v0.19.3](https://github.com/isaacus-dev/isaacus-python/compare/v0.19.2...v0.19.3)

### Chores

* **internal:** add request options to SSE classes ([c17f87b](https://github.com/isaacus-dev/isaacus-python/commit/c17f87bb554fb2f897d8aff7d871ba4710f144dd))
* **internal:** make `test_proxy_environment_variables` more resilient ([6f2864d](https://github.com/isaacus-dev/isaacus-python/commit/6f2864d438b493b7fa5e78c7f3aac1066ac2b19c))
* **internal:** make `test_proxy_environment_variables` more resilient to env ([6af2338](https://github.com/isaacus-dev/isaacus-python/commit/6af233851808d5c3995063047a369588a7b7749c))
* **internal:** remove mock server code ([e586a7f](https://github.com/isaacus-dev/isaacus-python/commit/e586a7f29f0fb1ed92f593da9a3fd6086b074004))
* update mock server docs ([4bd2467](https://github.com/isaacus-dev/isaacus-python/commit/4bd2467c4ba212c2661dc4b0fab8a17fbea7a431))

## 0.19.2 (2026-02-18)

Full Changelog: [v0.19.1...v0.19.2](https://github.com/isaacus-dev/isaacus-python/compare/v0.19.1...v0.19.2)
Expand Down
7 changes: 0 additions & 7 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,13 +85,6 @@ $ pip install ./path-to-wheel-file.whl

## Running tests

Most tests require you to [set up a mock server](https://github.com/stoplightio/prism) against the OpenAPI spec to run the tests.

```sh
# you will need npm installed
$ npx prism mock path/to/your/openapi.yml
```

```sh
$ ./scripts/test
```
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "isaacus"
version = "0.19.2"
version = "0.19.3"
description = "The official Python library for the isaacus API"
dynamic = ["readme"]
license = "Apache-2.0"
Expand Down
41 changes: 0 additions & 41 deletions scripts/mock

This file was deleted.

46 changes: 0 additions & 46 deletions scripts/test
Original file line number Diff line number Diff line change
Expand Up @@ -4,53 +4,7 @@ set -e

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

RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[0;33m'
NC='\033[0m' # No Color

function prism_is_running() {
curl --silent "http://localhost:4010" >/dev/null 2>&1
}

kill_server_on_port() {
pids=$(lsof -t -i tcp:"$1" || echo "")
if [ "$pids" != "" ]; then
kill "$pids"
echo "Stopped $pids."
fi
}

function is_overriding_api_base_url() {
[ -n "$TEST_API_BASE_URL" ]
}

if ! is_overriding_api_base_url && ! prism_is_running ; then
# When we exit this script, make sure to kill the background mock server process
trap 'kill_server_on_port 4010' EXIT

# Start the dev server
./scripts/mock --daemon
fi

if is_overriding_api_base_url ; then
echo -e "${GREEN}✔ Running tests against ${TEST_API_BASE_URL}${NC}"
echo
elif ! prism_is_running ; then
echo -e "${RED}ERROR:${NC} The test suite will not run without a mock Prism server"
echo -e "running against your OpenAPI spec."
echo
echo -e "To run the server, pass in the path or url of your OpenAPI"
echo -e "spec to the prism command:"
echo
echo -e " \$ ${YELLOW}npm exec --package=@stainless-api/prism-cli@5.15.0 -- prism mock path/to/your.openapi.yml${NC}"
echo

exit 1
else
echo -e "${GREEN}✔ Mock prism server is running with your OpenAPI spec${NC}"
echo
fi

export DEFER_PYDANTIC_BUILD=false

Expand Down
3 changes: 3 additions & 0 deletions src/isaacus/_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ def _parse(self, *, to: type[_T] | None = None) -> R | _T:
),
response=self.http_response,
client=cast(Any, self._client),
options=self._options,
),
)

Expand All @@ -162,6 +163,7 @@ def _parse(self, *, to: type[_T] | None = None) -> R | _T:
cast_to=extract_stream_chunk_type(self._stream_cls),
response=self.http_response,
client=cast(Any, self._client),
options=self._options,
),
)

Expand All @@ -175,6 +177,7 @@ def _parse(self, *, to: type[_T] | None = None) -> R | _T:
cast_to=cast_to,
response=self.http_response,
client=cast(Any, self._client),
options=self._options,
),
)

Expand Down
11 changes: 8 additions & 3 deletions src/isaacus/_streaming.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import json
import inspect
from types import TracebackType
from typing import TYPE_CHECKING, Any, Generic, TypeVar, Iterator, AsyncIterator, cast
from typing import TYPE_CHECKING, Any, Generic, TypeVar, Iterator, Optional, AsyncIterator, cast
from typing_extensions import Self, Protocol, TypeGuard, override, get_origin, runtime_checkable

import httpx
Expand All @@ -13,6 +13,7 @@

if TYPE_CHECKING:
from ._client import Isaacus, AsyncIsaacus
from ._models import FinalRequestOptions


_T = TypeVar("_T")
Expand All @@ -22,7 +23,7 @@ class Stream(Generic[_T]):
"""Provides the core interface to iterate over a synchronous stream response."""

response: httpx.Response

_options: Optional[FinalRequestOptions] = None
_decoder: SSEBytesDecoder

def __init__(
Expand All @@ -31,10 +32,12 @@ def __init__(
cast_to: type[_T],
response: httpx.Response,
client: Isaacus,
options: Optional[FinalRequestOptions] = None,
) -> None:
self.response = response
self._cast_to = cast_to
self._client = client
self._options = options
self._decoder = client._make_sse_decoder()
self._iterator = self.__stream__()

Expand Down Expand Up @@ -85,7 +88,7 @@ class AsyncStream(Generic[_T]):
"""Provides the core interface to iterate over an asynchronous stream response."""

response: httpx.Response

_options: Optional[FinalRequestOptions] = None
_decoder: SSEDecoder | SSEBytesDecoder

def __init__(
Expand All @@ -94,10 +97,12 @@ def __init__(
cast_to: type[_T],
response: httpx.Response,
client: AsyncIsaacus,
options: Optional[FinalRequestOptions] = None,
) -> None:
self.response = response
self._cast_to = cast_to
self._client = client
self._options = options
self._decoder = client._make_sse_decoder()
self._iterator = self.__stream__()

Expand Down
2 changes: 1 addition & 1 deletion src/isaacus/_version.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

__title__ = "isaacus"
__version__ = "0.19.2" # x-release-please-version
__version__ = "0.19.3" # x-release-please-version
16 changes: 8 additions & 8 deletions tests/api_resources/classifications/test_universal.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
class TestUniversal:
parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"])

@pytest.mark.skip(reason="Prism tests are disabled")
@pytest.mark.skip(reason="Mock server tests are disabled")
@parametrize
def test_method_create(self, client: Isaacus) -> None:
universal = client.classifications.universal.create(
Expand All @@ -27,7 +27,7 @@ def test_method_create(self, client: Isaacus) -> None:
)
assert_matches_type(UniversalClassificationResponse, universal, path=["response"])

@pytest.mark.skip(reason="Prism tests are disabled")
@pytest.mark.skip(reason="Mock server tests are disabled")
@parametrize
def test_method_create_with_all_params(self, client: Isaacus) -> None:
universal = client.classifications.universal.create(
Expand All @@ -44,7 +44,7 @@ def test_method_create_with_all_params(self, client: Isaacus) -> None:
)
assert_matches_type(UniversalClassificationResponse, universal, path=["response"])

@pytest.mark.skip(reason="Prism tests are disabled")
@pytest.mark.skip(reason="Mock server tests are disabled")
@parametrize
def test_raw_response_create(self, client: Isaacus) -> None:
response = client.classifications.universal.with_raw_response.create(
Expand All @@ -58,7 +58,7 @@ def test_raw_response_create(self, client: Isaacus) -> None:
universal = response.parse()
assert_matches_type(UniversalClassificationResponse, universal, path=["response"])

@pytest.mark.skip(reason="Prism tests are disabled")
@pytest.mark.skip(reason="Mock server tests are disabled")
@parametrize
def test_streaming_response_create(self, client: Isaacus) -> None:
with client.classifications.universal.with_streaming_response.create(
Expand All @@ -80,7 +80,7 @@ class TestAsyncUniversal:
"async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"]
)

@pytest.mark.skip(reason="Prism tests are disabled")
@pytest.mark.skip(reason="Mock server tests are disabled")
@parametrize
async def test_method_create(self, async_client: AsyncIsaacus) -> None:
universal = await async_client.classifications.universal.create(
Expand All @@ -90,7 +90,7 @@ async def test_method_create(self, async_client: AsyncIsaacus) -> None:
)
assert_matches_type(UniversalClassificationResponse, universal, path=["response"])

@pytest.mark.skip(reason="Prism tests are disabled")
@pytest.mark.skip(reason="Mock server tests are disabled")
@parametrize
async def test_method_create_with_all_params(self, async_client: AsyncIsaacus) -> None:
universal = await async_client.classifications.universal.create(
Expand All @@ -107,7 +107,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncIsaacus) -
)
assert_matches_type(UniversalClassificationResponse, universal, path=["response"])

@pytest.mark.skip(reason="Prism tests are disabled")
@pytest.mark.skip(reason="Mock server tests are disabled")
@parametrize
async def test_raw_response_create(self, async_client: AsyncIsaacus) -> None:
response = await async_client.classifications.universal.with_raw_response.create(
Expand All @@ -121,7 +121,7 @@ async def test_raw_response_create(self, async_client: AsyncIsaacus) -> None:
universal = await response.parse()
assert_matches_type(UniversalClassificationResponse, universal, path=["response"])

@pytest.mark.skip(reason="Prism tests are disabled")
@pytest.mark.skip(reason="Mock server tests are disabled")
@parametrize
async def test_streaming_response_create(self, async_client: AsyncIsaacus) -> None:
async with async_client.classifications.universal.with_streaming_response.create(
Expand Down
16 changes: 8 additions & 8 deletions tests/api_resources/extractions/test_qa.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
class TestQA:
parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"])

@pytest.mark.skip(reason="Prism tests are disabled")
@pytest.mark.skip(reason="Mock server tests are disabled")
@parametrize
def test_method_create(self, client: Isaacus) -> None:
qa = client.extractions.qa.create(
Expand All @@ -29,7 +29,7 @@ def test_method_create(self, client: Isaacus) -> None:
)
assert_matches_type(AnswerExtractionResponse, qa, path=["response"])

@pytest.mark.skip(reason="Prism tests are disabled")
@pytest.mark.skip(reason="Mock server tests are disabled")
@parametrize
def test_method_create_with_all_params(self, client: Isaacus) -> None:
qa = client.extractions.qa.create(
Expand All @@ -48,7 +48,7 @@ def test_method_create_with_all_params(self, client: Isaacus) -> None:
)
assert_matches_type(AnswerExtractionResponse, qa, path=["response"])

@pytest.mark.skip(reason="Prism tests are disabled")
@pytest.mark.skip(reason="Mock server tests are disabled")
@parametrize
def test_raw_response_create(self, client: Isaacus) -> None:
response = client.extractions.qa.with_raw_response.create(
Expand All @@ -64,7 +64,7 @@ def test_raw_response_create(self, client: Isaacus) -> None:
qa = response.parse()
assert_matches_type(AnswerExtractionResponse, qa, path=["response"])

@pytest.mark.skip(reason="Prism tests are disabled")
@pytest.mark.skip(reason="Mock server tests are disabled")
@parametrize
def test_streaming_response_create(self, client: Isaacus) -> None:
with client.extractions.qa.with_streaming_response.create(
Expand All @@ -88,7 +88,7 @@ class TestAsyncQA:
"async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"]
)

@pytest.mark.skip(reason="Prism tests are disabled")
@pytest.mark.skip(reason="Mock server tests are disabled")
@parametrize
async def test_method_create(self, async_client: AsyncIsaacus) -> None:
qa = await async_client.extractions.qa.create(
Expand All @@ -100,7 +100,7 @@ async def test_method_create(self, async_client: AsyncIsaacus) -> None:
)
assert_matches_type(AnswerExtractionResponse, qa, path=["response"])

@pytest.mark.skip(reason="Prism tests are disabled")
@pytest.mark.skip(reason="Mock server tests are disabled")
@parametrize
async def test_method_create_with_all_params(self, async_client: AsyncIsaacus) -> None:
qa = await async_client.extractions.qa.create(
Expand All @@ -119,7 +119,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncIsaacus) -
)
assert_matches_type(AnswerExtractionResponse, qa, path=["response"])

@pytest.mark.skip(reason="Prism tests are disabled")
@pytest.mark.skip(reason="Mock server tests are disabled")
@parametrize
async def test_raw_response_create(self, async_client: AsyncIsaacus) -> None:
response = await async_client.extractions.qa.with_raw_response.create(
Expand All @@ -135,7 +135,7 @@ async def test_raw_response_create(self, async_client: AsyncIsaacus) -> None:
qa = await response.parse()
assert_matches_type(AnswerExtractionResponse, qa, path=["response"])

@pytest.mark.skip(reason="Prism tests are disabled")
@pytest.mark.skip(reason="Mock server tests are disabled")
@parametrize
async def test_streaming_response_create(self, async_client: AsyncIsaacus) -> None:
async with async_client.extractions.qa.with_streaming_response.create(
Expand Down
Loading
Loading