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.

Files changed (76) hide show
  1. spitch-1.27.1/.release-please-manifest.json +3 -0
  2. {spitch-1.27.0 → spitch-1.27.1}/CHANGELOG.md +18 -0
  3. {spitch-1.27.0 → spitch-1.27.1}/PKG-INFO +3 -3
  4. {spitch-1.27.0 → spitch-1.27.1}/README.md +2 -2
  5. {spitch-1.27.0 → spitch-1.27.1}/pyproject.toml +1 -1
  6. {spitch-1.27.0 → spitch-1.27.1}/src/spitch/_version.py +1 -1
  7. {spitch-1.27.0 → spitch-1.27.1}/tests/test_client.py +12 -41
  8. spitch-1.27.0/.release-please-manifest.json +0 -3
  9. {spitch-1.27.0 → spitch-1.27.1}/.gitignore +0 -0
  10. {spitch-1.27.0 → spitch-1.27.1}/CONTRIBUTING.md +0 -0
  11. {spitch-1.27.0 → spitch-1.27.1}/LICENSE +0 -0
  12. {spitch-1.27.0 → spitch-1.27.1}/SECURITY.md +0 -0
  13. {spitch-1.27.0 → spitch-1.27.1}/api.md +0 -0
  14. {spitch-1.27.0 → spitch-1.27.1}/bin/check-release-environment +0 -0
  15. {spitch-1.27.0 → spitch-1.27.1}/bin/publish-pypi +0 -0
  16. {spitch-1.27.0 → spitch-1.27.1}/examples/.keep +0 -0
  17. {spitch-1.27.0 → spitch-1.27.1}/examples/example.py +0 -0
  18. {spitch-1.27.0 → spitch-1.27.1}/mypy.ini +0 -0
  19. {spitch-1.27.0 → spitch-1.27.1}/noxfile.py +0 -0
  20. {spitch-1.27.0 → spitch-1.27.1}/release-please-config.json +0 -0
  21. {spitch-1.27.0 → spitch-1.27.1}/requirements-dev.lock +0 -0
  22. {spitch-1.27.0 → spitch-1.27.1}/requirements.lock +0 -0
  23. {spitch-1.27.0 → spitch-1.27.1}/src/spitch/__init__.py +0 -0
  24. {spitch-1.27.0 → spitch-1.27.1}/src/spitch/_base_client.py +0 -0
  25. {spitch-1.27.0 → spitch-1.27.1}/src/spitch/_client.py +0 -0
  26. {spitch-1.27.0 → spitch-1.27.1}/src/spitch/_compat.py +0 -0
  27. {spitch-1.27.0 → spitch-1.27.1}/src/spitch/_constants.py +0 -0
  28. {spitch-1.27.0 → spitch-1.27.1}/src/spitch/_exceptions.py +0 -0
  29. {spitch-1.27.0 → spitch-1.27.1}/src/spitch/_files.py +0 -0
  30. {spitch-1.27.0 → spitch-1.27.1}/src/spitch/_models.py +0 -0
  31. {spitch-1.27.0 → spitch-1.27.1}/src/spitch/_qs.py +0 -0
  32. {spitch-1.27.0 → spitch-1.27.1}/src/spitch/_resource.py +0 -0
  33. {spitch-1.27.0 → spitch-1.27.1}/src/spitch/_response.py +0 -0
  34. {spitch-1.27.0 → spitch-1.27.1}/src/spitch/_streaming.py +0 -0
  35. {spitch-1.27.0 → spitch-1.27.1}/src/spitch/_types.py +0 -0
  36. {spitch-1.27.0 → spitch-1.27.1}/src/spitch/_utils/__init__.py +0 -0
  37. {spitch-1.27.0 → spitch-1.27.1}/src/spitch/_utils/_logs.py +0 -0
  38. {spitch-1.27.0 → spitch-1.27.1}/src/spitch/_utils/_proxy.py +0 -0
  39. {spitch-1.27.0 → spitch-1.27.1}/src/spitch/_utils/_reflection.py +0 -0
  40. {spitch-1.27.0 → spitch-1.27.1}/src/spitch/_utils/_resources_proxy.py +0 -0
  41. {spitch-1.27.0 → spitch-1.27.1}/src/spitch/_utils/_streams.py +0 -0
  42. {spitch-1.27.0 → spitch-1.27.1}/src/spitch/_utils/_sync.py +0 -0
  43. {spitch-1.27.0 → spitch-1.27.1}/src/spitch/_utils/_transform.py +0 -0
  44. {spitch-1.27.0 → spitch-1.27.1}/src/spitch/_utils/_typing.py +0 -0
  45. {spitch-1.27.0 → spitch-1.27.1}/src/spitch/_utils/_utils.py +0 -0
  46. {spitch-1.27.0 → spitch-1.27.1}/src/spitch/lib/.keep +0 -0
  47. {spitch-1.27.0 → spitch-1.27.1}/src/spitch/py.typed +0 -0
  48. {spitch-1.27.0 → spitch-1.27.1}/src/spitch/resources/__init__.py +0 -0
  49. {spitch-1.27.0 → spitch-1.27.1}/src/spitch/resources/speech.py +0 -0
  50. {spitch-1.27.0 → spitch-1.27.1}/src/spitch/resources/text.py +0 -0
  51. {spitch-1.27.0 → spitch-1.27.1}/src/spitch/types/__init__.py +0 -0
  52. {spitch-1.27.0 → spitch-1.27.1}/src/spitch/types/speech_generate_params.py +0 -0
  53. {spitch-1.27.0 → spitch-1.27.1}/src/spitch/types/speech_transcribe_params.py +0 -0
  54. {spitch-1.27.0 → spitch-1.27.1}/src/spitch/types/speech_transcribe_response.py +0 -0
  55. {spitch-1.27.0 → spitch-1.27.1}/src/spitch/types/text_tone_mark_params.py +0 -0
  56. {spitch-1.27.0 → spitch-1.27.1}/src/spitch/types/text_tone_mark_response.py +0 -0
  57. {spitch-1.27.0 → spitch-1.27.1}/src/spitch/types/text_translate_params.py +0 -0
  58. {spitch-1.27.0 → spitch-1.27.1}/src/spitch/types/text_translate_response.py +0 -0
  59. {spitch-1.27.0 → spitch-1.27.1}/tests/__init__.py +0 -0
  60. {spitch-1.27.0 → spitch-1.27.1}/tests/api_resources/__init__.py +0 -0
  61. {spitch-1.27.0 → spitch-1.27.1}/tests/api_resources/test_speech.py +0 -0
  62. {spitch-1.27.0 → spitch-1.27.1}/tests/api_resources/test_text.py +0 -0
  63. {spitch-1.27.0 → spitch-1.27.1}/tests/conftest.py +0 -0
  64. {spitch-1.27.0 → spitch-1.27.1}/tests/sample_file.txt +0 -0
  65. {spitch-1.27.0 → spitch-1.27.1}/tests/test_deepcopy.py +0 -0
  66. {spitch-1.27.0 → spitch-1.27.1}/tests/test_extract_files.py +0 -0
  67. {spitch-1.27.0 → spitch-1.27.1}/tests/test_files.py +0 -0
  68. {spitch-1.27.0 → spitch-1.27.1}/tests/test_models.py +0 -0
  69. {spitch-1.27.0 → spitch-1.27.1}/tests/test_qs.py +0 -0
  70. {spitch-1.27.0 → spitch-1.27.1}/tests/test_required_args.py +0 -0
  71. {spitch-1.27.0 → spitch-1.27.1}/tests/test_response.py +0 -0
  72. {spitch-1.27.0 → spitch-1.27.1}/tests/test_streaming.py +0 -0
  73. {spitch-1.27.0 → spitch-1.27.1}/tests/test_transform.py +0 -0
  74. {spitch-1.27.0 → spitch-1.27.1}/tests/test_utils/test_proxy.py +0 -0
  75. {spitch-1.27.0 → spitch-1.27.1}/tests/test_utils/test_typing.py +0 -0
  76. {spitch-1.27.0 → spitch-1.27.1}/tests/utils.py +0 -0
