Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added stubs for D3DShot #8652

Merged
merged 38 commits into from
Sep 12, 2022
Merged
Changes from 1 commit
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
31cc811
Added stubs for D3DShot
Avasam Aug 30, 2022
6e08d8d
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Aug 30, 2022
04f783c
Added missing requires
Avasam Aug 30, 2022
797bfc9
Merge branch 'D3DShot' of https://github.com/Avasam/typeshed into D3D…
Avasam Aug 30, 2022
f72704e
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Aug 30, 2022
85c4c95
Fixed missing Unknowns
Avasam Aug 31, 2022
ba31840
Merge branch 'D3DShot' of https://github.com/Avasam/typeshed into D3D…
Avasam Aug 31, 2022
642d58b
Unused imports
Avasam Aug 31, 2022
b7793e8
Try fixing missing pillow types
Avasam Aug 31, 2022
84fc12a
stubtest
Avasam Aug 31, 2022
41cf5bc
Merge branch 'master' of https://github.com/python/typeshed into D3DShot
Avasam Sep 4, 2022
d346403
Filled in all ctypes
Avasam Sep 4, 2022
c197b15
Completed all _Pointer
Avasam Sep 4, 2022
3ba9918
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Sep 4, 2022
c17309b
Unused _STDMETHOD
Avasam Sep 4, 2022
84562f0
Merge branch 'D3DShot' of https://github.com/Avasam/typeshed into D3D…
Avasam Sep 4, 2022
97934a4
os.name check
Avasam Sep 5, 2022
73db85c
TypedDict from typing_extensions
Avasam Sep 5, 2022
cd79554
Update some types
Avasam Sep 5, 2022
e0b7e67
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Sep 5, 2022
66ba404
skip instead of allowlist
Avasam Sep 5, 2022
a0fc98f
Merge branch 'D3DShot' of https://github.com/Avasam/typeshed into D3D…
Avasam Sep 5, 2022
c4d4439
Merge branch 'master' of https://github.com/python/typeshed into D3DShot
Avasam Sep 5, 2022
a166c59
PR review fixes
Avasam Sep 6, 2022
d03956d
Merge branch 'master' of https://github.com/python/typeshed into D3DShot
Avasam Sep 11, 2022
1d7734c
Some PR comments, about comments
Avasam Sep 11, 2022
041c2f3
Missed self arg
Avasam Sep 11, 2022
ba15101
_Pointer
Avasam Sep 11, 2022
df2ec92
Remove nt check comment
Avasam Sep 11, 2022
b16a70f
More PR comments and a few more completions
Avasam Sep 12, 2022
628a00e
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Sep 12, 2022
e444cc1
Liskov substitution principle
Avasam Sep 12, 2022
24dea69
PR comments and __
Avasam Sep 12, 2022
dbd298b
Added comment for display init
Avasam Sep 12, 2022
1488687
Comments and Iterable
Avasam Sep 12, 2022
42b5119
`immediatley` -> `immediately`
AlexWaygood Sep 12, 2022
c99d4c8
oops typo
Avasam Sep 12, 2022
b842dff
Merge branch 'D3DShot' of https://github.com/Avasam/typeshed into D3D…
Avasam Sep 12, 2022
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
Prev Previous commit
Next Next commit
Some PR comments, about comments
  • Loading branch information
Avasam committed Sep 11, 2022

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit 1d7734cd58039a5105a981c3372186f037f7bbb1
4 changes: 2 additions & 2 deletions pyrightconfig.stricter.json
Original file line number Diff line number Diff line change
@@ -38,6 +38,7 @@
"stubs/caldav",
"stubs/commonmark",
"stubs/cryptography",
"stubs/D3DShot",
"stubs/dateparser",
"stubs/dj-database-url",
"stubs/docutils",
@@ -90,8 +91,7 @@
"stubs/tzlocal/tzlocal/utils.pyi",
"stubs/ttkthemes",
"stubs/urllib3",
"stubs/vobject",
"stubs/D3DShot"
"stubs/vobject"
],
"typeCheckingMode": "basic",
"strictListInference": true,
2 changes: 2 additions & 0 deletions stubs/D3DShot/METADATA.toml
Original file line number Diff line number Diff line change
@@ -2,4 +2,6 @@ version = "0.1.*"
requires = ["types-Pillow"]

