Skip to content

release: 0.8.0 #64

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 16 commits into
base: main
Choose a base branch
from
Open
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
26 changes: 23 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,17 @@ on:
- 'integrated/**'
- 'stl-preview-head/**'
- 'stl-preview-base/**'
pull_request:
branches-ignore:
- 'stl-preview-head/**'
- 'stl-preview-base/**'

jobs:
lint:
timeout-minutes: 10
name: lint
runs-on: ${{ github.repository == 'stainless-sdks/isaacus-python' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
if: github.event_name == 'push' || github.event.pull_request.head.repo.fork
steps:
- uses: actions/checkout@v4

Expand All @@ -30,17 +35,31 @@ jobs:
- name: Run lints
run: ./scripts/lint

upload:
if: github.repository == 'stainless-sdks/isaacus-python'
build:
if: github.repository == 'stainless-sdks/isaacus-python' && (github.event_name == 'push' || github.event.pull_request.head.repo.fork)
timeout-minutes: 10
name: upload
name: build
permissions:
contents: read
id-token: write
runs-on: depot-ubuntu-24.04
steps:
- uses: actions/checkout@v4

- name: Install Rye
run: |
curl -sSf https://rye.astral.sh/get | bash
echo "$HOME/.rye/shims" >> $GITHUB_PATH
env:
RYE_VERSION: '0.44.0'
RYE_INSTALL_OPTION: '--yes'

- name: Install dependencies
run: rye sync --all-features

- name: Run build
run: rye build

- name: Get GitHub OIDC Token
id: github-oidc
uses: actions/github-script@v6
Expand All @@ -58,6 +77,7 @@ jobs:
timeout-minutes: 10
name: test
runs-on: ${{ github.repository == 'stainless-sdks/isaacus-python' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
if: github.event_name == 'push' || github.event.pull_request.head.repo.fork
steps:
- uses: actions/checkout@v4

Expand Down
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.7.0"
".": "0.8.0"
}
34 changes: 34 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,39 @@
# Changelog

## 0.8.0 (2025-07-08)

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

### Features

* **client:** add support for aiohttp ([fba17e9](https://github.com/isaacus-dev/isaacus-python/commit/fba17e98279aa6d93dd3c9b6f9b95246b4fac813))


### Bug Fixes

* **ci:** correct conditional ([53c81d9](https://github.com/isaacus-dev/isaacus-python/commit/53c81d9e14882ae83a72c15481c8933226e668fa))
* **ci:** release-doctor — report correct token name ([3cb8672](https://github.com/isaacus-dev/isaacus-python/commit/3cb8672052edf1d1c4e72a5866fde3776d43a4e2))
* **client:** correctly parse binary response | stream ([5e316fe](https://github.com/isaacus-dev/isaacus-python/commit/5e316feaf5270e54321a917a9cd59efb2c42fcb3))
* **tests:** fix: tests which call HTTP endpoints directly with the example parameters ([638c7c4](https://github.com/isaacus-dev/isaacus-python/commit/638c7c4df7ecbc189480a0cba2d93125f9b97d2f))


### Chores

* **ci:** change upload type ([e79525c](https://github.com/isaacus-dev/isaacus-python/commit/e79525c4ffe9601c3b7c5e39a94c93c248cfbf33))
* **ci:** enable for pull requests ([29244fd](https://github.com/isaacus-dev/isaacus-python/commit/29244fdb33a5706480e1c7314099a14ae177ee06))
* **ci:** only run for pushes and fork pull requests ([94ed1eb](https://github.com/isaacus-dev/isaacus-python/commit/94ed1ebf9fc4111236f1db2a5d326f081079bdc8))
* **internal:** codegen related update ([cdfe0be](https://github.com/isaacus-dev/isaacus-python/commit/cdfe0beceeeaa21e4a24b6cdc86264dcaa3808f1))
* **internal:** update conftest.py ([e4a5936](https://github.com/isaacus-dev/isaacus-python/commit/e4a59368bd7d42d65fd368b03a208b2aa32a9144))
* **readme:** update badges ([cd48569](https://github.com/isaacus-dev/isaacus-python/commit/cd485693063d03f092d5be7f024b0f7e23da0897))
* **tests:** add tests for httpx client instantiation & proxies ([5d2c5b9](https://github.com/isaacus-dev/isaacus-python/commit/5d2c5b9e20bd80acd05240217b6be3991b46aae2))
* **tests:** run tests in parallel ([3f0e6da](https://github.com/isaacus-dev/isaacus-python/commit/3f0e6da6d9c6d9cd46cfa382da55a0b6a07d9d49))
* **tests:** skip some failing tests on the latest python versions ([b2b3fa8](https://github.com/isaacus-dev/isaacus-python/commit/b2b3fa82b87e9cc7e23164cc5589b3e157e635df))


### Documentation

* **client:** fix httpx.Timeout documentation reference ([b68d394](https://github.com/isaacus-dev/isaacus-python/commit/b68d3944df0ca58b7df3e89e06e90799f7ade25b))

## 0.7.0 (2025-06-03)

Full Changelog: [v0.6.1...v0.7.0](https://github.com/isaacus-dev/isaacus-python/compare/v0.6.1...v0.7.0)
Expand Down
40 changes: 38 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Isaacus Python API library

[![PyPI version](https://img.shields.io/pypi/v/isaacus.svg)](https://pypi.org/project/isaacus/)
[![PyPI version](<https://img.shields.io/pypi/v/isaacus.svg?label=pypi%20(stable)>)](https://pypi.org/project/isaacus/)

The Isaacus Python library provides convenient access to the Isaacus REST API from any Python 3.8+
application. The library includes type definitions for all request params and response fields,
Expand Down Expand Up @@ -72,6 +72,42 @@ asyncio.run(main())

Functionality between the synchronous and asynchronous clients is otherwise identical.

### With aiohttp

By default, the async client uses `httpx` for HTTP requests. However, for improved concurrency performance you may also use `aiohttp` as the HTTP backend.

You can enable this by installing `aiohttp`:

```sh
# install from PyPI
pip install isaacus[aiohttp]
```

Then you can enable it by instantiating the client with `http_client=DefaultAioHttpClient()`:

```python
import os
import asyncio
from isaacus import DefaultAioHttpClient
from isaacus import AsyncIsaacus


async def main() -> None:
async with AsyncIsaacus(
api_key=os.environ.get("ISAACUS_API_KEY"), # This is the default and can be omitted
http_client=DefaultAioHttpClient(),
) as client:
universal_classification = await client.classifications.universal.create(
model="kanon-universal-classifier",
query="This is a confidentiality clause.",
texts=["I agree not to tell anyone about the document."],
)
print(universal_classification.classifications)


asyncio.run(main())
```

## Using types

Nested request parameters are [TypedDicts](https://docs.python.org/3/library/typing.html#typing.TypedDict). Responses are [Pydantic models](https://docs.pydantic.dev) which also provide helper methods for things like:
Expand Down Expand Up @@ -176,7 +212,7 @@ client.with_options(max_retries=5).classifications.universal.create(
### Timeouts

By default requests time out after 1 minute. You can configure this with a `timeout` option,
which accepts a float or an [`httpx.Timeout`](https://www.python-httpx.org/advanced/#fine-tuning-the-configuration) object:
which accepts a float or an [`httpx.Timeout`](https://www.python-httpx.org/advanced/timeouts/#fine-tuning-the-configuration) object:

```python
from isaacus import Isaacus
Expand Down
2 changes: 1 addition & 1 deletion bin/check-release-environment
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
errors=()

if [ -z "${PYPI_TOKEN}" ]; then
errors+=("The ISAACUS_PYPI_TOKEN secret has not been set. Please set it in either this repository's secrets or your organization secrets.")
errors+=("The PYPI_TOKEN secret has not been set. Please set it in either this repository's secrets or your organization secrets.")
fi

lenErrors=${#errors[@]}
Expand Down
7 changes: 5 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "isaacus"
version = "0.7.0"
version = "0.8.0"
description = "The official Python library for the isaacus API"
dynamic = ["readme"]
license = "Apache-2.0"
Expand Down Expand Up @@ -37,6 +37,8 @@ classifiers = [
Homepage = "https://github.com/isaacus-dev/isaacus-python"
Repository = "https://github.com/isaacus-dev/isaacus-python"

[project.optional-dependencies]
aiohttp = ["aiohttp", "httpx_aiohttp>=0.1.6"]

[tool.rye]
managed = true
Expand All @@ -54,6 +56,7 @@ dev-dependencies = [
"importlib-metadata>=6.7.0",
"rich>=13.7.1",
"nest_asyncio==1.6.0",
"pytest-xdist>=3.6.1",
]

[tool.rye.scripts]
Expand Down Expand Up @@ -125,7 +128,7 @@ replacement = '[\1](https://github.com/isaacus-dev/isaacus-python/tree/main/\g<2

[tool.pytest.ini_options]
testpaths = ["tests"]
addopts = "--tb=short"
addopts = "--tb=short -n auto"
xfail_strict = true
asyncio_mode = "auto"
asyncio_default_fixture_loop_scope = "session"
Expand Down
31 changes: 31 additions & 0 deletions requirements-dev.lock
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,24 @@
# universal: false

-e file:.
aiohappyeyeballs==2.6.1
# via aiohttp
aiohttp==3.12.8
# via httpx-aiohttp
# via isaacus
aiosignal==1.3.2
# via aiohttp
annotated-types==0.6.0
# via pydantic
anyio==4.4.0
# via httpx
# via isaacus
argcomplete==3.1.2
# via nox
async-timeout==5.0.1
# via aiohttp
attrs==25.3.0
# via aiohttp
certifi==2023.7.22
# via httpcore
# via httpx
Expand All @@ -30,25 +41,37 @@ distro==1.8.0
exceptiongroup==1.2.2
# via anyio
# via pytest
execnet==2.1.1
# via pytest-xdist
filelock==3.12.4
# via virtualenv
frozenlist==1.6.2
# via aiohttp
# via aiosignal
h11==0.14.0
# via httpcore
httpcore==1.0.2
# via httpx
httpx==0.28.1
# via httpx-aiohttp
# via isaacus
# via respx
httpx-aiohttp==0.1.8
# via isaacus
idna==3.4
# via anyio
# via httpx
# via yarl
importlib-metadata==7.0.0
iniconfig==2.0.0
# via pytest
markdown-it-py==3.0.0
# via rich
mdurl==0.1.2
# via markdown-it-py
multidict==6.4.4
# via aiohttp
# via yarl
mypy==1.14.1
mypy-extensions==1.0.0
# via mypy
Expand All @@ -63,6 +86,9 @@ platformdirs==3.11.0
# via virtualenv
pluggy==1.5.0
# via pytest
propcache==0.3.1
# via aiohttp
# via yarl
pydantic==2.10.3
# via isaacus
pydantic-core==2.27.1
Expand All @@ -72,7 +98,9 @@ pygments==2.18.0
pyright==1.1.399
pytest==8.3.3
# via pytest-asyncio
# via pytest-xdist
pytest-asyncio==0.24.0
pytest-xdist==3.7.0
python-dateutil==2.8.2
# via time-machine
pytz==2023.3.post1
Expand All @@ -94,11 +122,14 @@ tomli==2.0.2
typing-extensions==4.12.2
# via anyio
# via isaacus
# via multidict
# via mypy
# via pydantic
# via pydantic-core
# via pyright
virtualenv==20.24.5
# via nox
yarl==1.20.0
# via aiohttp
zipp==3.17.0
# via importlib-metadata
27 changes: 27 additions & 0 deletions requirements.lock
Original file line number Diff line number Diff line change
Expand Up @@ -10,27 +10,51 @@
# universal: false

-e file:.
aiohappyeyeballs==2.6.1
# via aiohttp
aiohttp==3.12.8
# via httpx-aiohttp
# via isaacus
aiosignal==1.3.2
# via aiohttp
annotated-types==0.6.0
# via pydantic
anyio==4.4.0
# via httpx
# via isaacus
async-timeout==5.0.1
# via aiohttp
attrs==25.3.0
# via aiohttp
certifi==2023.7.22
# via httpcore
# via httpx
distro==1.8.0
# via isaacus
exceptiongroup==1.2.2
# via anyio
frozenlist==1.6.2
# via aiohttp
# via aiosignal
h11==0.14.0
# via httpcore
httpcore==1.0.2
# via httpx
httpx==0.28.1
# via httpx-aiohttp
# via isaacus
httpx-aiohttp==0.1.8
# via isaacus
idna==3.4
# via anyio
# via httpx
# via yarl
multidict==6.4.4
# via aiohttp
# via yarl
propcache==0.3.1
# via aiohttp
# via yarl
pydantic==2.10.3
# via isaacus
pydantic-core==2.27.1
Expand All @@ -41,5 +65,8 @@ sniffio==1.3.0
typing-extensions==4.12.2
# via anyio
# via isaacus
# via multidict
# via pydantic
# via pydantic-core
yarl==1.20.0
# via aiohttp
12 changes: 7 additions & 5 deletions scripts/utils/upload-artifact.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
#!/usr/bin/env bash
set -exuo pipefail

RESPONSE=$(curl -X POST "$URL" \
FILENAME=$(basename dist/*.whl)

RESPONSE=$(curl -X POST "$URL?filename=$FILENAME" \
-H "Authorization: Bearer $AUTH" \
-H "Content-Type: application/json")

Expand All @@ -12,13 +14,13 @@ if [[ "$SIGNED_URL" == "null" ]]; then
exit 1
fi

UPLOAD_RESPONSE=$(tar -cz . | curl -v -X PUT \
-H "Content-Type: application/gzip" \
--data-binary @- "$SIGNED_URL" 2>&1)
UPLOAD_RESPONSE=$(curl -v -X PUT \
-H "Content-Type: binary/octet-stream" \
--data-binary "@dist/$FILENAME" "$SIGNED_URL" 2>&1)

if echo "$UPLOAD_RESPONSE" | grep -q "HTTP/[0-9.]* 200"; then
echo -e "\033[32mUploaded build to Stainless storage.\033[0m"
echo -e "\033[32mInstallation: pip install 'https://pkg.stainless.com/s/isaacus-python/$SHA'\033[0m"
echo -e "\033[32mInstallation: pip install 'https://pkg.stainless.com/s/isaacus-python/$SHA/$FILENAME'\033[0m"
else
echo -e "\033[31mFailed to upload artifact.\033[0m"
exit 1
Expand Down
Loading