Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
b72bf2d
chore(docs): remove reference to rye shell
stainless-app[bot] Jun 3, 2025
c95346d
feat(client): add follow_redirects request option
stainless-app[bot] Jun 3, 2025
e7ef8cb
chore(tests): run tests in parallel
stainless-app[bot] Jun 13, 2025
afb303a
fix(client): correctly parse binary response | stream
stainless-app[bot] Jun 13, 2025
5b7d79c
chore(tests): add tests for httpx client instantiation & proxies
stainless-app[bot] Jun 17, 2025
a218d78
chore(internal): update conftest.py
stainless-app[bot] Jun 17, 2025
c079ebc
chore(ci): enable for pull requests
stainless-app[bot] Jun 17, 2025
634dc80
chore(readme): update badges
stainless-app[bot] Jun 18, 2025
9c10420
fix(tests): fix: tests which call HTTP endpoints directly with the ex…
stainless-app[bot] Jun 18, 2025
40eb1f0
docs(client): fix httpx.Timeout documentation reference
stainless-app[bot] Jun 19, 2025
ae63fa8
feat(client): add support for aiohttp
stainless-app[bot] Jun 21, 2025
7b4f891
chore(tests): skip some failing tests on the latest python versions
stainless-app[bot] Jun 24, 2025
f4cbba9
fix(ci): release-doctor — report correct token name
stainless-app[bot] Jun 27, 2025
8f32b36
chore(ci): only run for pushes and fork pull requests
stainless-app[bot] Jun 28, 2025
6d7672d
fix(ci): correct conditional
stainless-app[bot] Jun 30, 2025
bd43fa1
chore(ci): change upload type
stainless-app[bot] Jul 2, 2025
a28bd38
chore(internal): codegen related update
stainless-app[bot] Jul 8, 2025
72da51f
chore(internal): bump pinned h11 dep
stainless-app[bot] Jul 9, 2025
55eadd3
chore(package): mark python 3.13 as supported
stainless-app[bot] Jul 9, 2025
65b2fce
fix(parsing): correctly handle nested discriminated unions
stainless-app[bot] Jul 10, 2025
2298710
chore(readme): fix version rendering on pypi
stainless-app[bot] Jul 11, 2025
8498952
fix(client): don't send Content-Type header on GET requests
stainless-app[bot] Jul 12, 2025
c042cab
feat: clean up environment call outs
stainless-app[bot] Jul 15, 2025
c7b7604
fix(parsing): ignore empty metadata
stainless-app[bot] Jul 22, 2025
700d455
fix(parsing): parse extra field types
stainless-app[bot] Jul 23, 2025
0c95966
chore(project): add settings file for vscode
stainless-app[bot] Jul 25, 2025
0ba166d
release: 0.1.0-alpha.6
stainless-app[bot] Jul 25, 2025
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/solver-api-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/solver-api-python'
build:
if: github.repository == 'stainless-sdks/solver-api-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/solver-api-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
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
.prism.log
.vscode
_dev

__pycache__
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.1.0-alpha.5"
".": "0.1.0-alpha.6"
}
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"python.analysis.importFormat": "relative",
}
45 changes: 45 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,50 @@
# Changelog

## 0.1.0-alpha.6 (2025-07-25)

