Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
ec47eb9
chore(internal): codegen related update (#425)
stainless-app[bot] Mar 14, 2025
db32afe
test: add DEFER_PYDANTIC_BUILD=false flag to tests (#427)
stainless-app[bot] Mar 14, 2025
7111d6d
chore(internal): remove extra empty newlines (#428)
stainless-app[bot] Mar 14, 2025
10f1de0
feat(api): api update
stainless-app[bot] Jan 23, 2025
c87c92d
chore(internal): codegen related update
stainless-app[bot] Jan 24, 2025
dfd7861
chore(internal): codegen related update
stainless-app[bot] Jan 28, 2025
aefb7d9
fix(tests): correctly generate examples with writeOnly fields
stainless-app[bot] Jan 29, 2025
32452f0
chore(internal): change default timeout to an int
stainless-app[bot] Feb 4, 2025
a85525a
chore(internal): bummp ruff dependency
stainless-app[bot] Feb 4, 2025
919377e
feat(client): send `X-Stainless-Read-Timeout` header
stainless-app[bot] Feb 6, 2025
df06aaa
chore(internal): fix type traversing dictionary params
stainless-app[bot] Feb 7, 2025
a920965
chore(internal): minor type handling changes
stainless-app[bot] Feb 7, 2025
c7a8995
chore(internal): update client tests
stainless-app[bot] Feb 13, 2025
1aa358a
fix: asyncify on non-asyncio runtimes
stainless-app[bot] Feb 14, 2025
6a582f7
feat(client): allow passing `NotGiven` for body
stainless-app[bot] Feb 21, 2025
9bc507d
chore(internal): fix devcontainers setup
stainless-app[bot] Feb 22, 2025
0124a23
chore(internal): properly set __pydantic_private__
stainless-app[bot] Feb 26, 2025
1946b4f
chore(internal): fix workflows
Mar 14, 2025
395275b
chore(internal): codegen related update (#429)
stainless-app[bot] Mar 15, 2025
9fe86fe
chore(internal): bump rye to 0.44.0 (#430)
stainless-app[bot] Mar 15, 2025
3a8b9c1
fix(types): handle more discriminated union shapes (#431)
stainless-app[bot] Mar 15, 2025
5e2ab9d
release: 0.2.0-alpha.46
stainless-app[bot] Mar 15, 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
4 changes: 2 additions & 2 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ FROM mcr.microsoft.com/vscode/devcontainers/python:0-${VARIANT}

USER vscode

RUN curl -sSf https://rye.astral.sh/get | RYE_VERSION="0.35.0" RYE_INSTALL_OPTION="--yes" bash
RUN curl -sSf https://rye.astral.sh/get | RYE_VERSION="0.44.0" RYE_INSTALL_OPTION="--yes" bash
ENV PATH=/home/vscode/.rye/shims:$PATH

RUN echo "[[ -d .venv ]] && source .venv/bin/activate" >> /home/vscode/.bashrc
RUN echo "[[ -d .venv ]] && source .venv/bin/activate || export PATH=\$PATH" >> /home/vscode/.bashrc
3 changes: 3 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@
}
}
}
},
"features": {
"ghcr.io/devcontainers/features/node:1": {}
}

// Features to add to the dev container. More info: https://containers.dev/features.
Expand Down
5 changes: 1 addition & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ jobs:
lint:
name: lint
runs-on: ubuntu-latest


steps:
- uses: actions/checkout@v4
Expand All @@ -22,13 +21,11 @@ jobs:
curl -sSf https://rye.astral.sh/get | bash
echo "$HOME/.rye/shims" >> $GITHUB_PATH
env:
RYE_VERSION: '0.35.0'
RYE_VERSION: '0.44.0'
RYE_INSTALL_OPTION: '--yes'

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

- name: Run lints
run: ./scripts/lint


2 changes: 1 addition & 1 deletion .github/workflows/publish-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
curl -sSf https://rye.astral.sh/get | bash
echo "$HOME/.rye/shims" >> $GITHUB_PATH
env:
RYE_VERSION: '0.35.0'
RYE_VERSION: '0.44.0'
RYE_INSTALL_OPTION: '--yes'

- name: Publish to PyPI
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.2.0-alpha.45"
".": "0.2.0-alpha.46"
}
36 changes: 36 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,42 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## 0.2.0-alpha.46 (2025-03-15)

Full Changelog: [v0.2.0-alpha.45...v0.2.0-alpha.46](https://github.com/openlayer-ai/openlayer-python/compare/v0.2.0-alpha.45...v0.2.0-alpha.46)

### Features

* **api:** api update ([10f1de0](https://github.com/openlayer-ai/openlayer-python/commit/10f1de0a71b489ec6e479af5fd8c33bc4f2cc63a))
* **client:** allow passing `NotGiven` for body ([6a582f7](https://github.com/openlayer-ai/openlayer-python/commit/6a582f73748f4c628cd55dd4781792f8ba82426b))
* **client:** send `X-Stainless-Read-Timeout` header ([919377e](https://github.com/openlayer-ai/openlayer-python/commit/919377ee8e73ad8ca39d5cead7f85c3e934b7bc1))


### Bug Fixes

* asyncify on non-asyncio runtimes ([1aa358a](https://github.com/openlayer-ai/openlayer-python/commit/1aa358aefbee3ddb9c401eb3e6838b063ba26f1e))
* **client:** mark some request bodies as optional ([6a582f7](https://github.com/openlayer-ai/openlayer-python/commit/6a582f73748f4c628cd55dd4781792f8ba82426b))
* **tests:** correctly generate examples with writeOnly fields ([aefb7d9](https://github.com/openlayer-ai/openlayer-python/commit/aefb7d93a78f972467a3f70a17c06d9e451817b8))
* **types:** handle more discriminated union shapes ([#431](https://github.com/openlayer-ai/openlayer-python/issues/431)) ([3a8b9c1](https://github.com/openlayer-ai/openlayer-python/commit/3a8b9c104e28589248d3208f92d8cda3bee1364e))


### Chores

* **internal:** bummp ruff dependency ([a85525a](https://github.com/openlayer-ai/openlayer-python/commit/a85525a6cc9e3ac81ba1cd5fb534e120c1580067))
* **internal:** bump rye to 0.44.0 ([#430](https://github.com/openlayer-ai/openlayer-python/issues/430)) ([9fe86fe](https://github.com/openlayer-ai/openlayer-python/commit/9fe86fef481775181a52d3e4f9249c4405d4bb24))
* **internal:** change default timeout to an int ([32452f0](https://github.com/openlayer-ai/openlayer-python/commit/32452f0ac8f3a321a81fb7bd340fa6ced4c5c648))
* **internal:** codegen related update ([dfd7861](https://github.com/openlayer-ai/openlayer-python/commit/dfd7861657bbd5f761649b5f956cb9c85e9bd1e4))
* **internal:** codegen related update ([c87c92d](https://github.com/openlayer-ai/openlayer-python/commit/c87c92ded5591542b9c939c775fa2d09fb0885c5))
* **internal:** codegen related update ([#425](https://github.com/openlayer-ai/openlayer-python/issues/425)) ([ec47eb9](https://github.com/openlayer-ai/openlayer-python/commit/ec47eb9f03007a5efa8c194ab98d0aa1377720b9))
* **internal:** codegen related update ([#429](https://github.com/openlayer-ai/openlayer-python/issues/429)) ([395275b](https://github.com/openlayer-ai/openlayer-python/commit/395275b0f996f2b4eb49857530e72f9fe64b853a))
* **internal:** fix devcontainers setup ([9bc507d](https://github.com/openlayer-ai/openlayer-python/commit/9bc507d3197627087b7139ee3c2f9e28c4075c95))
* **internal:** fix type traversing dictionary params ([df06aaa](https://github.com/openlayer-ai/openlayer-python/commit/df06aaa91ee17410b96b28e897c5559f67cbc829))
* **internal:** fix workflows ([1946b4f](https://github.com/openlayer-ai/openlayer-python/commit/1946b4f202142fe9a58c11d5f74870def6582d9b))
* **internal:** minor type handling changes ([a920965](https://github.com/openlayer-ai/openlayer-python/commit/a92096519c3a1d2ecaad5595029231faeafb09ed))
* **internal:** properly set __pydantic_private__ ([0124a23](https://github.com/openlayer-ai/openlayer-python/commit/0124a2338534da8f0d707d9c6d6f5e5576d6999f))
* **internal:** remove extra empty newlines ([#428](https://github.com/openlayer-ai/openlayer-python/issues/428)) ([7111d6d](https://github.com/openlayer-ai/openlayer-python/commit/7111d6d4a8a8524aadbc402ea4761dba2b377170))
* **internal:** update client tests ([c7a8995](https://github.com/openlayer-ai/openlayer-python/commit/c7a899524ea9b3ff1218a0e03868a8647ee46a08))

## 0.2.0-alpha.45 (2025-03-13)

Full Changelog: [v0.2.0-alpha.44...v0.2.0-alpha.45](https://github.com/openlayer-ai/openlayer-python/compare/v0.2.0-alpha.44...v0.2.0-alpha.45)
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright 2024 Openlayer
Copyright 2025 Openlayer

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
26 changes: 21 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ The Openlayer Python library provides convenient access to the Openlayer REST AP
application. The library includes type definitions for all request params and response fields,
and offers both synchronous and asynchronous clients powered by [httpx](https://github.com/encode/httpx).

It is generated with [Stainless](https://www.stainlessapi.com/).
It is generated with [Stainless](https://www.stainless.com/).

## Documentation

Expand Down Expand Up @@ -109,6 +109,23 @@ Nested request parameters are [TypedDicts](https://docs.python.org/3/library/typ

Typed requests and responses provide autocomplete and documentation within your editor. If you would like to see type errors in VS Code to help catch bugs earlier, set `python.analysis.typeCheckingMode` to `basic`.

## Nested params

Nested parameters are dictionaries, typed using `TypedDict`, for example:

```python
from openlayer import Openlayer

client = Openlayer()

commit = client.projects.commits.create(
project_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
commit={"message": "Updated the prompt."},
storage_uri="s3://...",
)
print(commit.commit)
```

## Handling errors

When the library is unable to connect to the API (for example, due to network connection problems or a timeout), a subclass of `openlayer.APIConnectionError` is raised.
Expand Down Expand Up @@ -155,7 +172,7 @@ except openlayer.APIStatusError as e:
print(e.response)
```

Error codes are as followed:
Error codes are as follows:

| Status Code | Error Type |
| ----------- | -------------------------- |
Expand Down Expand Up @@ -356,8 +373,7 @@ If you need to access undocumented endpoints, params, or response properties, th
#### Undocumented endpoints

To make requests to undocumented endpoints, you can make requests using `client.get`, `client.post`, and other
http verbs. Options on the client will be respected (such as retries) will be respected when making this
request.
http verbs. Options on the client will be respected (such as retries) when making this request.

```py
import httpx
Expand Down Expand Up @@ -429,7 +445,7 @@ with Openlayer() as client:
This package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) conventions, though certain backwards-incompatible changes may be released as minor versions:

1. Changes that only affect static types, without breaking runtime behavior.
2. Changes to library internals which are technically public but not intended or documented for external use. _(Please open a GitHub issue to let us know if you are relying on such internals)_.
2. Changes to library internals which are technically public but not intended or documented for external use. _(Please open a GitHub issue to let us know if you are relying on such internals.)_
3. Changes that we do not expect to impact the vast majority of users in practice.

We take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience.
Expand Down
4 changes: 2 additions & 2 deletions SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

## Reporting Security Issues

This SDK is generated by [Stainless Software Inc](http://stainlessapi.com). Stainless takes security seriously, and encourages you to report any security vulnerability promptly so that appropriate action can be taken.
This SDK is generated by [Stainless Software Inc](http://stainless.com). Stainless takes security seriously, and encourages you to report any security vulnerability promptly so that appropriate action can be taken.

To report a security issue, please contact the Stainless team at security@stainlessapi.com.
To report a security issue, please contact the Stainless team at security@stainless.com.

## Responsible Disclosure

Expand Down
2 changes: 1 addition & 1 deletion mypy.ini
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ cache_fine_grained = True
# ```
# Changing this codegen to make mypy happy would increase complexity
# and would not be worth it.
disable_error_code = func-returns-value
disable_error_code = func-returns-value,overload-cannot-match

# https://github.com/python/mypy/issues/12162
[mypy.overrides]
Expand Down
9 changes: 4 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "openlayer"
version = "0.2.0-alpha.45"
version = "0.2.0-alpha.46"
description = "The official Python library for the openlayer API"
dynamic = ["readme"]
license = "Apache-2.0"
Expand Down Expand Up @@ -44,7 +44,6 @@ Homepage = "https://github.com/openlayer-ai/openlayer-python"
Repository = "https://github.com/openlayer-ai/openlayer-python"



[tool.rye]
managed = true
# version pins are in requirements-dev.lock
Expand All @@ -60,7 +59,7 @@ dev-dependencies = [
"dirty-equals>=0.6.0",
"importlib-metadata>=6.7.0",
"rich>=13.7.1",
"nest_asyncio==1.6.0"
"nest_asyncio==1.6.0",
]

[tool.rye.scripts]
Expand Down Expand Up @@ -135,6 +134,7 @@ testpaths = ["tests"]
addopts = "--tb=short"
xfail_strict = true
asyncio_mode = "auto"
asyncio_default_fixture_loop_scope = "session"
filterwarnings = [
"error"
]
Expand All @@ -159,7 +159,6 @@ reportImplicitOverride = true
reportImportCycles = false
reportPrivateUsage = false


[tool.ruff]
line-length = 120
output-format = "grouped"
Expand All @@ -184,7 +183,7 @@ select = [
"T201",
"T203",
# misuse of typing.TYPE_CHECKING
"TCH004",
"TC004",
# import rules
"TID251",
]
Expand Down
12 changes: 6 additions & 6 deletions requirements-dev.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
# all-features: true
# with-sources: false
# generate-hashes: false
# universal: false

-e file:.
annotated-types==0.6.0
Expand Down Expand Up @@ -38,7 +39,7 @@ h11==0.14.0
# via httpcore
httpcore==1.0.2
# via httpx
httpx==0.25.2
httpx==0.28.1
# via openlayer
# via respx
idna==3.4
Expand All @@ -52,7 +53,7 @@ markdown-it-py==3.0.0
# via rich
mdurl==0.1.2
# via markdown-it-py
mypy==1.13.0
mypy==1.14.1
mypy-extensions==1.0.0
# via mypy
nest-asyncio==1.6.0
Expand Down Expand Up @@ -80,7 +81,7 @@ pydantic-core==2.27.1
# via pydantic
pygments==2.18.0
# via rich
pyright==1.1.390
pyright==1.1.392.post0
pytest==8.3.3
# via pytest-asyncio
pytest-asyncio==0.24.0
Expand All @@ -96,16 +97,15 @@ requests==2.32.3
# via requests-toolbelt
requests-toolbelt==1.0.0
# via openlayer
respx==0.20.2
respx==0.22.0
rich==13.7.1
ruff==0.6.9
ruff==0.9.4
setuptools==68.2.2
# via nodeenv
six==1.16.0
# via python-dateutil
sniffio==1.3.0
# via anyio
# via httpx
# via openlayer
time-machine==2.9.0
tomli==2.0.2
Expand Down
4 changes: 2 additions & 2 deletions requirements.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
# all-features: true
# with-sources: false
# generate-hashes: false
# universal: false

-e file:.
annotated-types==0.6.0
Expand All @@ -28,7 +29,7 @@ h11==0.14.0
# via httpcore
httpcore==1.0.2
# via httpx
httpx==0.25.2
httpx==0.28.1
# via openlayer
idna==3.4
# via anyio
Expand Down Expand Up @@ -60,7 +61,6 @@ six==1.16.0
# via python-dateutil
sniffio==1.3.0
# via anyio
# via httpx
# via openlayer
tqdm==4.67.1
# via openlayer
Expand Down
2 changes: 1 addition & 1 deletion scripts/bootstrap
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ set -e

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

if [ -f "Brewfile" ] && [ "$(uname -s)" = "Darwin" ]; then
if ! command -v rye >/dev/null 2>&1 && [ -f "Brewfile" ] && [ "$(uname -s)" = "Darwin" ]; then
brew bundle check >/dev/null 2>&1 || {
echo "==> Installing Homebrew dependencies…"
brew bundle
Expand Down
1 change: 0 additions & 1 deletion scripts/lint
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,3 @@ rye run lint

echo "==> Making sure it imports"
rye run python -c 'import openlayer'

2 changes: 2 additions & 0 deletions scripts/test
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ else
echo
fi

export DEFER_PYDANTIC_BUILD=false

echo "==> Running tests"
rye run pytest "$@"

Expand Down
4 changes: 2 additions & 2 deletions scripts/utils/ruffen-docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def _md_match(match: Match[str]) -> str:
with _collect_error(match):
code = format_code_block(code)
code = textwrap.indent(code, match["indent"])
return f'{match["before"]}{code}{match["after"]}'
return f"{match['before']}{code}{match['after']}"

def _pycon_match(match: Match[str]) -> str:
code = ""
Expand Down Expand Up @@ -97,7 +97,7 @@ def finish_fragment() -> None:
def _md_pycon_match(match: Match[str]) -> str:
code = _pycon_match(match)
code = textwrap.indent(code, match["indent"])
return f'{match["before"]}{code}{match["after"]}'
return f"{match['before']}{code}{match['after']}"

src = MD_RE.sub(_md_match, src)
src = MD_PYCON_RE.sub(_md_pycon_match, src)
Expand Down
Loading