Skip to content

Commit

Permalink
release: 0.0.13 (#25)
Browse files Browse the repository at this point in the history
* feat(api): update via SDK Studio (#24)

* chore(internal): codegen related update (#26)

* chore(tests): update prism version (#27)

* chore: fix error message import example (#28)

* chore(internal): add type construction helper (#29)

* feat(api): update via SDK Studio (#30)

* feat(api): OpenAPI spec update via Stainless API (#31)

* release: 0.0.13

---------

Co-authored-by: stainless-app[bot] <142633134+stainless-app[bot]@users.noreply.github.com>
  • Loading branch information
stainless-app[bot] authored Aug 1, 2024
1 parent e961c81 commit 3a95cf8
Show file tree
Hide file tree
Showing 44 changed files with 960 additions and 785 deletions.
2 changes: 1 addition & 1 deletion .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://raw.githubusercontent.com/astral-sh/rye/main/scripts/install.sh | RYE_VERSION="0.24.0" RYE_INSTALL_OPTION="--yes" bash
RUN curl -sSf https://rye.astral.sh/get | RYE_VERSION="0.35.0" RYE_INSTALL_OPTION="--yes" bash
ENV PATH=/home/vscode/.rye/shims:$PATH

RUN echo "[[ -d .venv ]] && source .venv/bin/activate" >> /home/vscode/.bashrc
9 changes: 5 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ on:
pull_request:
branches:
- main
- next

jobs:
lint:
Expand All @@ -18,10 +19,10 @@ jobs:

- name: Install Rye
run: |
curl -sSf https://raw.githubusercontent.com/astral-sh/rye/main/scripts/install.sh | bash
curl -sSf https://rye.astral.sh/get | bash
echo "$HOME/.rye/shims" >> $GITHUB_PATH
env:
RYE_VERSION: 0.24.0
RYE_VERSION: '0.35.0'
RYE_INSTALL_OPTION: '--yes'

- name: Install dependencies
Expand All @@ -38,10 +39,10 @@ jobs:

- name: Install Rye
run: |
curl -sSf https://raw.githubusercontent.com/astral-sh/rye/main/scripts/install.sh | bash
curl -sSf https://rye.astral.sh/get | bash
echo "$HOME/.rye/shims" >> $GITHUB_PATH
env:
RYE_VERSION: 0.24.0
RYE_VERSION: '0.35.0'
RYE_INSTALL_OPTION: '--yes'

- name: Bootstrap
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/publish-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ jobs:

- name: Install Rye
run: |
curl -sSf https://raw.githubusercontent.com/astral-sh/rye/main/scripts/install.sh | bash
curl -sSf https://rye.astral.sh/get | bash
echo "$HOME/.rye/shims" >> $GITHUB_PATH
env:
RYE_VERSION: 0.24.0
RYE_INSTALL_OPTION: "--yes"
RYE_VERSION: '0.35.0'
RYE_INSTALL_OPTION: '--yes'

- name: Publish to PyPI
run: |
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/release-doctor.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
name: Release Doctor
on:
pull_request:
branches:
- main
workflow_dispatch:

jobs:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.prism.log
.vscode
_dev

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.0.12"
".": "0.0.13"
}
2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
configured_endpoints: 38
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/plastic-labs%2Fhoncho-7967581df14089cda98ce7bd258102d5da5ec541dc5b17aa918f96be11a2bde8.yml
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/plastic-labs%2FHoncho-9de9efee1447340a4b99258885f8c5472ee853fa3bc7327fd632be3c5f23f161.yml
18 changes: 18 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,23 @@
# Changelog

## 0.0.13 (2024-08-01)

Full Changelog: [v0.0.12...v0.0.13](https://github.com/plastic-labs/honcho-python/compare/v0.0.12...v0.0.13)

### Features

* **api:** OpenAPI spec update via Stainless API ([#31](https://github.com/plastic-labs/honcho-python/issues/31)) ([f626a2c](https://github.com/plastic-labs/honcho-python/commit/f626a2c303f866dcbb65237f2570d2ed9b064351))
* **api:** update via SDK Studio ([#24](https://github.com/plastic-labs/honcho-python/issues/24)) ([e5417f8](https://github.com/plastic-labs/honcho-python/commit/e5417f859174b237fa1c912188031b786842e0d6))
* **api:** update via SDK Studio ([#30](https://github.com/plastic-labs/honcho-python/issues/30)) ([f3e9cb4](https://github.com/plastic-labs/honcho-python/commit/f3e9cb49773691962b07067c531f288942711db1))


### Chores

* fix error message import example ([#28](https://github.com/plastic-labs/honcho-python/issues/28)) ([675f719](https://github.com/plastic-labs/honcho-python/commit/675f71940a184e8a277f6db8df2604d762bae1d5))
* **internal:** add type construction helper ([#29](https://github.com/plastic-labs/honcho-python/issues/29)) ([e526f46](https://github.com/plastic-labs/honcho-python/commit/e526f463dd0dea1a9047c11cf81366a06e1ed47b))
* **internal:** codegen related update ([#26](https://github.com/plastic-labs/honcho-python/issues/26)) ([8aa9cad](https://github.com/plastic-labs/honcho-python/commit/8aa9cad685d140c45ed9c01c4d8e853434352478))
* **tests:** update prism version ([#27](https://github.com/plastic-labs/honcho-python/issues/27)) ([0aa4203](https://github.com/plastic-labs/honcho-python/commit/0aa42032400a4dcff1f11086233074e080f3097c))

## 0.0.12 (2024-05-23)

Full Changelog: [v0.0.11...v0.0.12](https://github.com/plastic-labs/honcho-python/compare/v0.0.11...v0.0.12)
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

### With Rye

We use [Rye](https://rye-up.com/) to manage dependencies so we highly recommend [installing it](https://rye-up.com/guide/installation/) as it will automatically provision a Python environment with the expected Python version.
We use [Rye](https://rye.astral.sh/) to manage dependencies so we highly recommend [installing it](https://rye.astral.sh/guide/installation/) as it will automatically provision a Python environment with the expected Python version.

After installing Rye, you'll just have to run this command:

Expand Down
48 changes: 27 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
# Honcho Python API library
# honcho-ai API library

[![PyPI version](https://img.shields.io/pypi/v/honcho-ai.svg)](https://pypi.org/project/honcho-ai/)

The Honcho Python library provides convenient access to the Honcho REST API from any Python 3.7+
The honcho-ai library provides convenient access to the Honcho REST API from any Python 3.7+
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/).

## Documentation

The REST API documentation can be found [on docs.honcho.dev](https://docs.honcho.dev). The full API of this library can be found in [api.md](api.md).
The REST API documentation can be found on [docs.honcho.dev](https://docs.honcho.dev). The full API of this library can be found in [api.md](api.md).

## Installation

Expand All @@ -30,12 +30,12 @@ from honcho import Honcho
client = Honcho(
# This is the default and can be omitted
api_key=os.environ.get("HONCHO_API_KEY"),
# defaults to "local".
environment="demo",
# defaults to "demo".
environment="local",
)

app = client.apps.create(
name="string",
name="name",
)
print(app.id)
```
Expand All @@ -57,14 +57,14 @@ from honcho import AsyncHoncho
client = AsyncHoncho(
# This is the default and can be omitted
api_key=os.environ.get("HONCHO_API_KEY"),
# defaults to "local".
environment="demo",
# defaults to "demo".
environment="local",
)


async def main() -> None:
app = await client.apps.create(
name="string",
name="name",
)
print(app.id)

Expand All @@ -90,14 +90,14 @@ List methods in the Honcho API are paginated.
This library provides auto-paginating iterators with each list response, so you do not have to request successive pages manually:

```python
import honcho
from honcho import Honcho

client = Honcho()

all_users = []
# Automatically fetches more pages as needed.
for user in client.apps.users.list(
"REPLACE_ME",
app_id="REPLACE_ME",
):
# Do something with user here
all_users.append(user)
Expand All @@ -108,7 +108,7 @@ Or, asynchronously:

```python
import asyncio
import honcho
from honcho import AsyncHoncho

client = AsyncHoncho()

Expand All @@ -117,7 +117,7 @@ async def main() -> None:
all_users = []
# Iterate through items across all pages, issuing requests as needed.
async for user in client.apps.users.list(
"REPLACE_ME",
app_id="REPLACE_ME",
):
all_users.append(user)
print(all_users)
Expand All @@ -130,7 +130,7 @@ Alternatively, you can use the `.has_next_page()`, `.next_page_info()`, or `.get

```python
first_page = await client.apps.users.list(
"REPLACE_ME",
app_id="REPLACE_ME",
)
if first_page.has_next_page():
print(f"will fetch next page using these details: {first_page.next_page_info()}")
Expand All @@ -144,7 +144,7 @@ Or just work directly with the returned data:

```python
first_page = await client.apps.users.list(
"REPLACE_ME",
app_id="REPLACE_ME",
)

print(f"page number: {first_page.page}") # => "page number: 1"
Expand All @@ -171,7 +171,7 @@ client = Honcho()

try:
client.apps.create(
name="string",
name="name",
)
except honcho.APIConnectionError as e:
print("The server could not be reached")
Expand Down Expand Up @@ -216,7 +216,7 @@ client = Honcho(

# Or, configure per-request:
client.with_options(max_retries=5).apps.create(
name="string",
name="name",
)
```

Expand All @@ -241,7 +241,7 @@ client = Honcho(

# Override per-request:
client.with_options(timeout=5.0).apps.create(
name="string",
name="name",
)
```

Expand Down Expand Up @@ -282,7 +282,7 @@ from honcho import Honcho

client = Honcho()
response = client.apps.with_raw_response.create(
name="string",
name="name",
)
print(response.headers.get('X-My-Header'))

Expand All @@ -302,7 +302,7 @@ To stream the response body, use `.with_streaming_response` instead, which requi

```python
with client.apps.with_streaming_response.create(
name="string",
name="name",
) as response:
print(response.headers.get("X-My-Header"))

Expand Down Expand Up @@ -353,7 +353,7 @@ You can directly override the [httpx client](https://www.python-httpx.org/api/#c

- Support for proxies
- Custom transports
- Additional [advanced](https://www.python-httpx.org/advanced/#client-instances) functionality
- Additional [advanced](https://www.python-httpx.org/advanced/clients/) functionality

```python
from honcho import Honcho, DefaultHttpxClient
Expand All @@ -368,6 +368,12 @@ client = Honcho(
)
```

You can also customize the client on a per-request basis by using `with_options()`:

```python
client.with_options(http_client=DefaultHttpxClient(...))
```

### Managing HTTP resources

By default the library closes underlying HTTP connections whenever the client is [garbage collected](https://docs.python.org/3/reference/datamodel.html#object.__del__). You can manually close the client using the `.close()` method if desired, or with a context manager that closes when exiting.
Expand Down
3 changes: 3 additions & 0 deletions bin/publish-pypi
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,7 @@
set -eux
mkdir -p dist
rye build --clean
# Patching importlib-metadata version until upstream library version is updated
# https://github.com/pypa/twine/issues/977#issuecomment-2189800841
"$HOME/.rye/self/bin/python3" -m pip install 'importlib-metadata==7.2.1'
rye publish --yes --token=$PYPI_TOKEN
18 changes: 17 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "honcho-ai"
version = "0.0.12"
version = "0.0.13"
description = "The official Python library for the honcho API"
dynamic = ["readme"]
license = "Apache-2.0"
Expand Down Expand Up @@ -58,6 +58,7 @@ dev-dependencies = [
"nox",
"dirty-equals>=0.6.0",
"importlib-metadata>=6.7.0",
"rich>=13.7.1",

]

Expand Down Expand Up @@ -99,6 +100,21 @@ include = [
[tool.hatch.build.targets.wheel]
packages = ["src/honcho"]

[tool.hatch.build.targets.sdist]
# Basically everything except hidden files/directories (such as .github, .devcontainers, .python-version, etc)
include = [
"/*.toml",
"/*.json",
"/*.lock",
"/*.md",
"/mypy.ini",
"/noxfile.py",
"bin/*",
"examples/*",
"src/*",
"tests/*",
]

[tool.hatch.metadata.hooks.fancy-pypi-readme]
content-type = "text/markdown"

Expand Down
15 changes: 12 additions & 3 deletions requirements-dev.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@
# features: []
# all-features: true
# with-sources: false
# generate-hashes: false

-e file:.
annotated-types==0.6.0
# via pydantic
anyio==4.1.0
anyio==4.4.0
# via honcho-ai
# via httpx
argcomplete==3.1.2
Expand Down Expand Up @@ -44,7 +45,11 @@ idna==3.4
importlib-metadata==7.0.0
iniconfig==2.0.0
# via pytest
mypy==1.7.1
markdown-it-py==3.0.0
# via rich
mdurl==0.1.2
# via markdown-it-py
mypy==1.10.1
mypy-extensions==1.0.0
# via mypy
nodeenv==1.8.0
Expand All @@ -63,7 +68,9 @@ pydantic==2.7.1
# via honcho-ai
pydantic-core==2.18.2
# via pydantic
pyright==1.1.359
pygments==2.18.0
# via rich
pyright==1.1.364
pytest==7.1.1
# via pytest-asyncio
pytest-asyncio==0.21.1
Expand All @@ -72,6 +79,7 @@ python-dateutil==2.8.2
pytz==2023.3.post1
# via dirty-equals
respx==0.20.2
rich==13.7.1
ruff==0.1.9
setuptools==68.2.2
# via nodeenv
Expand All @@ -86,6 +94,7 @@ tomli==2.0.1
# via mypy
# via pytest
typing-extensions==4.8.0
# via anyio
# via honcho-ai
# via mypy
# via pydantic
Expand Down
Loading

0 comments on commit 3a95cf8

Please sign in to comment.