Full Changelog: [v0.1.0-alpha.5...v0.1.0-alpha.6](https://github.com/Laredo-Labs/solverai-sdk-python/compare/v0.1.0-alpha.5...v0.1.0-alpha.6)

### Features

* clean up environment call outs ([c042cab](https://github.com/Laredo-Labs/solverai-sdk-python/commit/c042cab164591713caf3fddedf1a4cd0eecb318b))
* **client:** add follow_redirects request option ([c95346d](https://github.com/Laredo-Labs/solverai-sdk-python/commit/c95346d54d8de3668375c8be3b11b42da4c6c57e))
* **client:** add support for aiohttp ([ae63fa8](https://github.com/Laredo-Labs/solverai-sdk-python/commit/ae63fa80bb13fc414a233c9de700d697f1aa2939))


### Bug Fixes

* **ci:** correct conditional ([6d7672d](https://github.com/Laredo-Labs/solverai-sdk-python/commit/6d7672d2b9c01ff24cbae81a6224f8f50a294d67))
* **ci:** release-doctor — report correct token name ([f4cbba9](https://github.com/Laredo-Labs/solverai-sdk-python/commit/f4cbba90a637aa050bf574d65c3a1dcf09bd4cb2))
* **client:** correctly parse binary response | stream ([afb303a](https://github.com/Laredo-Labs/solverai-sdk-python/commit/afb303ae063e9b7a33cba3c6027e193319d6ff2e))
* **client:** don't send Content-Type header on GET requests ([8498952](https://github.com/Laredo-Labs/solverai-sdk-python/commit/849895238af82e081a6cb12ad25261dc9a8065c5))
* **parsing:** correctly handle nested discriminated unions ([65b2fce](https://github.com/Laredo-Labs/solverai-sdk-python/commit/65b2fcee7f88b55af930fa8194716f0c44229290))
* **parsing:** ignore empty metadata ([c7b7604](https://github.com/Laredo-Labs/solverai-sdk-python/commit/c7b7604b5dad423fd7a37dc33b6bee3c582b6ef1))
* **parsing:** parse extra field types ([700d455](https://github.com/Laredo-Labs/solverai-sdk-python/commit/700d45591cb4f6873702617aa496726ba0de56e3))
* **tests:** fix: tests which call HTTP endpoints directly with the example parameters ([9c10420](https://github.com/Laredo-Labs/solverai-sdk-python/commit/9c104203d955bd80a61ed8f7b9b1624effeeb722))


### Chores

* **ci:** change upload type ([bd43fa1](https://github.com/Laredo-Labs/solverai-sdk-python/commit/bd43fa10bcb7408bf9f96466b583881933add46c))
* **ci:** enable for pull requests ([c079ebc](https://github.com/Laredo-Labs/solverai-sdk-python/commit/c079ebc8d1e807a3ca8bc6af241eb30dc5d5ffca))
* **ci:** only run for pushes and fork pull requests ([8f32b36](https://github.com/Laredo-Labs/solverai-sdk-python/commit/8f32b36f84635831d9b57fda36b29f32ec63b31e))
* **docs:** remove reference to rye shell ([b72bf2d](https://github.com/Laredo-Labs/solverai-sdk-python/commit/b72bf2decfa2de0939062186a61db6c51c420c74))
* **internal:** bump pinned h11 dep ([72da51f](https://github.com/Laredo-Labs/solverai-sdk-python/commit/72da51f225f99ecb4989343344804ef31ac07c2c))
* **internal:** codegen related update ([a28bd38](https://github.com/Laredo-Labs/solverai-sdk-python/commit/a28bd389b016785fd1a7bb930d530d69c65b27c5))
* **internal:** update conftest.py ([a218d78](https://github.com/Laredo-Labs/solverai-sdk-python/commit/a218d788fc14ecdc32a554fa3982c585527377f7))
* **package:** mark python 3.13 as supported ([55eadd3](https://github.com/Laredo-Labs/solverai-sdk-python/commit/55eadd3c32b3c644b3d88a476db456efa7361a23))
* **project:** add settings file for vscode ([0c95966](https://github.com/Laredo-Labs/solverai-sdk-python/commit/0c9596692822dfe7679c4720b986dc283bcf07d4))
* **readme:** fix version rendering on pypi ([2298710](https://github.com/Laredo-Labs/solverai-sdk-python/commit/2298710b58eef2b1de92d0220fd9f6266f9998e5))
* **readme:** update badges ([634dc80](https://github.com/Laredo-Labs/solverai-sdk-python/commit/634dc806aa4109a5e061fe9ee8b3bfd6271c24c8))
* **tests:** add tests for httpx client instantiation & proxies ([5b7d79c](https://github.com/Laredo-Labs/solverai-sdk-python/commit/5b7d79cf7c8e982d206b4644994b951aaf8b6ba6))
* **tests:** run tests in parallel ([e7ef8cb](https://github.com/Laredo-Labs/solverai-sdk-python/commit/e7ef8cbffcc14a38c8c61cdd528bd0d5f3b2fded))
* **tests:** skip some failing tests on the latest python versions ([7b4f891](https://github.com/Laredo-Labs/solverai-sdk-python/commit/7b4f8919840448fdf9968e6eda9c9164eb8bec3e))


### Documentation

* **client:** fix httpx.Timeout documentation reference ([40eb1f0](https://github.com/Laredo-Labs/solverai-sdk-python/commit/40eb1f0968839d3e384fdbcf41ac33fdf7f8b3de))

## 0.1.0-alpha.5 (2025-05-28)

Full Changelog: [v0.1.0-alpha.4...v0.1.0-alpha.5](https://github.com/Laredo-Labs/solverai-sdk-python/compare/v0.1.0-alpha.4...v0.1.0-alpha.5)
Expand Down
3 changes: 1 addition & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ $ rye sync --all-features
You can then run scripts using `rye run python script.py` or by activating the virtual environment:

```sh
$ rye shell
# or manually activate - https://docs.python.org/3/library/venv.html#how-venvs-work
# Activate the virtual environment - https://docs.python.org/3/library/venv.html#how-venvs-work
$ source .venv/bin/activate

# now you can omit the `rye run` prefix
Expand Down
41 changes: 39 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Solver Python API library

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

The Solver Python library provides convenient access to the Solver REST API from any Python 3.8+
application. The library includes type definitions for all request params and response fields,
Expand Down Expand Up @@ -74,6 +75,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 --pre solverai[aiohttp]
```

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

```python
import asyncio
from solverai import DefaultAioHttpClient
from solverai import AsyncSolver


async def main() -> None:
async with AsyncSolver(
api_key="My API Key",
http_client=DefaultAioHttpClient(),
) as client:
session = await client.repos.sessions.create(
repo="Sandbox",
provider="github",
org="Laredo-Labs",
user_branch_name="main",
)
print(session.id)


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 @@ -158,7 +195,7 @@ client.with_options(max_retries=5).repos.sessions.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 solverai import Solver
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 SOLVER_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
8 changes: 6 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "solverai"
version = "0.1.0-alpha.5"
version = "0.1.0-alpha.6"
description = "The official Python library for the solver API"
dynamic = ["readme"]
license = "Apache-2.0"
Expand All @@ -24,6 +24,7 @@ classifiers = [
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Operating System :: OS Independent",
"Operating System :: POSIX",
"Operating System :: MacOS",
Expand All @@ -37,6 +38,8 @@ classifiers = [
Homepage = "https://github.com/Laredo-Labs/solverai-sdk-python"
Repository = "https://github.com/Laredo-Labs/solverai-sdk-python"

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

[tool.rye]
managed = true
Expand All @@ -54,6 +57,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 +129,7 @@ replacement = '[\1](https://github.com/Laredo-Labs/solverai-sdk-python/tree/main

[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
35 changes: 33 additions & 2 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 solverai
aiosignal==1.3.2
# via aiohttp
annotated-types==0.6.0
# via pydantic
anyio==4.4.0
# via httpx
# via solverai
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
h11==0.14.0
frozenlist==1.6.2
# via aiohttp
# via aiosignal
h11==0.16.0
# via httpcore
httpcore==1.0.2
httpcore==1.0.9
# via httpx
httpx==0.28.1
# via httpx-aiohttp
# via respx
# via solverai
httpx-aiohttp==0.1.8
# via solverai
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 solverai
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 @@ -93,12 +121,15 @@ tomli==2.0.2
# via pytest
typing-extensions==4.12.2
# via anyio
# via multidict
# via mypy
# via pydantic
# via pydantic-core
# via pyright
# via solverai
virtualenv==20.24.5
# via nox
yarl==1.20.0
# via aiohttp
zipp==3.17.0
# via importlib-metadata
Loading