From b597be5bb6b265e7e32dc8583ce70fa216387e40 Mon Sep 17 00:00:00 2001 From: SharoonSharif <150296639+SharoonSharif@users.noreply.github.com> Date: Sat, 19 Sep 2026 13:19:39 -0600 Subject: [PATCH] [docker] Run stubtest on Windows to cover the named pipe transport docker-py installs pywin32 on Windows, so docker.transport.npipeconn and docker.transport.npipesocket import there and stubtest reported the global allowlist entries for them as unused. Move those entries to the linux and darwin allowlists, where the modules fail to import, and add win32 to ci-platforms so the npipe stubs are checked against the runtime. --- stubs/docker/@tests/stubtest_allowlist.txt | 4 +--- stubs/docker/@tests/stubtest_allowlist_darwin.txt | 3 +++ stubs/docker/@tests/stubtest_allowlist_linux.txt | 3 +++ stubs/docker/METADATA.toml | 3 +++ 4 files changed, 10 insertions(+), 3 deletions(-) create mode 100644 stubs/docker/@tests/stubtest_allowlist_darwin.txt create mode 100644 stubs/docker/@tests/stubtest_allowlist_linux.txt diff --git a/stubs/docker/@tests/stubtest_allowlist.txt b/stubs/docker/@tests/stubtest_allowlist.txt index 224425773c24..ff14ff488c4d 100644 --- a/stubs/docker/@tests/stubtest_allowlist.txt +++ b/stubs/docker/@tests/stubtest_allowlist.txt @@ -1,6 +1,4 @@ -# additional requirements are needed, e.g. win32 apis -docker.transport.npipeconn -docker.transport.npipesocket +# requires paramiko, which is only installed with the ssh extra docker.transport.sshconn # model is always set by child classes diff --git a/stubs/docker/@tests/stubtest_allowlist_darwin.txt b/stubs/docker/@tests/stubtest_allowlist_darwin.txt new file mode 100644 index 000000000000..9f467ef3adc7 --- /dev/null +++ b/stubs/docker/@tests/stubtest_allowlist_darwin.txt @@ -0,0 +1,3 @@ +# the named pipe transport requires pywin32, which is only installed on Windows +docker.transport.npipeconn +docker.transport.npipesocket diff --git a/stubs/docker/@tests/stubtest_allowlist_linux.txt b/stubs/docker/@tests/stubtest_allowlist_linux.txt new file mode 100644 index 000000000000..9f467ef3adc7 --- /dev/null +++ b/stubs/docker/@tests/stubtest_allowlist_linux.txt @@ -0,0 +1,3 @@ +# the named pipe transport requires pywin32, which is only installed on Windows +docker.transport.npipeconn +docker.transport.npipesocket diff --git a/stubs/docker/METADATA.toml b/stubs/docker/METADATA.toml index 70bcc93efcaa..68e0966475ac 100644 --- a/stubs/docker/METADATA.toml +++ b/stubs/docker/METADATA.toml @@ -2,3 +2,6 @@ version = "7.2.*" upstream-repository = "https://github.com/docker/docker-py" dependencies = ["types-requests", "urllib3>=2"] optional-dependencies = ["types-paramiko"] + +[tool.stubtest] +ci-platforms = ["linux", "win32"]