winrt-runtime 2.0.0b2__tar.gz → 2.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: winrt-runtime
3
- Version: 2.0.0b2
3
+ Version: 2.1.0
4
4
  Summary: Python projection of Windows Runtime (WinRT) APIs
5
5
  License: MIT
6
6
  Project-URL: Documentation, https://pywinrt.readthedocs.io
@@ -21,7 +21,7 @@ namespace py::cpp::_winrt
21
21
  }
22
22
 
23
23
  static void Object_dealloc(
24
- py::winrt_wrapper<winrt::Windows::Foundation::IInspectable>* self)
24
+ py::winrt_wrapper<winrt::Windows::Foundation::IInspectable>* self) noexcept
25
25
  {
26
26
  auto tp = Py_TYPE(self);
27
27
 
@@ -30,12 +30,65 @@ namespace py::cpp::_winrt
30
30
  Py_DECREF(tp);
31
31
  }
32
32
 
33
- static PyType_Slot Object_type_slots[] = {
34
- {Py_tp_new, reinterpret_cast<void*>(Object_new)},
35
- {Py_tp_dealloc, reinterpret_cast<void*>(Object_dealloc)},
36
- {Py_tp_doc, const_cast<char*>(Object_doc)},
37
- {},
38
- };
33
+ PyDoc_STRVAR(
34
+ Object_iids_doc,
35
+ "Gets the interfaces that are implemented by the current Windows Runtime class.");
36
+
37
+ static PyObject* Object_iids_get(
38
+ py::winrt_wrapper<winrt::Windows::Foundation::IInspectable>* self,
39
+ void* /*unused*/) noexcept
40
+ {
41
+ try
42
+ {
43
+ auto name = winrt::get_interfaces(self->obj);
44
+ return convert(name);
45
+ }
46
+ catch (...)
47
+ {
48
+ py::to_PyErr();
49
+ return nullptr;
50
+ }
51
+ }
52
+
53
+ PyDoc_STRVAR(
54
+ Object_runtime_class_name_doc,
55
+ "Gets the fully qualified name of the current Windows Runtime object.");
56
+
57
+ static PyObject* Object_runtime_class_name_get(
58
+ py::winrt_wrapper<winrt::Windows::Foundation::IInspectable>* self,
59
+ void* /*unused*/) noexcept
60
+ {
61
+ try
62
+ {
63
+ auto name = winrt::get_class_name(self->obj);
64
+ return convert(name);
65
+ }
66
+ catch (...)
67
+ {
68
+ py::to_PyErr();
69
+ return nullptr;
70
+ }
71
+ }
72
+
73
+ static PyGetSetDef Object_getset[]
74
+ = {{"_iids_",
75
+ reinterpret_cast<getter>(Object_iids_get),
76
+ nullptr,
77
+ Object_iids_doc,
78
+ nullptr},
79
+ {"_runtime_class_name_",
80
+ reinterpret_cast<getter>(Object_runtime_class_name_get),
81
+ nullptr,
82
+ Object_runtime_class_name_doc,
83
+ nullptr},
84
+ {}};
85
+
86
+ static PyType_Slot Object_type_slots[]
87
+ = {{Py_tp_doc, const_cast<char*>(Object_doc)},
88
+ {Py_tp_new, reinterpret_cast<void*>(Object_new)},
89
+ {Py_tp_dealloc, reinterpret_cast<void*>(Object_dealloc)},
90
+ {Py_tp_getset, reinterpret_cast<void*>(Object_getset)},
91
+ {}};
39
92
 
40
93
  static PyType_Spec Object_type_spec
