Skip to content

release: 1.1.0 #460

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 8 commits into from
Aug 8, 2024
Merged
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
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "1.0.0"
".": "1.1.0"
}
22 changes: 22 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,27 @@
# Changelog

## 1.1.0 (2024-08-07)

Full Changelog: [v1.0.0...v1.1.0](https://github.com/Finch-API/finch-api-python/compare/v1.0.0...v1.1.0)

### Features

* **client:** add `retries_taken` to raw response class ([#462](https://github.com/Finch-API/finch-api-python/issues/462)) ([b62b180](https://github.com/Finch-API/finch-api-python/commit/b62b1809ac2c111db20af9b117409a2b4473997e))


### Bug Fixes

* **client:** correctly serialise array body params ([#466](https://github.com/Finch-API/finch-api-python/issues/466)) ([f94c81e](https://github.com/Finch-API/finch-api-python/commit/f94c81e1ffb396afdfbd7635b348adfd586cc038))


### Chores

* **internal:** bump pyright ([#461](https://github.com/Finch-API/finch-api-python/issues/461)) ([113a133](https://github.com/Finch-API/finch-api-python/commit/113a133eedd14d1bd579b710d41a7ea51a75f603))
* **internal:** bump ruff version ([#464](https://github.com/Finch-API/finch-api-python/issues/464)) ([c440bcd](https://github.com/Finch-API/finch-api-python/commit/c440bcde1c636136baa2554b3e8ded69f604afdb))
* **internal:** test updates ([#463](https://github.com/Finch-API/finch-api-python/issues/463)) ([19c58e6](https://github.com/Finch-API/finch-api-python/commit/19c58e6a2b1ec2a4cc3c103e911236a4f10af687))
* **internal:** update pydantic compat helper function ([#465](https://github.com/Finch-API/finch-api-python/issues/465)) ([8656afe](https://github.com/Finch-API/finch-api-python/commit/8656afe878f85412712d85d52aa58068321ff792))
* **internal:** use `TypeAlias` marker for type assignments ([#459](https://github.com/Finch-API/finch-api-python/issues/459)) ([3c0445a](https://github.com/Finch-API/finch-api-python/commit/3c0445a107202b107fec3ee73226f576824d8b40))

## 1.0.0 (2024-08-01)

Full Changelog: [v0.23.1...v1.0.0](https://github.com/Finch-API/finch-api-python/compare/v0.23.1...v1.0.0)
Expand Down
14 changes: 8 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "finch-api"
version = "1.0.0"
version = "1.1.0"
description = "The official Python library for the Finch API"
dynamic = ["readme"]
license = "Apache-2.0"
Expand Down Expand Up @@ -77,8 +77,8 @@ format = { chain = [
"check:ruff",
"typecheck",
]}
"check:ruff" = "ruff ."
"fix:ruff" = "ruff --fix ."
"check:ruff" = "ruff check ."
"fix:ruff" = "ruff check --fix ."

typecheck = { chain = [
"typecheck:pyright",
Expand Down Expand Up @@ -162,6 +162,11 @@ reportPrivateUsage = false
line-length = 120
output-format = "grouped"
target-version = "py37"

[tool.ruff.format]
docstring-code-format = true

[tool.ruff.lint]
select = [
# isort
"I",
Expand Down Expand Up @@ -192,9 +197,6 @@ unfixable = [
]
ignore-init-module-imports = true

[tool.ruff.format]
docstring-code-format = true

[tool.ruff.lint.flake8-tidy-imports.banned-api]
"functools.lru_cache".msg = "This function does not retain type information for the wrapped function's arguments; The `lru_cache` function from `_utils` should be used instead"

Expand Down
4 changes: 2 additions & 2 deletions requirements-dev.lock
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ pydantic-core==2.18.2
# via pydantic
pygments==2.18.0
# via rich
pyright==1.1.364
pyright==1.1.374
pytest==7.1.1
# via pytest-asyncio
pytest-asyncio==0.21.1
Expand All @@ -80,7 +80,7 @@ pytz==2023.3.post1
# via dirty-equals
respx==0.20.2
rich==13.7.1
ruff==0.1.9
ruff==0.5.6
setuptools==68.2.2
# via nodeenv
six==1.16.0
Expand Down
73 changes: 31 additions & 42 deletions src/finch/_base_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,16 +125,14 @@ def __init__(
self,
*,
url: URL,
) -> None:
...
) -> None: ...

@overload
def __init__(
self,
*,
params: Query,
) -> None:
...
) -> None: ...

def __init__(
self,
Expand Down Expand Up @@ -167,8 +165,7 @@ def has_next_page(self) -> bool:
return False
return self.next_page_info() is not None

def next_page_info(self) -> Optional[PageInfo]:
...
def next_page_info(self) -> Optional[PageInfo]: ...

def _get_page_items(self) -> Iterable[_T]: # type: ignore[empty-body]
...
Expand Down Expand Up @@ -904,8 +901,7 @@ def request(
*,
stream: Literal[True],
stream_cls: Type[_StreamT],
) -> _StreamT:
...
) -> _StreamT: ...

@overload
def request(
Expand All @@ -915,8 +911,7 @@ def request(
remaining_retries: Optional[int] = None,
*,
stream: Literal[False] = False,
) -> ResponseT:
...
) -> ResponseT: ...

@overload
def request(
Expand All @@ -927,8 +922,7 @@ def request(
*,
stream: bool = False,
stream_cls: Type[_StreamT] | None = None,
) -> ResponseT | _StreamT:
...
) -> ResponseT | _StreamT: ...

def request(
self,
Expand Down Expand Up @@ -1050,6 +1044,7 @@ def _request(
response=response,
stream=stream,
stream_cls=stream_cls,
retries_taken=options.get_max_retries(self.max_retries) - retries,
)

def _retry_request(
Expand Down Expand Up @@ -1091,6 +1086,7 @@ def _process_response(
response: httpx.Response,
stream: bool,
stream_cls: type[Stream[Any]] | type[AsyncStream[Any]] | None,
retries_taken: int = 0,
) -> ResponseT:
if response.request.headers.get(RAW_RESPONSE_HEADER) == "true":
return cast(
Expand All @@ -1102,6 +1098,7 @@ def _process_response(
stream=stream,
stream_cls=stream_cls,
options=options,
retries_taken=retries_taken,
),
)

Expand All @@ -1121,6 +1118,7 @@ def _process_response(
stream=stream,
stream_cls=stream_cls,
options=options,
retries_taken=retries_taken,
),
)

Expand All @@ -1134,6 +1132,7 @@ def _process_response(
stream=stream,
stream_cls=stream_cls,
options=options,
retries_taken=retries_taken,
)
if bool(response.request.headers.get(RAW_RESPONSE_HEADER)):
return cast(ResponseT, api_response)
Expand Down Expand Up @@ -1166,8 +1165,7 @@ def get(
cast_to: Type[ResponseT],
options: RequestOptions = {},
stream: Literal[False] = False,
) -> ResponseT:
...
) -> ResponseT: ...

@overload
def get(
Expand All @@ -1178,8 +1176,7 @@ def get(
options: RequestOptions = {},
stream: Literal[True],
stream_cls: type[_StreamT],
) -> _StreamT:
...
) -> _StreamT: ...

@overload
def get(
Expand All @@ -1190,8 +1187,7 @@ def get(
options: RequestOptions = {},
stream: bool,
stream_cls: type[_StreamT] | None = None,
) -> ResponseT | _StreamT:
...
) -> ResponseT | _StreamT: ...

def get(
self,
Expand All @@ -1217,8 +1213,7 @@ def post(
options: RequestOptions = {},
files: RequestFiles | None = None,
stream: Literal[False] = False,
) -> ResponseT:
...
) -> ResponseT: ...

@overload
def post(
Expand All @@ -1231,8 +1226,7 @@ def post(
files: RequestFiles | None = None,
stream: Literal[True],
stream_cls: type[_StreamT],
) -> _StreamT:
...
) -> _StreamT: ...

@overload
def post(
Expand All @@ -1245,8 +1239,7 @@ def post(
files: RequestFiles | None = None,
stream: bool,
stream_cls: type[_StreamT] | None = None,
) -> ResponseT | _StreamT:
...
) -> ResponseT | _StreamT: ...

def post(
self,
Expand Down Expand Up @@ -1479,8 +1472,7 @@ async def request(
*,
stream: Literal[False] = False,
remaining_retries: Optional[int] = None,
) -> ResponseT:
...
) -> ResponseT: ...

@overload
async def request(
Expand All @@ -1491,8 +1483,7 @@ async def request(
stream: Literal[True],
stream_cls: type[_AsyncStreamT],
remaining_retries: Optional[int] = None,
) -> _AsyncStreamT:
...
) -> _AsyncStreamT: ...

@overload
async def request(
Expand All @@ -1503,8 +1494,7 @@ async def request(
stream: bool,
stream_cls: type[_AsyncStreamT] | None = None,
remaining_retries: Optional[int] = None,
) -> ResponseT | _AsyncStreamT:
...
) -> ResponseT | _AsyncStreamT: ...

async def request(
self,
Expand Down Expand Up @@ -1624,6 +1614,7 @@ async def _request(
response=response,
stream=stream,
stream_cls=stream_cls,
retries_taken=options.get_max_retries(self.max_retries) - retries,
)

async def _retry_request(
Expand Down Expand Up @@ -1663,6 +1654,7 @@ async def _process_response(
response: httpx.Response,
stream: bool,
stream_cls: type[Stream[Any]] | type[AsyncStream[Any]] | None,
retries_taken: int = 0,
) -> ResponseT:
if response.request.headers.get(RAW_RESPONSE_HEADER) == "true":
return cast(
Expand All @@ -1674,6 +1666,7 @@ async def _process_response(
stream=stream,
stream_cls=stream_cls,
options=options,
retries_taken=retries_taken,
),
)

Expand All @@ -1693,6 +1686,7 @@ async def _process_response(
stream=stream,
stream_cls=stream_cls,
options=options,
retries_taken=retries_taken,
),
)

Expand All @@ -1706,6 +1700,7 @@ async def _process_response(
stream=stream,
stream_cls=stream_cls,
options=options,
retries_taken=retries_taken,
)
if bool(response.request.headers.get(RAW_RESPONSE_HEADER)):
return cast(ResponseT, api_response)
Expand All @@ -1728,8 +1723,7 @@ async def get(
cast_to: Type[ResponseT],
options: RequestOptions = {},
stream: Literal[False] = False,
) -> ResponseT:
...
) -> ResponseT: ...

@overload
async def get(
Expand All @@ -1740,8 +1734,7 @@ async def get(
options: RequestOptions = {},
stream: Literal[True],
stream_cls: type[_AsyncStreamT],
) -> _AsyncStreamT:
...
) -> _AsyncStreamT: ...

@overload
async def get(
Expand All @@ -1752,8 +1745,7 @@ async def get(
options: RequestOptions = {},
stream: bool,
stream_cls: type[_AsyncStreamT] | None = None,
) -> ResponseT | _AsyncStreamT:
...
) -> ResponseT | _AsyncStreamT: ...

async def get(
self,
Expand All @@ -1777,8 +1769,7 @@ async def post(
files: RequestFiles | None = None,
options: RequestOptions = {},
stream: Literal[False] = False,
) -> ResponseT:
...
) -> ResponseT: ...

@overload
async def post(
Expand All @@ -1791,8 +1782,7 @@ async def post(
options: RequestOptions = {},
stream: Literal[True],
stream_cls: type[_AsyncStreamT],
) -> _AsyncStreamT:
...
) -> _AsyncStreamT: ...

@overload
async def post(
Expand All @@ -1805,8 +1795,7 @@ async def post(
options: RequestOptions = {},
stream: bool,
stream_cls: type[_AsyncStreamT] | None = None,
) -> ResponseT | _AsyncStreamT:
...
) -> ResponseT | _AsyncStreamT: ...

async def post(
self,
Expand Down
Loading