cffi: run stubtest on Windows (#9178)

This commit is contained in:
Avasam
2022-11-12 18:56:43 -05:00
committed by GitHub
parent f033e61ae2
commit 7fc9b8e2c8
6 changed files with 10 additions and 5 deletions

View File

@@ -1,6 +1,3 @@
# technically exists on all OSs, but crashes on all but windows
cffi.(api.)?FFI.getwinerror
# added dynamically and not detected by stubtest
cffi.(api.)?FFI.CData
cffi.(api.)?FFI.CType
@@ -11,4 +8,4 @@ cffi.vengine_cpy.__warningregistry__
# Unnecessary re-exports
cffi.cparser.COMMON_TYPES
cffi.verifier.__version_verifier_modules__
cffi.verifier.__version_verifier_modules__

View File

@@ -0,0 +1,2 @@
# Technically exists on all OSs, but crashes on all but Windows. So we hide it in stubs
cffi.(api.)?FFI.getwinerror

View File

@@ -0,0 +1,2 @@
# Technically exists on all OSs, but crashes on all but Windows. So we hide it in stubs
cffi.(api.)?FFI.getwinerror

View File

@@ -2,3 +2,5 @@ version = "1.15.*"
[tool.stubtest]
ignore_missing_stub = false
# linux and darwin are mostly equivalent, except for a single `RTLD_DEEPBIND` variable
platforms = ["linux", "win32"]

View File

@@ -18,8 +18,9 @@ RTLD_GLOBAL: int
RTLD_LAZY: int
RTLD_LOCAL: int
RTLD_NOW: int
if sys.platform != "win32":
if sys.platform == "linux":
RTLD_DEEPBIND: int
if sys.platform != "win32":
RTLD_NODELETE: int
RTLD_NOLOAD: int

View File

@@ -72,6 +72,7 @@ class FFI:
@overload
def gc(self, cdata: CData, destructor: None, size: int = ...) -> None: ...
def verify(self, source: str = ..., tmpdir: str | None = ..., **kwargs: Any) -> _cffi_backend.Lib: ...
# Technically exists on all OSs, but crashes on all but Windows. So we hide it in stubs
if sys.platform == "win32":
def getwinerror(self, code: int = ...) -> tuple[int, str] | None: ...