41
94
  = {"_winrt.Object",
@@ -106,7 +106,7 @@ namespace py::cpp::_winrt
106
106
  PyObject* arg0;
107
107
  PyObject* arg1 = nullptr;
108
108
 
109
- if (PyArg_UnpackTuple(args, "Array", 1, 2, &arg0, &arg1) < 0)
109
+ if (!PyArg_UnpackTuple(args, "Array", 1, 2, &arg0, &arg1))
110
110
  {
111
111
  return nullptr;
112
112
  }
@@ -1,7 +1,7 @@
1
1
  # WARNING: Please don't edit this file. It was automatically generated.
2
2
 
3
3
  [build-system]
4
- requires = ["setuptools", "setuptools-scm", "winrt-sdk"]
4
+ requires = ["setuptools", "winrt-sdk"]
5
5
  build-backend = "setuptools.build_meta"
6
6
 
7
7
  [project]
@@ -31,7 +31,7 @@ version = { file = "pywinrt-version.txt" }
31
31
  where = ["src"]
32
32
 
33
33
  [tool.setuptools.package-data]
34
- winrt = ["*.pyi", "py.typed"]
34
+ "*" = ["*.pyi", "py.typed"]
35
35
 
36
36
  [tool.cibuildwheel]
37
37
  # use local winrt-sdk build dependency
@@ -45,3 +45,4 @@ test-skip = "*-win_arm64"
45
45
 
46
46
  [tool.cibuildwheel.windows]
47
47
  archs = ["x86", "AMD64", "ARM64"]
48
+ repair-wheel-command = "python scripts/add_dlls.py {wheel} {dest_dir}"
@@ -0,0 +1 @@
1
+ 2.1.0
@@ -0,0 +1,31 @@
1
+ # WARNING: Please don't edit this file. It was automatically generated.
2
+
3
+ from setuptools import Extension, setup
4
+ from setuptools.command.build_ext import build_ext
5
+ from winrt_sdk import get_include_dirs
6
+
7
+
8
+ class build_ext_ex(build_ext):
9
+ def build_extension(self, ext):
10
+ if self.compiler.compiler_type == "msvc":
11
+ ext.extra_compile_args = ["/std:c++20", "/permissive-"]
12
+ elif self.compiler.compiler_type == "mingw32":
13
+ ext.extra_compile_args = ["-std=c++20", "-D_WIN32_WINNT=_WIN32_WINNT_WIN10"]
14
+ ext.extra_link_args = ["-loleaut32"]
15
+ else:
16
+ raise ValueError(f"Unsupported compiler: {self.compiler.compiler_type}")
17
+
18
+ build_ext.build_extension(self, ext)
19
+
20
+
21
+ setup(
22
+ cmdclass = {'build_ext': build_ext_ex},
23
+ ext_modules=[
24
+ Extension(
25
+ "winrt._winrt",
26
+ sources=["_winrt.cpp", "_winrt_array.cpp", "runtime.cpp"],
27
+ include_dirs=get_include_dirs(),
28
+ libraries=["windowsapp"],
29
+ )
30
+ ],
31
+ )
@@ -16,6 +16,7 @@ from typing import (
16
16
  ValuesView,
17
17
  overload,
18
18
  )
19
+ from uuid import UUID
19
20
 
20
21
  MTA: int
21
22
  STA: int
@@ -82,7 +83,11 @@ class MutableMapping(Mapping[_KT, _VT]):
82
83
 
83
84
  # actual runtime classes
84
85
 
85
- class Object: ...
86
+ class Object:
87
+ @property
88
+ def _iids_(self) -> Array[UUID]: ...
89
+ @property
90
+ def _runtime_class_name_(self) -> str: ...
86
91
 
87
92
  class Array(MutableSequence[_T]):
88
93
  _winrt_element_type_name_: str
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: winrt-runtime
3
- Version: 2.0.0b2
3
+ Version: 2.1.0
4
4
  Summary: Python projection of Windows Runtime (WinRT) APIs
5
5
  License: MIT
6
6
  Project-URL: Documentation, https://pywinrt.readthedocs.io
@@ -1 +0,0 @@
1
- 2.0.0-beta.2
@@ -1,16 +0,0 @@
1
- # WARNING: Please don't edit this file. It was automatically generated.
2
-
3
- from setuptools import Extension, setup
4
- from winrt_sdk import get_include_dirs
5
-
6
- setup(
7
- ext_modules=[
8
- Extension(
9
- "winrt._winrt",
10
- sources=["_winrt.cpp", "_winrt_array.cpp", "runtime.cpp"],
11
- include_dirs=get_include_dirs(),
12
- extra_compile_args=["/std:c++20", "/permissive-"],
13
- libraries=["windowsapp"],
14
- )
15
- ],
16
- )
File without changes
File without changes