Skip to content

Commit f91af92

Browse files
authored
Merge pull request #29 from replicate/release-please--branches--main--changes--next
release: 2.0.0-alpha.3
2 parents 02cb51b + a496d2d commit f91af92

File tree

5 files changed

+57
-3
lines changed

5 files changed

+57
-3
lines changed

.release-please-manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
".": "2.0.0-alpha.2"
2+
".": "2.0.0-alpha.3"
33
}

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# Changelog
22

3+
## 2.0.0-alpha.3 (2025-06-17)
4+
5+
Full Changelog: [v2.0.0-alpha.2...v2.0.0-alpha.3](https://github.com/replicate/replicate-python-stainless/compare/v2.0.0-alpha.2...v2.0.0-alpha.3)
6+
7+
### Chores
8+
9+
* **tests:** add tests for httpx client instantiation & proxies ([b8dfd7a](https://github.com/replicate/replicate-python-stainless/commit/b8dfd7a455abb39f114bf86b89aacf2d9cb88eb3))
10+
311
## 2.0.0-alpha.2 (2025-06-13)
412

513
Full Changelog: [v2.0.0-alpha.1...v2.0.0-alpha.2](https://github.com/replicate/replicate-python-stainless/compare/v2.0.0-alpha.1...v2.0.0-alpha.2)

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "replicate"
3-
version = "2.0.0-alpha.2"
3+
version = "2.0.0-alpha.3"
44
description = "The official Python library for the replicate API"
55
dynamic = ["readme"]
66
license = "Apache-2.0"

src/replicate/_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

33
__title__ = "replicate"
4-
__version__ = "2.0.0-alpha.2" # x-release-please-version
4+
__version__ = "2.0.0-alpha.3" # x-release-please-version

tests/test_client.py

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@
3131
DEFAULT_TIMEOUT,
3232
HTTPX_DEFAULT_TIMEOUT,
3333
BaseClient,
34+
DefaultHttpxClient,
35+
DefaultAsyncHttpxClient,
3436
make_request_options,
3537
)
3638
from replicate.types.prediction_create_params import PredictionCreateParams
@@ -868,6 +870,28 @@ def retry_handler(_request: httpx.Request) -> httpx.Response:
868870

869871
assert response.http_request.headers.get("x-stainless-retry-count") == "42"
870872

873+
def test_proxy_environment_variables(self, monkeypatch: pytest.MonkeyPatch) -> None:
874+
# Test that the proxy environment variables are set correctly
875+
monkeypatch.setenv("HTTPS_PROXY", "https://example.org")
876+
877+
client = DefaultHttpxClient()
878+
879+
mounts = tuple(client._mounts.items())
880+
assert len(mounts) == 1
881+
assert mounts[0][0].pattern == "https://"
882+
883+
@pytest.mark.filterwarnings("ignore:.*deprecated.*:DeprecationWarning")
884+
def test_default_client_creation(self) -> None:
885+
# Ensure that the client can be initialized without any exceptions
886+
DefaultHttpxClient(
887+
verify=True,
888+
cert=None,
889+
trust_env=True,
890+
http1=True,
891+
http2=False,
892+
limits=httpx.Limits(max_connections=100, max_keepalive_connections=20),
893+
)
894+
871895
@pytest.mark.respx(base_url=base_url)
872896
def test_follow_redirects(self, respx_mock: MockRouter) -> None:
873897
# Test that the default follow_redirects=True allows following redirects
@@ -1759,6 +1783,28 @@ async def test_main() -> None:
17591783

17601784
time.sleep(0.1)
17611785

1786+
async def test_proxy_environment_variables(self, monkeypatch: pytest.MonkeyPatch) -> None:
1787+
# Test that the proxy environment variables are set correctly
1788+
monkeypatch.setenv("HTTPS_PROXY", "https://example.org")
1789+
1790+
client = DefaultAsyncHttpxClient()
1791+
1792+
mounts = tuple(client._mounts.items())
1793+
assert len(mounts) == 1
1794+
assert mounts[0][0].pattern == "https://"
1795+
1796+
@pytest.mark.filterwarnings("ignore:.*deprecated.*:DeprecationWarning")
1797+
async def test_default_client_creation(self) -> None:
1798+
# Ensure that the client can be initialized without any exceptions
1799+
DefaultAsyncHttpxClient(
1800+
verify=True,
1801+
cert=None,
1802+
trust_env=True,
1803+
http1=True,
1804+
http2=False,
1805+
limits=httpx.Limits(max_connections=100, max_keepalive_connections=20),
1806+
)
1807+
17621808
@pytest.mark.respx(base_url=base_url)
17631809
async def test_follow_redirects(self, respx_mock: MockRouter) -> None:
17641810
# Test that the default follow_redirects=True allows following redirects

0 commit comments

Comments
 (0)