[tool.stubtest]
# The library only works on Windows; we currently only run stubtest on Ubuntu for third-party stubs in CI.
# See #8660
skip = true
1 change: 1 addition & 0 deletions stubs/D3DShot/d3dshot/capture_output.pyi
Original file line number Diff line number Diff line change
@@ -6,6 +6,7 @@ from typing_extensions import Literal, TypeAlias
from PIL import Image

_Frame: TypeAlias = Image.Image | Incomplete
# FIXME: When #5768 is resolved:
# _Frame: TypeAlias = Image.Image | npt.NDArray[np.int32] | npt.NDArray[np.float32] | _Tensor

class CaptureOutputs(enum.Enum):
1 change: 1 addition & 0 deletions stubs/D3DShot/d3dshot/d3dshot.pyi
Original file line number Diff line number Diff line change
@@ -8,6 +8,7 @@ from d3dshot.display import Display as Display
from PIL import Image

_Frame: TypeAlias = Image.Image | Incomplete
# FIXME: When #5768 is resolved:
# _Frame: TypeAlias = Image.Image | npt.NDArray[np.int32] | npt.NDArray[np.float32] | _Tensor

class Singleton(type):
1 change: 1 addition & 0 deletions stubs/D3DShot/d3dshot/display.pyi
Original file line number Diff line number Diff line change
@@ -6,6 +6,7 @@ from typing_extensions import Literal, TypeAlias
from PIL import Image

_Frame: TypeAlias = Image.Image | Incomplete
# FIXME: When #5768 is resolved:
# _Frame: TypeAlias = Image.Image | npt.NDArray[np.int32] | npt.NDArray[np.float32] | _Tensor

class Display:
9 changes: 6 additions & 3 deletions stubs/D3DShot/d3dshot/dll/d3d.pyi
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import sys
from _typeshed import Incomplete
from ctypes import Structure, _CArgObject, c_int32, c_uint, c_void_p
from ctypes import Structure, _CArgObject, _CData, c_int32, c_uint, c_ulong, c_void_p
from ctypes.wintypes import FLOAT, UINT
from typing_extensions import TypeAlias

@@ -18,8 +18,11 @@ else:

# TODO: Complete types once we can import non-types dependencies
# See: https://github.com/python/typeshed/issues/5768
# import comtypes
_IUnknown: TypeAlias = Incomplete
# from comtypes import IUnknown
class _IUnknown: # From comtypes.IUnknown
def QueryInterface(self, interface: type, iid: _CData | None = ...) -> _HRESULT: ...
def AddRef(self) -> c_ulong: ...
def Release(self) -> c_ulong: ...

class DXGI_SAMPLE_DESC(Structure):
Count: UINT
14 changes: 6 additions & 8 deletions stubs/D3DShot/d3dshot/dll/dxgi.pyi
Original file line number Diff line number Diff line change
@@ -9,13 +9,16 @@ from d3dshot.dll.d3d import ID3D11Device
from PIL import Image

# TODO: Complete types once we can import non-types dependencies
# See: https://github.com/python/typeshed/issues/5768
# See: #5768
# from torch import Tensor
# import comtypes
# from comtypes import IUnknown
# import numpy.typing as npt
# _IUnknown: TypeAlias = Incomplete
_Frame: TypeAlias = Image.Image | Incomplete
# _Frame: TypeAlias = Image.Image | npt.NDArray[np.int32] | npt.NDArray[np.float32] | Tensor
class _IUnknown: # From comtypes.IUnknown
def QueryInterface(self, interface: type, iid: _CData | None = ...) -> _HRESULT: ...
def AddRef(self) -> c_ulong: ...
def Release(self) -> c_ulong: ...

# mypy does not support os.name checks, while pyright does https://github.com/python/mypy/issues/13002
# import os
@@ -27,11 +30,6 @@ if sys.platform == "win32":
else:
_HRESULT: TypeAlias = Incomplete

class _IUnknown: # From comtypes.IUnknown
def QueryInterface(self, interface: type, iid: _CData | None = ...) -> _HRESULT: ...
def AddRef(self) -> c_ulong: ...
def Release(self) -> c_ulong: ...

class _DXGIOutputPosition(TypedDict):
left: LONG
top: LONG