@@ -0,0 +1,3 @@
1
+ {
2
+ ".": "1.27.1"
3
+ }
@@ -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.0
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
- [![PyPI version](https://img.shields.io/pypi/v/spitch.svg)](https://pypi.org/project/spitch/)
35
+ [![PyPI version](https://github.com/spi-tch/spitch-python/tree/main/<https://img.shields.io/pypi/v/spitch.svg?label=pypi%20(stable)>)](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
- [![PyPI version](https://img.shields.io/pypi/v/spitch.svg)](https://pypi.org/project/spitch/)
3
+ [![PyPI version](<https://img.shields.io/pypi/v/spitch.svg?label=pypi%20(stable)>)](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
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "spitch"
3
- version = "1.27.0"
3
+ version = "1.27.1"
4
4
  description = "The official Python library for the spitch API"
5
5
  dynamic = ["readme"]
6
6
  license = "Apache-2.0"
@@ -1,4 +1,4 @@
1
1
  # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
3
  __title__ = "spitch"
4
- __version__ = "1.27.0" # x-release-please-version
4
+ __version__ = "1.27.1" # x-release-please-version
@@ -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
- self.client.post(
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
- self.client.post(
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 self.client.post(
1554
- "/v1/speech",
1555
- body=cast(
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 self.client.post(
1571
- "/v1/speech",
1572
- body=cast(
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])
@@ -1,3 +0,0 @@
1
- {
2
- ".": "1.27.0"
3
- }
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