Skip to content

release: 0.13.0 #262

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

Merged
merged 18 commits into from
Jan 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
60bc727
feat(client): add support for streaming raw responses (#261)
stainless-bot Jan 15, 2024
c969f5b
fix(client): ensure path params are non-empty (#263)
stainless-bot Jan 16, 2024
6d1df20
chore(internal): updates to proxy helper (#264)
stainless-bot Jan 16, 2024
152fafc
chore: add write_to_file binary helper method (#265)
stainless-bot Jan 16, 2024
1c716b1
chore(internal): fix typing util function (#266)
stainless-bot Jan 17, 2024
1549d50
chore(internal): speculative retry-after-ms support (#267)
stainless-bot Jan 17, 2024
1f75530
chore: lazy load raw resource class properties (#268)
stainless-bot Jan 17, 2024
864900e
chore(ci): rely on Stainless GitHub App for releases (#269)
stainless-bot Jan 17, 2024
f1d513b
feat(api): add employer_contributions field (#270)
stainless-bot Jan 18, 2024
23c95da
chore(internal): share client instances between all tests (#271)
stainless-bot Jan 18, 2024
c377864
chore(internal): add internal helpers (#272)
stainless-bot Jan 22, 2024
72b922e
feat(client): enable follow redirects by default (#273)
stainless-bot Jan 24, 2024
cd412ed
chore(internal): support multipart data with overlapping keys (#274)
stainless-bot Jan 26, 2024
7c8a13b
chore(internal): enable ruff type checking misuse lint rule (#275)
stainless-bot Jan 26, 2024
85c0e90
fix(api): fix authentication_type enum (#276)
stainless-bot Jan 26, 2024
c36ff77
feat(client): support parsing custom response types (#277)
stainless-bot Jan 29, 2024
526eeab
fix(api): update `employer_size` parameter to `employee_size` (#278)
stainless-bot Jan 29, 2024
357ce53
release: 0.13.0
stainless-bot Jan 30, 2024
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
38 changes: 0 additions & 38 deletions .github/workflows/create-releases.yml

This file was deleted.

24 changes: 0 additions & 24 deletions .github/workflows/handle-release-pr-title-edit.yml

This file was deleted.

8 changes: 6 additions & 2 deletions .github/workflows/publish-pypi.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
# workflow for re-running publishing to PyPI in case it fails for some reason
# you can run this workflow by navigating to https://www.github.com/Finch-API/finch-api-python/actions/workflows/publish-pypi.yml
# This workflow is triggered when a GitHub release is created.
# It can also be run manually to re-publish to PyPI in case it failed for some reason.
# You can run this workflow by navigating to https://www.github.com/Finch-API/finch-api-python/actions/workflows/publish-pypi.yml
name: Publish PyPI
on:
workflow_dispatch:

release:
types: [published]

jobs:
publish:
name: publish
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/release-doctor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,4 @@ jobs:
run: |
bash ./bin/check-release-environment
env:
STAINLESS_API_KEY: ${{ secrets.STAINLESS_API_KEY }}
PYPI_TOKEN: ${{ secrets.FINCH_PYPI_TOKEN || secrets.PYPI_TOKEN }}
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.12.0"
".": "0.13.0"
}
32 changes: 32 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,37 @@
# Changelog

## 0.13.0 (2024-01-30)

Full Changelog: [v0.12.0...v0.13.0](https://github.com/Finch-API/finch-api-python/compare/v0.12.0...v0.13.0)

### Features

* **api:** add employer_contributions field ([#270](https://github.com/Finch-API/finch-api-python/issues/270)) ([f1d513b](https://github.com/Finch-API/finch-api-python/commit/f1d513bb0883aca5ced29e4a59b44542abb680ad))
* **client:** add support for streaming raw responses ([#261](https://github.com/Finch-API/finch-api-python/issues/261)) ([60bc727](https://github.com/Finch-API/finch-api-python/commit/60bc727188ed804cb48bfc2fc24d26da4d79a27c))
* **client:** enable follow redirects by default ([#273](https://github.com/Finch-API/finch-api-python/issues/273)) ([72b922e](https://github.com/Finch-API/finch-api-python/commit/72b922ea3c73eb7a6d12b6634a6b7b265be4f692))
* **client:** support parsing custom response types ([#277](https://github.com/Finch-API/finch-api-python/issues/277)) ([c36ff77](https://github.com/Finch-API/finch-api-python/commit/c36ff776522876c4688a205869a3e22e7aa6c976))


### Bug Fixes

* **api:** fix authentication_type enum ([#276](https://github.com/Finch-API/finch-api-python/issues/276)) ([85c0e90](https://github.com/Finch-API/finch-api-python/commit/85c0e90321b1f30868476fd2f4ae368cde5135bc))
* **api:** update `employer_size` parameter to `employee_size` ([#278](https://github.com/Finch-API/finch-api-python/issues/278)) ([526eeab](https://github.com/Finch-API/finch-api-python/commit/526eeab21a6101d0e96f7cdabec0ce3edf621812))
* **client:** ensure path params are non-empty ([#263](https://github.com/Finch-API/finch-api-python/issues/263)) ([c969f5b](https://github.com/Finch-API/finch-api-python/commit/c969f5b39878d410514728489a19725eba9fefaa))


### Chores

* add write_to_file binary helper method ([#265](https://github.com/Finch-API/finch-api-python/issues/265)) ([152fafc](https://github.com/Finch-API/finch-api-python/commit/152fafc6f7931407bd9669b1cca01b50ab381624))
* **ci:** rely on Stainless GitHub App for releases ([#269](https://github.com/Finch-API/finch-api-python/issues/269)) ([864900e](https://github.com/Finch-API/finch-api-python/commit/864900e0e66bbc997a2bbcd42b2ebd99a2f6a782))
* **internal:** add internal helpers ([#272](https://github.com/Finch-API/finch-api-python/issues/272)) ([c377864](https://github.com/Finch-API/finch-api-python/commit/c37786436fcb348933c7b186d9e2e4cd953e1dee))
* **internal:** enable ruff type checking misuse lint rule ([#275](https://github.com/Finch-API/finch-api-python/issues/275)) ([7c8a13b](https://github.com/Finch-API/finch-api-python/commit/7c8a13bfe250c150a9aca72748f1b3d898ac29ae))
* **internal:** fix typing util function ([#266](https://github.com/Finch-API/finch-api-python/issues/266)) ([1c716b1](https://github.com/Finch-API/finch-api-python/commit/1c716b1c143ccaf8ae5a43a6cb98f1a1f313ae70))
* **internal:** share client instances between all tests ([#271](https://github.com/Finch-API/finch-api-python/issues/271)) ([23c95da](https://github.com/Finch-API/finch-api-python/commit/23c95da41afbb7315c7a8f00be52f5c53c369bd6))
* **internal:** speculative retry-after-ms support ([#267](https://github.com/Finch-API/finch-api-python/issues/267)) ([1549d50](https://github.com/Finch-API/finch-api-python/commit/1549d5007158207b9d3c399e5d0a739b10f80184))
* **internal:** support multipart data with overlapping keys ([#274](https://github.com/Finch-API/finch-api-python/issues/274)) ([cd412ed](https://github.com/Finch-API/finch-api-python/commit/cd412ed95b3925924f31ca86fdb882005685488c))
* **internal:** updates to proxy helper ([#264](https://github.com/Finch-API/finch-api-python/issues/264)) ([6d1df20](https://github.com/Finch-API/finch-api-python/commit/6d1df207d81021c3e11cbec9a8d8a158f178895c))
* lazy load raw resource class properties ([#268](https://github.com/Finch-API/finch-api-python/issues/268)) ([1f75530](https://github.com/Finch-API/finch-api-python/commit/1f755305f8842d6fa47464c4d18a935d5a47ea8b))

## 0.12.0 (2024-01-12)

Full Changelog: [v0.11.0...v0.12.0](https://github.com/Finch-API/finch-api-python/compare/v0.11.0...v0.12.0)
Expand Down
29 changes: 27 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ if response.my_field is None:

### Accessing raw response data (e.g. headers)

The "raw" Response object can be accessed by prefixing `.with_raw_response.` to any HTTP method call.
The "raw" Response object can be accessed by prefixing `.with_raw_response.` to any HTTP method call, e.g.,

```py
from finch import Finch
Expand All @@ -308,7 +308,32 @@ directory = response.parse() # get the object that `hris.directory.list()` woul
print(directory.id)
```

These methods return an [`APIResponse`](https://github.com/Finch-API/finch-api-python/tree/main/src/finch/_response.py) object.
These methods return an [`LegacyAPIResponse`](https://github.com/Finch-API/finch-api-python/tree/main/src/finch/_legacy_response.py) object. This is a legacy class as we're changing it slightly in the next major version.

For the sync client this will mostly be the same with the exception
of `content` & `text` will be methods instead of properties. In the
async client, all methods will be async.

A migration script will be provided & the migration in general should
be smooth.

#### `.with_streaming_response`

The above interface eagerly reads the full response body when you make the request, which may not always be what you want.

To stream the response body, use `.with_streaming_response` instead, which requires a context manager and only reads the response body once you call `.read()`, `.text()`, `.json()`, `.iter_bytes()`, `.iter_text()`, `.iter_lines()` or `.parse()`. In the async client, these are async methods.

As such, `.with_streaming_response` methods return a different [`APIResponse`](https://github.com/Finch-API/finch-api-python/tree/main/src/finch/_response.py) object, and the async client returns an [`AsyncAPIResponse`](https://github.com/Finch-API/finch-api-python/tree/main/src/finch/_response.py) object.

```python
with client.hris.directory.with_streaming_response.list() as response:
print(response.headers.get("X-My-Header"))

for line in response.iter_lines():
print(line)
```

The context manager is required so that the response will reliably be closed.

### Configuring the HTTP client

Expand Down
4 changes: 0 additions & 4 deletions bin/check-release-environment
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@

errors=()

if [ -z "${STAINLESS_API_KEY}" ]; then
errors+=("The STAINLESS_API_KEY secret has not been set. Please contact Stainless for an API key & set it in your organization secrets on GitHub.")
fi

if [ -z "${PYPI_TOKEN}" ]; then
errors+=("The FINCH_PYPI_TOKEN secret has not been set. Please set it in either this repository's secrets or your organization secrets.")
fi
Expand Down
4 changes: 3 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "finch-api"
version = "0.12.0"
version = "0.13.0"
description = "The official Python library for the Finch API"
readme = "README.md"
license = "Apache-2.0"
Expand Down Expand Up @@ -144,6 +144,8 @@ select = [
# print statements
"T201",
"T203",
# misuse of typing.TYPE_CHECKING
"TCH004"
]
ignore = [
# mutable defaults
Expand Down
3 changes: 3 additions & 0 deletions src/finch/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
from ._types import NoneType, Transport, ProxiesTypes
from ._utils import file_from_path
from ._client import Finch, Client, Stream, Timeout, Transport, AsyncFinch, AsyncClient, AsyncStream, RequestOptions
from ._models import BaseModel
from ._version import __title__, __version__
from ._response import APIResponse as APIResponse, AsyncAPIResponse as AsyncAPIResponse
from ._exceptions import (
APIError,
FinchError,
Expand Down Expand Up @@ -53,6 +55,7 @@
"Finch",
"AsyncFinch",
"file_from_path",
"BaseModel",
]

_setup_logging()
Expand Down
Loading