mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-07 12:44:28 +08:00
cffi: run stubtest on Windows (#9178)
This commit is contained in:
@@ -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__
|
||||
|
||||
2
stubs/cffi/@tests/stubtest_allowlist_darwin.txt
Normal file
2
stubs/cffi/@tests/stubtest_allowlist_darwin.txt
Normal 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
|
||||
2
stubs/cffi/@tests/stubtest_allowlist_linux.txt
Normal file
2
stubs/cffi/@tests/stubtest_allowlist_linux.txt
Normal 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
|
||||
@@ -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"]
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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: ...
|
||||
|
||||
|
||||
Reference in New Issue
Block a user