Skip to content

release: 0.21.5 #410

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 4 commits into from
Jun 28, 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 @@
{
".": "0.21.4"
".": "0.21.5"
}
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
# Changelog

## 0.21.5 (2024-06-28)

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

### Bug Fixes

* **build:** include more files in sdist builds ([#409](https://github.com/Finch-API/finch-api-python/issues/409)) ([1508b49](https://github.com/Finch-API/finch-api-python/commit/1508b49756620d8fda71886beb750bc0bdc05d89))


### Chores

* **deps:** bump anyio to v4.4.0 ([#411](https://github.com/Finch-API/finch-api-python/issues/411)) ([45c5047](https://github.com/Finch-API/finch-api-python/commit/45c50471351af8213f414d60c269fbf3e2b4e4bd))
* **internal:** add reflection helper function ([#412](https://github.com/Finch-API/finch-api-python/issues/412)) ([1e84873](https://github.com/Finch-API/finch-api-python/commit/1e848737d7505b57702604b8e95c3a8c85c75bc9))

## 0.21.4 (2024-06-26)

Full Changelog: [v0.21.3...v0.21.4](https://github.com/Finch-API/finch-api-python/compare/v0.21.3...v0.21.4)
Expand Down
17 changes: 16 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.21.4"
version = "0.21.5"
description = "The official Python library for the Finch API"
dynamic = ["readme"]
license = "Apache-2.0"
Expand Down Expand Up @@ -99,6 +99,21 @@ include = [
[tool.hatch.build.targets.wheel]
packages = ["src/finch"]

[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
3 changes: 2 additions & 1 deletion requirements-dev.lock
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
-e file:.
annotated-types==0.6.0
# via pydantic
anyio==4.1.0
anyio==4.4.0
# via finch-api
# via httpx
argcomplete==3.1.2
Expand Down Expand Up @@ -86,6 +86,7 @@ tomli==2.0.1
# via mypy
# via pytest
typing-extensions==4.8.0
# via anyio
# via finch-api
# via mypy
# via pydantic
Expand Down
3 changes: 2 additions & 1 deletion requirements.lock
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
-e file:.
annotated-types==0.6.0
# via pydantic
anyio==4.1.0
anyio==4.4.0
# via finch-api
# via httpx
certifi==2023.7.22
Expand Down Expand Up @@ -38,6 +38,7 @@ sniffio==1.3.0
# via finch-api
# via httpx
typing-extensions==4.8.0
# via anyio
# via finch-api
# via pydantic
# via pydantic-core
5 changes: 4 additions & 1 deletion src/finch/_utils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,7 @@
maybe_transform as maybe_transform,
async_maybe_transform as async_maybe_transform,
)
from ._reflection import function_has_argument as function_has_argument
from ._reflection import (
function_has_argument as function_has_argument,
assert_signatures_in_sync as assert_signatures_in_sync,
)
34 changes: 34 additions & 0 deletions src/finch/_utils/_reflection.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import annotations

import inspect
from typing import Any, Callable

Expand All @@ -6,3 +8,35 @@ def function_has_argument(func: Callable[..., Any], arg_name: str) -> bool:
"""Returns whether or not the given function has a specific parameter"""
sig = inspect.signature(func)
return arg_name in sig.parameters


def assert_signatures_in_sync(
source_func: Callable[..., Any],
check_func: Callable[..., Any],
*,
exclude_params: set[str] = set(),
) -> None:
"""Ensure that the signature of the second function matches the first."""

check_sig = inspect.signature(check_func)
source_sig = inspect.signature(source_func)

errors: list[str] = []

for name, source_param in source_sig.parameters.items():
if name in exclude_params:
continue

custom_param = check_sig.parameters.get(name)
if not custom_param:
errors.append(f"the `{name}` param is missing")
continue

if custom_param.annotation != source_param.annotation:
errors.append(
f"types for the `{name}` param are do not match; source={repr(source_param.annotation)} checking={repr(source_param.annotation)}"
)
continue

if errors:
raise AssertionError(f"{len(errors)} errors encountered when comparing signatures:\n\n" + "\n\n".join(errors))
2 changes: 1 addition & 1 deletion src/finch/_version.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

__title__ = "finch"
__version__ = "0.21.4" # x-release-please-version
__version__ = "0.21.5" # x-release-please-version