Skip to content
Open
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
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
tests/sample_file.txt text eol=lf
10 changes: 8 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,12 @@ jobs:

test:
timeout-minutes: 10
name: test
runs-on: ${{ startsWith(github.repository, 'stainless-sdks/') && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
name: test (${{ matrix.os }})
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
runs-on: ${{ startsWith(github.repository, 'stainless-sdks/') && 'depot-ubuntu-24.04' || matrix.os }}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1: In stainless-sdks/* repositories, this runs-on expression always picks the Ubuntu depot runner, so the Windows matrix job never gets a Windows runner. Gate the depot override to the Ubuntu matrix entry so windows-latest still runs on Windows.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At .github/workflows/ci.yml, line 85:

<comment>In `stainless-sdks/*` repositories, this `runs-on` expression always picks the Ubuntu depot runner, so the Windows matrix job never gets a Windows runner. Gate the depot override to the Ubuntu matrix entry so `windows-latest` still runs on Windows.</comment>

<file context>
@@ -77,8 +77,12 @@ jobs:
+      fail-fast: false
+      matrix:
+        os: [ubuntu-latest, windows-latest]
+    runs-on: ${{ startsWith(github.repository, 'stainless-sdks/') && 'depot-ubuntu-24.04' || matrix.os }}
     if: github.event_name == 'push' || github.event.pull_request.head.repo.fork
     steps:
</file context>
Suggested change
runs-on: ${{ startsWith(github.repository, 'stainless-sdks/') && 'depot-ubuntu-24.04' || matrix.os }}
runs-on: ${{ startsWith(github.repository, 'stainless-sdks/') && matrix.os == 'ubuntu-latest' && 'depot-ubuntu-24.04' || matrix.os }}

if: github.event_name == 'push' || github.event.pull_request.head.repo.fork
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
Expand All @@ -89,7 +93,9 @@ jobs:
version: '0.10.2'

- name: Bootstrap
shell: bash
run: ./scripts/bootstrap

- name: Run tests
shell: bash
run: ./scripts/test
18 changes: 14 additions & 4 deletions tests/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,10 @@ def test_copy_signature(self, client: Stagehand) -> None:
copy_param = copy_signature.parameters.get(name)
assert copy_param is not None, f"copy() signature is missing the {name} param"

@pytest.mark.skipif(sys.version_info >= (3, 10), reason="fails because of a memory leak that started from 3.12")
@pytest.mark.skipif(
sys.version_info >= (3, 10) or sys.platform == "win32",
reason="memory leak assertion is not stable on Python >=3.10 or Windows",
)
def test_copy_build_request(self, client: Stagehand) -> None:
options = FinalRequestOptions(method="get", url="/foo")

Expand Down Expand Up @@ -1151,7 +1154,6 @@ def retry_handler(_request: httpx.Request) -> httpx.Response:

def test_proxy_environment_variables(self, monkeypatch: pytest.MonkeyPatch) -> None:
# Test that the proxy environment variables are set correctly
monkeypatch.setenv("HTTPS_PROXY", "https://example.org")
# Delete in case our environment has any proxy env vars set
monkeypatch.delenv("HTTP_PROXY", raising=False)
monkeypatch.delenv("ALL_PROXY", raising=False)
Expand All @@ -1160,6 +1162,9 @@ def test_proxy_environment_variables(self, monkeypatch: pytest.MonkeyPatch) -> N
monkeypatch.delenv("https_proxy", raising=False)
monkeypatch.delenv("all_proxy", raising=False)
monkeypatch.delenv("no_proxy", raising=False)
# Set this last because environment variable names are case-insensitive
# on Windows, so deleting `https_proxy` also deletes `HTTPS_PROXY`.
monkeypatch.setenv("HTTPS_PROXY", "https://example.org")

client = DefaultHttpxClient()

Expand Down Expand Up @@ -1357,7 +1362,10 @@ def test_copy_signature(self, async_client: AsyncStagehand) -> None:
copy_param = copy_signature.parameters.get(name)
assert copy_param is not None, f"copy() signature is missing the {name} param"

@pytest.mark.skipif(sys.version_info >= (3, 10), reason="fails because of a memory leak that started from 3.12")
@pytest.mark.skipif(
sys.version_info >= (3, 10) or sys.platform == "win32",
reason="memory leak assertion is not stable on Python >=3.10 or Windows",
)
def test_copy_build_request(self, async_client: AsyncStagehand) -> None:
options = FinalRequestOptions(method="get", url="/foo")

Expand Down Expand Up @@ -2257,7 +2265,6 @@ async def test_get_platform(self) -> None:

async def test_proxy_environment_variables(self, monkeypatch: pytest.MonkeyPatch) -> None:
# Test that the proxy environment variables are set correctly
monkeypatch.setenv("HTTPS_PROXY", "https://example.org")
# Delete in case our environment has any proxy env vars set
monkeypatch.delenv("HTTP_PROXY", raising=False)
monkeypatch.delenv("ALL_PROXY", raising=False)
Expand All @@ -2266,6 +2273,9 @@ async def test_proxy_environment_variables(self, monkeypatch: pytest.MonkeyPatch
monkeypatch.delenv("https_proxy", raising=False)
monkeypatch.delenv("all_proxy", raising=False)
monkeypatch.delenv("no_proxy", raising=False)
# Set this last because environment variable names are case-insensitive
# on Windows, so deleting `https_proxy` also deletes `HTTPS_PROXY`.
monkeypatch.setenv("HTTPS_PROXY", "https://example.org")

client = DefaultAsyncHttpxClient()

Expand Down