spitch 1.27.0__tar.gz → 1.27.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of spitch might be problematic. Click here for more details.
- spitch-1.27.1/.release-please-manifest.json +3 -0
- {spitch-1.27.0 → spitch-1.27.1}/CHANGELOG.md +18 -0
- {spitch-1.27.0 → spitch-1.27.1}/PKG-INFO +3 -3
- {spitch-1.27.0 → spitch-1.27.1}/README.md +2 -2
- {spitch-1.27.0 → spitch-1.27.1}/pyproject.toml +1 -1
- {spitch-1.27.0 → spitch-1.27.1}/src/spitch/_version.py +1 -1
- {spitch-1.27.0 → spitch-1.27.1}/tests/test_client.py +12 -41
- spitch-1.27.0/.release-please-manifest.json +0 -3
- {spitch-1.27.0 → spitch-1.27.1}/.gitignore +0 -0
- {spitch-1.27.0 → spitch-1.27.1}/CONTRIBUTING.md +0 -0
- {spitch-1.27.0 → spitch-1.27.1}/LICENSE +0 -0
- {spitch-1.27.0 → spitch-1.27.1}/SECURITY.md +0 -0
- {spitch-1.27.0 → spitch-1.27.1}/api.md +0 -0
- {spitch-1.27.0 → spitch-1.27.1}/bin/check-release-environment +0 -0
- {spitch-1.27.0 → spitch-1.27.1}/bin/publish-pypi +0 -0
- {spitch-1.27.0 → spitch-1.27.1}/examples/.keep +0 -0
- {spitch-1.27.0 → spitch-1.27.1}/examples/example.py +0 -0
- {spitch-1.27.0 → spitch-1.27.1}/mypy.ini +0 -0
- {spitch-1.27.0 → spitch-1.27.1}/noxfile.py +0 -0
- {spitch-1.27.0 → spitch-1.27.1}/release-please-config.json +0 -0
- {spitch-1.27.0 → spitch-1.27.1}/requirements-dev.lock +0 -0
- {spitch-1.27.0 → spitch-1.27.1}/requirements.lock +0 -0
- {spitch-1.27.0 → spitch-1.27.1}/src/spitch/__init__.py +0 -0
- {spitch-1.27.0 → spitch-1.27.1}/src/spitch/_base_client.py +0 -0
- {spitch-1.27.0 → spitch-1.27.1}/src/spitch/_client.py +0 -0
- {spitch-1.27.0 → spitch-1.27.1}/src/spitch/_compat.py +0 -0
- {spitch-1.27.0 → spitch-1.27.1}/src/spitch/_constants.py +0 -0
- {spitch-1.27.0 → spitch-1.27.1}/src/spitch/_exceptions.py +0 -0
- {spitch-1.27.0 → spitch-1.27.1}/src/spitch/_files.py +0 -0
- {spitch-1.27.0 → spitch-1.27.1}/src/spitch/_models.py +0 -0
- {spitch-1.27.0 → spitch-1.27.1}/src/spitch/_qs.py +0 -0
- {spitch-1.27.0 → spitch-1.27.1}/src/spitch/_resource.py +0 -0
- {spitch-1.27.0 → spitch-1.27.1}/src/spitch/_response.py +0 -0
- {spitch-1.27.0 → spitch-1.27.1}/src/spitch/_streaming.py +0 -0
- {spitch-1.27.0 → spitch-1.27.1}/src/spitch/_types.py +0 -0
- {spitch-1.27.0 → spitch-1.27.1}/src/spitch/_utils/__init__.py +0 -0
- {spitch-1.27.0 → spitch-1.27.1}/src/spitch/_utils/_logs.py +0 -0
- {spitch-1.27.0 → spitch-1.27.1}/src/spitch/_utils/_proxy.py +0 -0
- {spitch-1.27.0 → spitch-1.27.1}/src/spitch/_utils/_reflection.py +0 -0
- {spitch-1.27.0 → spitch-1.27.1}/src/spitch/_utils/_resources_proxy.py +0 -0
- {spitch-1.27.0 → spitch-1.27.1}/src/spitch/_utils/_streams.py +0 -0
- {spitch-1.27.0 → spitch-1.27.1}/src/spitch/_utils/_sync.py +0 -0
- {spitch-1.27.0 → spitch-1.27.1}/src/spitch/_utils/_transform.py +0 -0
- {spitch-1.27.0 → spitch-1.27.1}/src/spitch/_utils/_typing.py +0 -0
- {spitch-1.27.0 → spitch-1.27.1}/src/spitch/_utils/_utils.py +0 -0
- {spitch-1.27.0 → spitch-1.27.1}/src/spitch/lib/.keep +0 -0
- {spitch-1.27.0 → spitch-1.27.1}/src/spitch/py.typed +0 -0
- {spitch-1.27.0 → spitch-1.27.1}/src/spitch/resources/__init__.py +0 -0
- {spitch-1.27.0 → spitch-1.27.1}/src/spitch/resources/speech.py +0 -0
- {spitch-1.27.0 → spitch-1.27.1}/src/spitch/resources/text.py +0 -0
- {spitch-1.27.0 → spitch-1.27.1}/src/spitch/types/__init__.py +0 -0
- {spitch-1.27.0 → spitch-1.27.1}/src/spitch/types/speech_generate_params.py +0 -0
- {spitch-1.27.0 → spitch-1.27.1}/src/spitch/types/speech_transcribe_params.py +0 -0
- {spitch-1.27.0 → spitch-1.27.1}/src/spitch/types/speech_transcribe_response.py +0 -0
- {spitch-1.27.0 → spitch-1.27.1}/src/spitch/types/text_tone_mark_params.py +0 -0
- {spitch-1.27.0 → spitch-1.27.1}/src/spitch/types/text_tone_mark_response.py +0 -0
- {spitch-1.27.0 → spitch-1.27.1}/src/spitch/types/text_translate_params.py +0 -0
- {spitch-1.27.0 → spitch-1.27.1}/src/spitch/types/text_translate_response.py +0 -0
- {spitch-1.27.0 → spitch-1.27.1}/tests/__init__.py +0 -0
- {spitch-1.27.0 → spitch-1.27.1}/tests/api_resources/__init__.py +0 -0
- {spitch-1.27.0 → spitch-1.27.1}/tests/api_resources/test_speech.py +0 -0
- {spitch-1.27.0 → spitch-1.27.1}/tests/api_resources/test_text.py +0 -0
- {spitch-1.27.0 → spitch-1.27.1}/tests/conftest.py +0 -0
- {spitch-1.27.0 → spitch-1.27.1}/tests/sample_file.txt +0 -0
- {spitch-1.27.0 → spitch-1.27.1}/tests/test_deepcopy.py +0 -0
- {spitch-1.27.0 → spitch-1.27.1}/tests/test_extract_files.py +0 -0
- {spitch-1.27.0 → spitch-1.27.1}/tests/test_files.py +0 -0
- {spitch-1.27.0 → spitch-1.27.1}/tests/test_models.py +0 -0
- {spitch-1.27.0 → spitch-1.27.1}/tests/test_qs.py +0 -0
- {spitch-1.27.0 → spitch-1.27.1}/tests/test_required_args.py +0 -0
- {spitch-1.27.0 → spitch-1.27.1}/tests/test_response.py +0 -0
- {spitch-1.27.0 → spitch-1.27.1}/tests/test_streaming.py +0 -0
- {spitch-1.27.0 → spitch-1.27.1}/tests/test_transform.py +0 -0
- {spitch-1.27.0 → spitch-1.27.1}/tests/test_utils/test_proxy.py +0 -0
- {spitch-1.27.0 → spitch-1.27.1}/tests/test_utils/test_typing.py +0 -0
- {spitch-1.27.0 → spitch-1.27.1}/tests/utils.py +0 -0
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.27.1 (2025-06-19)
|
|
4
|
+
|
|
5
|
+
Full Changelog: [v1.27.0...v1.27.1](https://github.com/spi-tch/spitch-python/compare/v1.27.0...v1.27.1)
|
|
6
|
+
|
|
7
|
+
### Bug Fixes
|
|
8
|
+
|
|
9
|
+
* **tests:** fix: tests which call HTTP endpoints directly with the example parameters ([e6df2f6](https://github.com/spi-tch/spitch-python/commit/e6df2f6b390f5f3313ff1e20ee2890fd2ac53265))
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
### Chores
|
|
13
|
+
|
|
14
|
+
* **readme:** update badges ([d272526](https://github.com/spi-tch/spitch-python/commit/d2725265a638bba5ef65bf8ab468a33af6b5b594))
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Documentation
|
|
18
|
+
|
|
19
|
+
* **client:** fix httpx.Timeout documentation reference ([d8af609](https://github.com/spi-tch/spitch-python/commit/d8af609deca7a01713250544babf4ced45dc2376))
|
|
20
|
+
|
|
3
21
|
## 1.27.0 (2025-06-17)
|
|
4
22
|
|
|
5
23
|
Full Changelog: [v1.26.0...v1.27.0](https://github.com/spi-tch/spitch-python/compare/v1.26.0...v1.27.0)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: spitch
|
|
3
|
-
Version: 1.27.
|
|
3
|
+
Version: 1.27.1
|
|
4
4
|
Summary: The official Python library for the spitch API
|
|
5
5
|
Project-URL: Homepage, https://github.com/spi-tch/spitch-python
|
|
6
6
|
Project-URL: Repository, https://github.com/spi-tch/spitch-python
|
|
@@ -32,7 +32,7 @@ Description-Content-Type: text/markdown
|
|
|
32
32
|
|
|
33
33
|
# Spitch Python API library
|
|
34
34
|
|
|
35
|
-
[](https://pypi.org/project/spitch/)
|
|
35
|
+
[>)](https://pypi.org/project/spitch/)
|
|
36
36
|
|
|
37
37
|
The Spitch Python library provides convenient access to the Spitch REST API from any Python 3.8+
|
|
38
38
|
application. The library includes type definitions for all request params and response fields,
|
|
@@ -202,7 +202,7 @@ client.with_options(max_retries=5).speech.generate(
|
|
|
202
202
|
### Timeouts
|
|
203
203
|
|
|
204
204
|
By default requests time out after 1 minute. You can configure this with a `timeout` option,
|
|
205
|
-
which accepts a float or an [`httpx.Timeout`](https://www.python-httpx.org/advanced/#fine-tuning-the-configuration) object:
|
|
205
|
+
which accepts a float or an [`httpx.Timeout`](https://www.python-httpx.org/advanced/timeouts/#fine-tuning-the-configuration) object:
|
|
206
206
|
|
|
207
207
|
```python
|
|
208
208
|
from spitch import Spitch
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Spitch Python API library
|
|
2
2
|
|
|
3
|
-
[](https://pypi.org/project/spitch/)
|
|
3
|
+
[>)](https://pypi.org/project/spitch/)
|
|
4
4
|
|
|
5
5
|
The Spitch Python library provides convenient access to the Spitch REST API from any Python 3.8+
|
|
6
6
|
application. The library includes type definitions for all request params and response fields,
|
|
@@ -170,7 +170,7 @@ client.with_options(max_retries=5).speech.generate(
|
|
|
170
170
|
### Timeouts
|
|
171
171
|
|
|
172
172
|
By default requests time out after 1 minute. You can configure this with a `timeout` option,
|
|
173
|
-
which accepts a float or an [`httpx.Timeout`](https://www.python-httpx.org/advanced/#fine-tuning-the-configuration) object:
|
|
173
|
+
which accepts a float or an [`httpx.Timeout`](https://www.python-httpx.org/advanced/timeouts/#fine-tuning-the-configuration) object:
|
|
174
174
|
|
|
175
175
|
```python
|
|
176
176
|
from spitch import Spitch
|
|
@@ -23,9 +23,7 @@ from pydantic import ValidationError
|
|
|
23
23
|
|
|
24
24
|
from spitch import Spitch, AsyncSpitch, APIResponseValidationError
|
|
25
25
|
from spitch._types import Omit
|
|
26
|
-
from spitch._utils import maybe_transform
|
|
27
26
|
from spitch._models import BaseModel, FinalRequestOptions
|
|
28
|
-
from spitch._constants import RAW_RESPONSE_HEADER
|
|
29
27
|
from spitch._exceptions import SpitchError, APIStatusError, APITimeoutError, APIResponseValidationError
|
|
30
28
|
from spitch._base_client import (
|
|
31
29
|
DEFAULT_TIMEOUT,
|
|
@@ -35,7 +33,6 @@ from spitch._base_client import (
|
|
|
35
33
|
DefaultAsyncHttpxClient,
|
|
36
34
|
make_request_options,
|
|
37
35
|
)
|
|
38
|
-
from spitch.types.speech_generate_params import SpeechGenerateParams
|
|
39
36
|
|
|
40
37
|
from .utils import update_env
|
|
41
38
|
|
|
@@ -713,36 +710,21 @@ class TestSpitch:
|
|
|
713
710
|
|
|
714
711
|
@mock.patch("spitch._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout)
|
|
715
712
|
@pytest.mark.respx(base_url=base_url)
|
|
716
|
-
def test_retrying_timeout_errors_doesnt_leak(self, respx_mock: MockRouter) -> None:
|
|
713
|
+
def test_retrying_timeout_errors_doesnt_leak(self, respx_mock: MockRouter, client: Spitch) -> None:
|
|
717
714
|
respx_mock.post("/v1/speech").mock(side_effect=httpx.TimeoutException("Test timeout error"))
|
|
718
715
|
|
|
719
716
|
with pytest.raises(APITimeoutError):
|
|
720
|
-
|
|
721
|
-
"/v1/speech",
|
|
722
|
-
body=cast(
|
|
723
|
-
object, maybe_transform(dict(language="yo", text="text", voice="sade"), SpeechGenerateParams)
|
|
724
|
-
),
|
|
725
|
-
cast_to=httpx.Response,
|
|
726
|
-
options={"headers": {RAW_RESPONSE_HEADER: "stream"}},
|
|
727
|
-
)
|
|
717
|
+
client.speech.with_streaming_response.generate(language="yo", text="text", voice="sade").__enter__()
|
|
728
718
|
|
|
729
719
|
assert _get_open_connections(self.client) == 0
|
|
730
720
|
|
|
731
721
|
@mock.patch("spitch._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout)
|
|
732
722
|
@pytest.mark.respx(base_url=base_url)
|
|
733
|
-
def test_retrying_status_errors_doesnt_leak(self, respx_mock: MockRouter) -> None:
|
|
723
|
+
def test_retrying_status_errors_doesnt_leak(self, respx_mock: MockRouter, client: Spitch) -> None:
|
|
734
724
|
respx_mock.post("/v1/speech").mock(return_value=httpx.Response(500))
|
|
735
725
|
|
|
736
726
|
with pytest.raises(APIStatusError):
|
|
737
|
-
|
|
738
|
-
"/v1/speech",
|
|
739
|
-
body=cast(
|
|
740
|
-
object, maybe_transform(dict(language="yo", text="text", voice="sade"), SpeechGenerateParams)
|
|
741
|
-
),
|
|
742
|
-
cast_to=httpx.Response,
|
|
743
|
-
options={"headers": {RAW_RESPONSE_HEADER: "stream"}},
|
|
744
|
-
)
|
|
745
|
-
|
|
727
|
+
client.speech.with_streaming_response.generate(language="yo", text="text", voice="sade").__enter__()
|
|
746
728
|
assert _get_open_connections(self.client) == 0
|
|
747
729
|
|
|
748
730
|
@pytest.mark.parametrize("failures_before_success", [0, 2, 4])
|
|
@@ -1546,36 +1528,25 @@ class TestAsyncSpitch:
|
|
|
1546
1528
|
|
|
1547
1529
|
@mock.patch("spitch._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout)
|
|
1548
1530
|
@pytest.mark.respx(base_url=base_url)
|
|
1549
|
-
async def test_retrying_timeout_errors_doesnt_leak(self, respx_mock: MockRouter) -> None:
|
|
1531
|
+
async def test_retrying_timeout_errors_doesnt_leak(self, respx_mock: MockRouter, async_client: AsyncSpitch) -> None:
|
|
1550
1532
|
respx_mock.post("/v1/speech").mock(side_effect=httpx.TimeoutException("Test timeout error"))
|
|
1551
1533
|
|
|
1552
1534
|
with pytest.raises(APITimeoutError):
|
|
1553
|
-
await
|
|
1554
|
-
"
|
|
1555
|
-
|
|
1556
|
-
object, maybe_transform(dict(language="yo", text="text", voice="sade"), SpeechGenerateParams)
|
|
1557
|
-
),
|
|
1558
|
-
cast_to=httpx.Response,
|
|
1559
|
-
options={"headers": {RAW_RESPONSE_HEADER: "stream"}},
|
|
1560
|
-
)
|
|
1535
|
+
await async_client.speech.with_streaming_response.generate(
|
|
1536
|
+
language="yo", text="text", voice="sade"
|
|
1537
|
+
).__aenter__()
|
|
1561
1538
|
|
|
1562
1539
|
assert _get_open_connections(self.client) == 0
|
|
1563
1540
|
|
|
1564
1541
|
@mock.patch("spitch._base_client.BaseClient._calculate_retry_timeout", _low_retry_timeout)
|
|
1565
1542
|
@pytest.mark.respx(base_url=base_url)
|
|
1566
|
-
async def test_retrying_status_errors_doesnt_leak(self, respx_mock: MockRouter) -> None:
|
|
1543
|
+
async def test_retrying_status_errors_doesnt_leak(self, respx_mock: MockRouter, async_client: AsyncSpitch) -> None:
|
|
1567
1544
|
respx_mock.post("/v1/speech").mock(return_value=httpx.Response(500))
|
|
1568
1545
|
|
|
1569
1546
|
with pytest.raises(APIStatusError):
|
|
1570
|
-
await
|
|
1571
|
-
"
|
|
1572
|
-
|
|
1573
|
-
object, maybe_transform(dict(language="yo", text="text", voice="sade"), SpeechGenerateParams)
|
|
1574
|
-
),
|
|
1575
|
-
cast_to=httpx.Response,
|
|
1576
|
-
options={"headers": {RAW_RESPONSE_HEADER: "stream"}},
|
|
1577
|
-
)
|
|
1578
|
-
|
|
1547
|
+
await async_client.speech.with_streaming_response.generate(
|
|
1548
|
+
language="yo", text="text", voice="sade"
|
|
1549
|
+
).__aenter__()
|
|
1579
1550
|
assert _get_open_connections(self.client) == 0
|
|
1580
1551
|
|
|
1581
1552
|
@pytest.mark.parametrize("failures_before_success", [0, 2, 4])
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|