winrt-Windows.System.Threading 2.3.0__tar.gz → 3.0.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.
Files changed (20) hide show
  1. {winrt_windows_system_threading-2.3.0 → winrt_windows_system_threading-3.0.0}/PKG-INFO +4 -4
  2. {winrt_windows_system_threading-2.3.0 → winrt_windows_system_threading-3.0.0}/all-requirements.txt +2 -2
  3. {winrt_windows_system_threading-2.3.0 → winrt_windows_system_threading-3.0.0}/py.Windows.System.Threading.cpp +146 -54
  4. {winrt_windows_system_threading-2.3.0 → winrt_windows_system_threading-3.0.0}/pyproject.toml +2 -2
  5. winrt_windows_system_threading-3.0.0/pywinrt-version.txt +1 -0
  6. {winrt_windows_system_threading-2.3.0 → winrt_windows_system_threading-3.0.0}/requirements.txt +2 -2
  7. {winrt_windows_system_threading-2.3.0 → winrt_windows_system_threading-3.0.0}/setup.py +1 -1
  8. winrt_windows_system_threading-3.0.0/winrt/_winrt_windows_system_threading.pyi +53 -0
  9. {winrt_windows_system_threading-2.3.0 → winrt_windows_system_threading-3.0.0}/winrt/windows/system/threading/__init__.py +7 -6
  10. {winrt_windows_system_threading-2.3.0 → winrt_windows_system_threading-3.0.0}/winrt_Windows.System.Threading.egg-info/PKG-INFO +4 -4
  11. winrt_windows_system_threading-3.0.0/winrt_Windows.System.Threading.egg-info/requires.txt +4 -0
  12. winrt_windows_system_threading-2.3.0/pywinrt-version.txt +0 -1
  13. winrt_windows_system_threading-2.3.0/winrt/_winrt_windows_system_threading.pyi +0 -52
  14. winrt_windows_system_threading-2.3.0/winrt_Windows.System.Threading.egg-info/requires.txt +0 -4
  15. {winrt_windows_system_threading-2.3.0 → winrt_windows_system_threading-3.0.0}/README.md +0 -0
  16. {winrt_windows_system_threading-2.3.0 → winrt_windows_system_threading-3.0.0}/setup.cfg +0 -0
  17. {winrt_windows_system_threading-2.3.0 → winrt_windows_system_threading-3.0.0}/winrt/windows/system/threading/py.typed +0 -0
  18. {winrt_windows_system_threading-2.3.0 → winrt_windows_system_threading-3.0.0}/winrt_Windows.System.Threading.egg-info/SOURCES.txt +0 -0
  19. {winrt_windows_system_threading-2.3.0 → winrt_windows_system_threading-3.0.0}/winrt_Windows.System.Threading.egg-info/dependency_links.txt +0 -0
  20. {winrt_windows_system_threading-2.3.0 → winrt_windows_system_threading-3.0.0}/winrt_Windows.System.Threading.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: winrt-Windows.System.Threading
3
- Version: 2.3.0
3
+ Version: 3.0.0
4
4
  Summary: Python projection of Windows Runtime (WinRT) APIs
5
5
  License: MIT
6
6
  Project-URL: Documentation, https://pywinrt.readthedocs.io
@@ -10,11 +10,11 @@ Classifier: Operating System :: Microsoft :: Windows
10
10
  Classifier: Programming Language :: Python :: 3
11
11
  Classifier: Programming Language :: Python :: Implementation :: CPython
12
12
  Classifier: Intended Audience :: Developers
13
- Requires-Python: <3.14,>=3.9
13
+ Requires-Python: >=3.9
14
14
  Description-Content-Type: text/markdown
15
- Requires-Dist: winrt-runtime==2.3.0
15
+ Requires-Dist: winrt-runtime==3.0.0
16
16
  Provides-Extra: all
17
- Requires-Dist: winrt-Windows.Foundation[all]==2.3.0; extra == "all"
17
+ Requires-Dist: winrt-Windows.Foundation[all]==3.0.0; extra == "all"
18
18
 
19
19
  <!-- warning: Please don't edit this file. It was automatically generated. -->
20
20
 
@@ -1,3 +1,3 @@
1
- # WARNING: Please don't edit this file. It was generated by Python/WinRT v2.3.0
1
+ # WARNING: Please don't edit this file. It was generated by Python/WinRT v3.0.0
2
2
 
3
- winrt-Windows.Foundation[all]==2.3.0
3
+ winrt-Windows.Foundation[all]==3.0.0
@@ -1,4 +1,4 @@
1
- // WARNING: Please don't edit this file. It was generated by Python/WinRT v2.3.0
1
+ // WARNING: Please don't edit this file. It was generated by Python/WinRT v3.0.0
2
2
 
3
3
  #include "py.Windows.System.Threading.h"
4
4
 
@@ -15,7 +15,7 @@ namespace py::cpp::Windows::System::Threading
15
15
 
16
16
  static PyObject* ThreadPool_RunAsync(PyObject* /*unused*/, PyObject* args) noexcept
17
17
  {
18
- auto arg_count = PyTuple_Size(args);
18
+ auto arg_count = PyTuple_GET_SIZE(args);
19
19
 
20
20
  if (arg_count == 1)
21
21
  {
@@ -36,7 +36,11 @@ namespace py::cpp::Windows::System::Threading
36
36
 
37
37
  auto param0 = py::convert_to<winrt::Windows::System::Threading::WorkItemHandler>(args, 0);
38
38
 
39
- return py::convert(winrt::Windows::System::Threading::ThreadPool::RunAsync(param0));
39
+ return py::convert([&]()
40
+ {
41
+ auto _gil = release_gil();
42
+ return winrt::Windows::System::Threading::ThreadPool::RunAsync(param0);
43
+ }());
40
44
  }
41
45
  catch (...)
42
46
  {
@@ -44,7 +48,18 @@ namespace py::cpp::Windows::System::Threading
44
48
  return nullptr;
45
49
  }
46
50
  }
47
- else if (arg_count == 2)
51
+ else
52
+ {
53
+ py::set_invalid_arg_count_error(arg_count);
54
+ return nullptr;
55
+ }
56
+ }
57
+
58
+ static PyObject* ThreadPool_RunWithPriorityAndOptionsAsync(PyObject* /*unused*/, PyObject* args) noexcept
59
+ {
60
+ auto arg_count = PyTuple_GET_SIZE(args);
61
+
62
+ if (arg_count == 3)
48
63
  {
49
64
  try
50
65
  {
@@ -52,19 +67,24 @@ namespace py::cpp::Windows::System::Threading
52
67
 
53
68
  if (!is_overload_present.has_value())
54
69
  {
55
- is_overload_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.System.Threading.ThreadPool", L"RunAsync", 2);
70
+ is_overload_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.System.Threading.ThreadPool", L"RunAsync", 3);
56
71
  }
57
72
 
58
73
  if (!is_overload_present.value())
59
74
  {
60
- py::set_arg_count_version_error(2);
75
+ py::set_arg_count_version_error(3);
61
76
  return nullptr;
62
77
  }
63
78
 
64
79
  auto param0 = py::convert_to<winrt::Windows::System::Threading::WorkItemHandler>(args, 0);
65
80
  auto param1 = py::convert_to<winrt::Windows::System::Threading::WorkItemPriority>(args, 1);
81
+ auto param2 = py::convert_to<winrt::Windows::System::Threading::WorkItemOptions>(args, 2);
66
82
 
67
- return py::convert(winrt::Windows::System::Threading::ThreadPool::RunAsync(param0, param1));
83
+ return py::convert([&]()
84
+ {
85
+ auto _gil = release_gil();
86
+ return winrt::Windows::System::Threading::ThreadPool::RunAsync(param0, param1, param2);
87
+ }());
68
88
  }
69
89
  catch (...)
70
90
  {
@@ -72,7 +92,18 @@ namespace py::cpp::Windows::System::Threading
72
92
  return nullptr;
73
93
  }
74
94
  }
75
- else if (arg_count == 3)
95
+ else
96
+ {
97
+ py::set_invalid_arg_count_error(arg_count);
98
+ return nullptr;
99
+ }
100
+ }
101
+
102
+ static PyObject* ThreadPool_RunWithPriorityAsync(PyObject* /*unused*/, PyObject* args) noexcept
103
+ {
104
+ auto arg_count = PyTuple_GET_SIZE(args);
105
+
106
+ if (arg_count == 2)
76
107
  {
77
108
  try
78
109
  {
@@ -80,20 +111,23 @@ namespace py::cpp::Windows::System::Threading
80
111
 
81
112
  if (!is_overload_present.has_value())
82
113
  {
83
- is_overload_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.System.Threading.ThreadPool", L"RunAsync", 3);
114
+ is_overload_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.System.Threading.ThreadPool", L"RunAsync", 2);
84
115
  }
85
116
 
86
117
  if (!is_overload_present.value())
87
118
  {
88
- py::set_arg_count_version_error(3);
119
+ py::set_arg_count_version_error(2);
89
120
  return nullptr;
90
121
  }
91
122
 
92
123
  auto param0 = py::convert_to<winrt::Windows::System::Threading::WorkItemHandler>(args, 0);
93
124
  auto param1 = py::convert_to<winrt::Windows::System::Threading::WorkItemPriority>(args, 1);
94
- auto param2 = py::convert_to<winrt::Windows::System::Threading::WorkItemOptions>(args, 2);
95
125
 
96
- return py::convert(winrt::Windows::System::Threading::ThreadPool::RunAsync(param0, param1, param2));
126
+ return py::convert([&]()
127
+ {
128
+ auto _gil = release_gil();
129
+ return winrt::Windows::System::Threading::ThreadPool::RunAsync(param0, param1);
130
+ }());
97
131
  }
98
132
  catch (...)
99
133
  {
@@ -109,19 +143,16 @@ namespace py::cpp::Windows::System::Threading
109
143
  }
110
144
 
111
145
  static PyMethodDef _methods_ThreadPool[] = {
112
- { }
113
- };
146
+ { }};
114
147
 
115
148
  static PyGetSetDef _getset_ThreadPool[] = {
116
- { }
117
- };
149
+ { }};
118
150
 
119
151
  static PyType_Slot _type_slots_ThreadPool[] = {
120
152
  { Py_tp_new, reinterpret_cast<void*>(_new_ThreadPool) },
121
153
  { Py_tp_methods, reinterpret_cast<void*>(_methods_ThreadPool) },
122
154
  { Py_tp_getset, reinterpret_cast<void*>(_getset_ThreadPool) },
123
- { }
124
- };
155
+ { }};
125
156
 
126
157
  static PyType_Spec type_spec_ThreadPool = {
127
158
  "winrt._winrt_windows_system_threading.ThreadPool",
@@ -131,13 +162,13 @@ namespace py::cpp::Windows::System::Threading
131
162
  _type_slots_ThreadPool};
132
163
 
133
164
  static PyGetSetDef getset_ThreadPool_Static[] = {
134
- { }
135
- };
165
+ { }};
136
166
 
137
167
  static PyMethodDef methods_ThreadPool_Static[] = {
138
168
  { "run_async", reinterpret_cast<PyCFunction>(ThreadPool_RunAsync), METH_VARARGS, nullptr },
139
- { }
140
- };
169
+ { "run_with_priority_and_options_async", reinterpret_cast<PyCFunction>(ThreadPool_RunWithPriorityAndOptionsAsync), METH_VARARGS, nullptr },
170
+ { "run_with_priority_async", reinterpret_cast<PyCFunction>(ThreadPool_RunWithPriorityAsync), METH_VARARGS, nullptr },
171
+ { }};
141
172
 
142
173
  static PyType_Slot type_slots_ThreadPool_Static[] =
143
174
  {
@@ -147,14 +178,12 @@ namespace py::cpp::Windows::System::Threading
147
178
  { }
148
179
  };
149
180
 
150
- static PyType_Spec type_spec_ThreadPool_Static =
151
- {
181
+ static PyType_Spec type_spec_ThreadPool_Static = {
152
182
  "winrt._winrt_windows_system_threading.ThreadPool_Static",
153
183
  static_cast<int>(PyType_Type.tp_basicsize),
154
184
  static_cast<int>(PyType_Type.tp_itemsize),
155
185
  Py_TPFLAGS_DEFAULT,
156
- type_slots_ThreadPool_Static
157
- };
186
+ type_slots_ThreadPool_Static};
158
187
 
159
188
  // ----- ThreadPoolTimer class --------------------
160
189
 
@@ -175,7 +204,7 @@ namespace py::cpp::Windows::System::Threading
175
204
 
176
205
  static PyObject* ThreadPoolTimer_Cancel(py::wrapper::Windows::System::Threading::ThreadPoolTimer* self, PyObject* args) noexcept
177
206
  {
178
- auto arg_count = PyTuple_Size(args);
207
+ auto arg_count = PyTuple_GET_SIZE(args);
179
208
 
180
209
  if (arg_count == 0)
181
210
  {
@@ -194,7 +223,11 @@ namespace py::cpp::Windows::System::Threading
194
223
  return nullptr;
195
224
  }
196
225
 
197
- self->obj.Cancel();
226
+ {
227
+ auto _gil = release_gil();
228
+ self->obj.Cancel();
229
+ }
230
+
198
231
  Py_RETURN_NONE;
199
232
  }
200
233
  catch (...)
@@ -212,7 +245,7 @@ namespace py::cpp::Windows::System::Threading
212
245
 
213
246
  static PyObject* ThreadPoolTimer_CreatePeriodicTimer(PyObject* /*unused*/, PyObject* args) noexcept
214
247
  {
215
- auto arg_count = PyTuple_Size(args);
248
+ auto arg_count = PyTuple_GET_SIZE(args);
216
249
 
217
250
  if (arg_count == 2)
218
251
  {
@@ -234,7 +267,11 @@ namespace py::cpp::Windows::System::Threading
234
267
  auto param0 = py::convert_to<winrt::Windows::System::Threading::TimerElapsedHandler>(args, 0);
235
268
  auto param1 = py::convert_to<winrt::Windows::Foundation::TimeSpan>(args, 1);
236
269
 
237
- return py::convert(winrt::Windows::System::Threading::ThreadPoolTimer::CreatePeriodicTimer(param0, param1));
270
+ return py::convert([&]()
271
+ {
272
+ auto _gil = release_gil();
273
+ return winrt::Windows::System::Threading::ThreadPoolTimer::CreatePeriodicTimer(param0, param1);
274
+ }());
238
275
  }
239
276
  catch (...)
240
277
  {
@@ -242,7 +279,18 @@ namespace py::cpp::Windows::System::Threading
242
279
  return nullptr;
243
280
  }
244
281
  }
245
- else if (arg_count == 3)
282
+ else
283
+ {
284
+ py::set_invalid_arg_count_error(arg_count);
285
+ return nullptr;
286
+ }
287
+ }
288
+
289
+ static PyObject* ThreadPoolTimer_CreatePeriodicTimerWithCompletion(PyObject* /*unused*/, PyObject* args) noexcept
290
+ {
291
+ auto arg_count = PyTuple_GET_SIZE(args);
292
+
293
+ if (arg_count == 3)
246
294
  {
247
295
  try
248
296
  {
@@ -263,7 +311,11 @@ namespace py::cpp::Windows::System::Threading
263
311
  auto param1 = py::convert_to<winrt::Windows::Foundation::TimeSpan>(args, 1);
264
312
  auto param2 = py::convert_to<winrt::Windows::System::Threading::TimerDestroyedHandler>(args, 2);
265
313
 
266
- return py::convert(winrt::Windows::System::Threading::ThreadPoolTimer::CreatePeriodicTimer(param0, param1, param2));
314
+ return py::convert([&]()
315
+ {
316
+ auto _gil = release_gil();
317
+ return winrt::Windows::System::Threading::ThreadPoolTimer::CreatePeriodicTimer(param0, param1, param2);
318
+ }());
267
319
  }
268
320
  catch (...)
269
321
  {
@@ -280,7 +332,7 @@ namespace py::cpp::Windows::System::Threading
280
332
 
281
333
  static PyObject* ThreadPoolTimer_CreateTimer(PyObject* /*unused*/, PyObject* args) noexcept
282
334
  {
283
- auto arg_count = PyTuple_Size(args);
335
+ auto arg_count = PyTuple_GET_SIZE(args);
284
336
 
285
337
  if (arg_count == 2)
286
338
  {
@@ -302,7 +354,11 @@ namespace py::cpp::Windows::System::Threading
302
354
  auto param0 = py::convert_to<winrt::Windows::System::Threading::TimerElapsedHandler>(args, 0);
303
355
  auto param1 = py::convert_to<winrt::Windows::Foundation::TimeSpan>(args, 1);
304
356
 
305
- return py::convert(winrt::Windows::System::Threading::ThreadPoolTimer::CreateTimer(param0, param1));
357
+ return py::convert([&]()
358
+ {
359
+ auto _gil = release_gil();
360
+ return winrt::Windows::System::Threading::ThreadPoolTimer::CreateTimer(param0, param1);
361
+ }());
306
362
  }
307
363
  catch (...)
308
364
  {
@@ -310,7 +366,18 @@ namespace py::cpp::Windows::System::Threading
310
366
  return nullptr;
311
367
  }
312
368
  }
313
- else if (arg_count == 3)
369
+ else
370
+ {
371
+ py::set_invalid_arg_count_error(arg_count);
372
+ return nullptr;
373
+ }
374
+ }
375
+
376
+ static PyObject* ThreadPoolTimer_CreateTimerWithCompletion(PyObject* /*unused*/, PyObject* args) noexcept
377
+ {
378
+ auto arg_count = PyTuple_GET_SIZE(args);
379
+
380
+ if (arg_count == 3)
314
381
  {
315
382
  try
316
383
  {
@@ -331,7 +398,11 @@ namespace py::cpp::Windows::System::Threading
331
398
  auto param1 = py::convert_to<winrt::Windows::Foundation::TimeSpan>(args, 1);
332
399
  auto param2 = py::convert_to<winrt::Windows::System::Threading::TimerDestroyedHandler>(args, 2);
333
400
 
334
- return py::convert(winrt::Windows::System::Threading::ThreadPoolTimer::CreateTimer(param0, param1, param2));
401
+ return py::convert([&]()
402
+ {
403
+ auto _gil = release_gil();
404
+ return winrt::Windows::System::Threading::ThreadPoolTimer::CreateTimer(param0, param1, param2);
405
+ }());
335
406
  }
336
407
  catch (...)
337
408
  {
@@ -363,7 +434,11 @@ namespace py::cpp::Windows::System::Threading
363
434
  return nullptr;
364
435
  }
365
436
 
366
- return py::convert(self->obj.Delay());
437
+ return py::convert([&]()
438
+ {
439
+ auto _gil = release_gil();
440
+ return self->obj.Delay();
441
+ }());
367
442
  }
368
443
  catch (...)
369
444
  {
@@ -389,7 +464,11 @@ namespace py::cpp::Windows::System::Threading
389
464
  return nullptr;
390
465
  }
391
466
 
392
- return py::convert(self->obj.Period());
467
+ return py::convert([&]()
468
+ {
469
+ auto _gil = release_gil();
470
+ return self->obj.Period();
471
+ }());
393
472
  }
394
473
  catch (...)
395
474
  {
@@ -426,22 +505,19 @@ namespace py::cpp::Windows::System::Threading
426
505
  { "cancel", reinterpret_cast<PyCFunction>(ThreadPoolTimer_Cancel), METH_VARARGS, nullptr },
427
506
  { "_assign_array_", _assign_array_ThreadPoolTimer, METH_O | METH_STATIC, nullptr },
428
507
  { "_from", reinterpret_cast<PyCFunction>(_from_ThreadPoolTimer), METH_O | METH_STATIC, nullptr },
429
- { }
430
- };
508
+ { }};
431
509
 
432
510
  static PyGetSetDef _getset_ThreadPoolTimer[] = {
433
511
  { "delay", reinterpret_cast<getter>(ThreadPoolTimer_get_Delay), nullptr, nullptr, nullptr },
434
512
  { "period", reinterpret_cast<getter>(ThreadPoolTimer_get_Period), nullptr, nullptr, nullptr },
435
- { }
436
- };
513
+ { }};
437
514
 
438
515
  static PyType_Slot _type_slots_ThreadPoolTimer[] = {
439
516
  { Py_tp_new, reinterpret_cast<void*>(_new_ThreadPoolTimer) },
440
517
  { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_ThreadPoolTimer) },
441
518
  { Py_tp_methods, reinterpret_cast<void*>(_methods_ThreadPoolTimer) },
442
519
  { Py_tp_getset, reinterpret_cast<void*>(_getset_ThreadPoolTimer) },
443
- { }
444
- };
520
+ { }};
445
521
 
446
522
  static PyType_Spec type_spec_ThreadPoolTimer = {
447
523
  "winrt._winrt_windows_system_threading.ThreadPoolTimer",
@@ -451,14 +527,14 @@ namespace py::cpp::Windows::System::Threading
451
527
  _type_slots_ThreadPoolTimer};
452
528
 
453
529
  static PyGetSetDef getset_ThreadPoolTimer_Static[] = {
454
- { }
455
- };
530
+ { }};
456
531
 
457
532
  static PyMethodDef methods_ThreadPoolTimer_Static[] = {
458
533
  { "create_periodic_timer", reinterpret_cast<PyCFunction>(ThreadPoolTimer_CreatePeriodicTimer), METH_VARARGS, nullptr },
534
+ { "create_periodic_timer_with_completion", reinterpret_cast<PyCFunction>(ThreadPoolTimer_CreatePeriodicTimerWithCompletion), METH_VARARGS, nullptr },
459
535
  { "create_timer", reinterpret_cast<PyCFunction>(ThreadPoolTimer_CreateTimer), METH_VARARGS, nullptr },
460
- { }
461
- };
536
+ { "create_timer_with_completion", reinterpret_cast<PyCFunction>(ThreadPoolTimer_CreateTimerWithCompletion), METH_VARARGS, nullptr },
537
+ { }};
462
538
 
463
539
  static PyType_Slot type_slots_ThreadPoolTimer_Static[] =
464
540
  {
@@ -468,14 +544,12 @@ namespace py::cpp::Windows::System::Threading
468
544
  { }
469
545
  };
470
546
 
471
- static PyType_Spec type_spec_ThreadPoolTimer_Static =
472
- {
547
+ static PyType_Spec type_spec_ThreadPoolTimer_Static = {
473
548
  "winrt._winrt_windows_system_threading.ThreadPoolTimer_Static",
474
549
  static_cast<int>(PyType_Type.tp_basicsize),
475
550
  static_cast<int>(PyType_Type.tp_itemsize),
476
551
  Py_TPFLAGS_DEFAULT,
477
- type_slots_ThreadPoolTimer_Static
478
- };
552
+ type_slots_ThreadPoolTimer_Static};
479
553
 
480
554
  // ----- Windows.System.Threading Initialization --------------------
481
555
 
@@ -509,6 +583,12 @@ PyMODINIT_FUNC PyInit__winrt_windows_system_threading(void) noexcept
509
583
  return nullptr;
510
584
  }
511
585
 
586
+ auto inspectable_meta_type = py::get_inspectable_meta_type();
587
+ if (!inspectable_meta_type)
588
+ {
589
+ return nullptr;
590
+ }
591
+
512
592
  auto object_type = py::get_object_type();
513
593
  if (!object_type)
514
594
  {
@@ -522,7 +602,13 @@ PyMODINIT_FUNC PyInit__winrt_windows_system_threading(void) noexcept
522
602
  return nullptr;
523
603
  }
524
604
 
525
- py::pyobj_handle type_ThreadPool_Static{PyType_FromSpec(&type_spec_ThreadPool_Static)};
605
+ py::pyobj_handle ThreadPool_Static_bases{PyTuple_Pack(1, reinterpret_cast<PyObject*>(inspectable_meta_type))};
606
+ if (!ThreadPool_Static_bases)
607
+ {
608
+ return nullptr;
609
+ }
610
+
611
+ py::pyobj_handle type_ThreadPool_Static{PyType_FromSpecWithBases(&type_spec_ThreadPool_Static, ThreadPool_Static_bases.get())};
526
612
  if (!type_ThreadPool_Static)
527
613
  {
528
614
  return nullptr;
@@ -534,7 +620,13 @@ PyMODINIT_FUNC PyInit__winrt_windows_system_threading(void) noexcept
534
620
  return nullptr;
535
621
  }
536
622
 
537
- py::pyobj_handle type_ThreadPoolTimer_Static{PyType_FromSpec(&type_spec_ThreadPoolTimer_Static)};
623
+ py::pyobj_handle ThreadPoolTimer_Static_bases{PyTuple_Pack(1, reinterpret_cast<PyObject*>(inspectable_meta_type))};
624
+ if (!ThreadPoolTimer_Static_bases)
625
+ {
626
+ return nullptr;
627
+ }
628
+
629
+ py::pyobj_handle type_ThreadPoolTimer_Static{PyType_FromSpecWithBases(&type_spec_ThreadPoolTimer_Static, ThreadPoolTimer_Static_bases.get())};
538
630
  if (!type_ThreadPoolTimer_Static)
539
631
  {
540
632
  return nullptr;
@@ -16,7 +16,7 @@ classifiers = [
16
16
  "Intended Audience :: Developers",
17
17
  ]
18
18
  dynamic = ["version", "dependencies", "optional-dependencies"]
19
- requires-python = ">=3.9,<3.14"
19
+ requires-python = ">=3.9"
20
20
 
21
21
  [project.urls]
22
22
  # Homepage = "https://github.com/pywinrt/pywinrt"
@@ -34,7 +34,7 @@ optional-dependencies.all = { file = "all-requirements.txt" }
34
34
 
35
35
  [tool.cibuildwheel]
36
36
  # use local winrt-sdk build dependency
37
- environment = { PYTHONPATH="../winrt-sdk/src" }
37
+ environment = { PYTHONPATH="../../winrt-sdk/src" }
38
38
  # don't install winrt-sdk from PyPI
39
39
  build-frontend = { name = "build[uv]", args = ["--skip-dependency-check", "--no-isolation"] }
40
40
  before-build = "uv pip install setuptools"
@@ -1,3 +1,3 @@
1
- # WARNING: Please don't edit this file. It was generated by Python/WinRT v2.3.0
1
+ # WARNING: Please don't edit this file. It was generated by Python/WinRT v3.0.0
2
2
 
3
- winrt-runtime==2.3.0
3
+ winrt-runtime==3.0.0
@@ -19,7 +19,7 @@ class build_ext_ex(build_ext):
19
19
 
20
20
 
21
21
  setup(
22
- cmdclass = {'build_ext': build_ext_ex},
22
+ cmdclass={"build_ext": build_ext_ex},
23
23
  ext_modules=[
24
24
  Extension(
25
25
  "winrt._winrt_windows_system_threading",
@@ -0,0 +1,53 @@
1
+ # WARNING: Please don't edit this file. It was generated by Python/WinRT v3.0.0
2
+
3
+ import datetime
4
+ import sys
5
+ import types
6
+ import typing
7
+ import uuid as _uuid
8
+ from builtins import property as _property
9
+
10
+ import winrt._winrt
11
+ import winrt.system
12
+ import winrt.windows.foundation as windows_foundation
13
+
14
+ from winrt.windows.system.threading import WorkItemOptions, WorkItemPriority
15
+ from winrt.windows.system.threading import TimerDestroyedHandler, TimerElapsedHandler, WorkItemHandler
16
+
17
+ Self = typing.TypeVar('Self')
18
+
19
+ @typing.final
20
+ class ThreadPool_Static(winrt._winrt.IInspectable_Static):
21
+ # Windows.Foundation.IAsyncAction Windows.System.Threading.ThreadPool::RunAsync(Windows.System.Threading.WorkItemHandler)
22
+ def run_async(cls, handler: WorkItemHandler, /) -> windows_foundation.IAsyncAction: ...
23
+ # Windows.Foundation.IAsyncAction Windows.System.Threading.ThreadPool::RunAsync(Windows.System.Threading.WorkItemHandler,Windows.System.Threading.WorkItemPriority,Windows.System.Threading.WorkItemOptions)
24
+ def run_with_priority_and_options_async(cls, handler: WorkItemHandler, priority: WorkItemPriority, options: WorkItemOptions, /) -> windows_foundation.IAsyncAction: ...
25
+ # Windows.Foundation.IAsyncAction Windows.System.Threading.ThreadPool::RunAsync(Windows.System.Threading.WorkItemHandler,Windows.System.Threading.WorkItemPriority)
26
+ def run_with_priority_async(cls, handler: WorkItemHandler, priority: WorkItemPriority, /) -> windows_foundation.IAsyncAction: ...
27
+
28
+ @typing.final
29
+ class ThreadPool(winrt.system.Object, metaclass=ThreadPool_Static):
30
+ pass
31
+
32
+ @typing.final
33
+ class ThreadPoolTimer_Static(winrt._winrt.IInspectable_Static):
34
+ # Windows.System.Threading.ThreadPoolTimer Windows.System.Threading.ThreadPoolTimer::CreatePeriodicTimer(Windows.System.Threading.TimerElapsedHandler,Windows.Foundation.TimeSpan)
35
+ def create_periodic_timer(cls, handler: TimerElapsedHandler, period: datetime.timedelta, /) -> ThreadPoolTimer: ...
36
+ # Windows.System.Threading.ThreadPoolTimer Windows.System.Threading.ThreadPoolTimer::CreatePeriodicTimer(Windows.System.Threading.TimerElapsedHandler,Windows.Foundation.TimeSpan,Windows.System.Threading.TimerDestroyedHandler)
37
+ def create_periodic_timer_with_completion(cls, handler: TimerElapsedHandler, period: datetime.timedelta, destroyed: TimerDestroyedHandler, /) -> ThreadPoolTimer: ...
38
+ # Windows.System.Threading.ThreadPoolTimer Windows.System.Threading.ThreadPoolTimer::CreateTimer(Windows.System.Threading.TimerElapsedHandler,Windows.Foundation.TimeSpan)
39
+ def create_timer(cls, handler: TimerElapsedHandler, delay: datetime.timedelta, /) -> ThreadPoolTimer: ...
40
+ # Windows.System.Threading.ThreadPoolTimer Windows.System.Threading.ThreadPoolTimer::CreateTimer(Windows.System.Threading.TimerElapsedHandler,Windows.Foundation.TimeSpan,Windows.System.Threading.TimerDestroyedHandler)
41
+ def create_timer_with_completion(cls, handler: TimerElapsedHandler, delay: datetime.timedelta, destroyed: TimerDestroyedHandler, /) -> ThreadPoolTimer: ...
42
+
43
+ @typing.final
44
+ class ThreadPoolTimer(winrt.system.Object, metaclass=ThreadPoolTimer_Static):
45
+ # System.Void Windows.System.Threading.ThreadPoolTimer::Cancel()
46
+ def cancel(self) -> None: ...
47
+ # Windows.Foundation.TimeSpan Windows.System.Threading.ThreadPoolTimer::get_Delay()
48
+ @_property
49
+ def delay(self) -> datetime.timedelta: ...
50
+ # Windows.Foundation.TimeSpan Windows.System.Threading.ThreadPoolTimer::get_Period()
51
+ @_property
52
+ def period(self) -> datetime.timedelta: ...
53
+
@@ -1,11 +1,14 @@
1
- # WARNING: Please don't edit this file. It was generated by Python/WinRT v2.3.0
1
+ # WARNING: Please don't edit this file. It was generated by Python/WinRT v3.0.0
2
2
 
3
3
  import enum
4
4
  import typing
5
5
  import uuid as _uuid
6
6
 
7
7
  import winrt.system
8
- from winrt import _winrt_windows_system_threading
8
+ from winrt._winrt_windows_system_threading import (
9
+ ThreadPool,
10
+ ThreadPoolTimer,
11
+ )
9
12
 
10
13
  if typing.TYPE_CHECKING:
11
14
  import winrt.windows.foundation as windows_foundation
@@ -29,8 +32,6 @@ class WorkItemPriority(enum.IntEnum):
29
32
  NORMAL = 0
30
33
  HIGH = 1
31
34
 
32
- ThreadPool = _winrt_windows_system_threading.ThreadPool
33
- ThreadPoolTimer = _winrt_windows_system_threading.ThreadPoolTimer
34
- TimerDestroyedHandler = typing.Callable[[typing.Optional[ThreadPoolTimer]], None]
35
- TimerElapsedHandler = typing.Callable[[typing.Optional[ThreadPoolTimer]], None]
35
+ TimerDestroyedHandler = typing.Callable[[ThreadPoolTimer], None]
36
+ TimerElapsedHandler = typing.Callable[[ThreadPoolTimer], None]
36
37
  WorkItemHandler = typing.Callable[["windows_foundation.IAsyncAction"], None]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: winrt-Windows.System.Threading
3
- Version: 2.3.0
3
+ Version: 3.0.0
4
4
  Summary: Python projection of Windows Runtime (WinRT) APIs
5
5
  License: MIT
6
6
  Project-URL: Documentation, https://pywinrt.readthedocs.io
@@ -10,11 +10,11 @@ Classifier: Operating System :: Microsoft :: Windows
10
10
  Classifier: Programming Language :: Python :: 3
11
11
  Classifier: Programming Language :: Python :: Implementation :: CPython
12
12
  Classifier: Intended Audience :: Developers
13
- Requires-Python: <3.14,>=3.9
13
+ Requires-Python: >=3.9
14
14
  Description-Content-Type: text/markdown
15
- Requires-Dist: winrt-runtime==2.3.0
15
+ Requires-Dist: winrt-runtime==3.0.0
16
16
  Provides-Extra: all
17
- Requires-Dist: winrt-Windows.Foundation[all]==2.3.0; extra == "all"
17
+ Requires-Dist: winrt-Windows.Foundation[all]==3.0.0; extra == "all"
18
18
 
19
19
  <!-- warning: Please don't edit this file. It was automatically generated. -->
20
20
 
@@ -0,0 +1,4 @@
1
+ winrt-runtime==3.0.0
2
+
3
+ [all]
4
+ winrt-Windows.Foundation[all]==3.0.0
@@ -1,52 +0,0 @@
1
- # WARNING: Please don't edit this file. It was generated by Python/WinRT v2.3.0
2
-
3
- import datetime
4
- import sys
5
- import types
6
- import typing
7
- import uuid as _uuid
8
- from builtins import property as _property
9
-
10
- import winrt._winrt
11
- import winrt.system
12
- import winrt.windows.foundation as windows_foundation
13
-
14
- from winrt.windows.system.threading import WorkItemOptions, WorkItemPriority
15
- from winrt.windows.system.threading import TimerDestroyedHandler, TimerElapsedHandler, WorkItemHandler
16
-
17
- Self = typing.TypeVar('Self')
18
-
19
- @typing.final
20
- class ThreadPool_Static(type):
21
- @typing.overload
22
- def run_async(cls, handler: typing.Optional[WorkItemHandler], /) -> windows_foundation.IAsyncAction: ...
23
- @typing.overload
24
- def run_async(cls, handler: typing.Optional[WorkItemHandler], priority: WorkItemPriority, /) -> windows_foundation.IAsyncAction: ...
25
- @typing.overload
26
- def run_async(cls, handler: typing.Optional[WorkItemHandler], priority: WorkItemPriority, options: WorkItemOptions, /) -> windows_foundation.IAsyncAction: ...
27
-
28
- @typing.final
29
- class ThreadPool(winrt.system.Object, metaclass=ThreadPool_Static):
30
- pass
31
-
32
- @typing.final
33
- class ThreadPoolTimer_Static(type):
34
- @typing.overload
35
- def create_periodic_timer(cls, handler: typing.Optional[TimerElapsedHandler], period: datetime.timedelta, /) -> typing.Optional[ThreadPoolTimer]: ...
36
- @typing.overload
37
- def create_periodic_timer(cls, handler: typing.Optional[TimerElapsedHandler], period: datetime.timedelta, destroyed: typing.Optional[TimerDestroyedHandler], /) -> typing.Optional[ThreadPoolTimer]: ...
38
- @typing.overload
39
- def create_timer(cls, handler: typing.Optional[TimerElapsedHandler], delay: datetime.timedelta, /) -> typing.Optional[ThreadPoolTimer]: ...
40
- @typing.overload
41
- def create_timer(cls, handler: typing.Optional[TimerElapsedHandler], delay: datetime.timedelta, destroyed: typing.Optional[TimerDestroyedHandler], /) -> typing.Optional[ThreadPoolTimer]: ...
42
-
43
- @typing.final
44
- class ThreadPoolTimer(winrt.system.Object, metaclass=ThreadPoolTimer_Static):
45
- @staticmethod
46
- def _from(obj: winrt.system.Object, /) -> ThreadPoolTimer: ...
47
- def cancel(self) -> None: ...
48
- @_property
49
- def delay(self) -> datetime.timedelta: ...
50
- @_property
51
- def period(self) -> datetime.timedelta: ...
52
-
@@ -1,4 +0,0 @@
1
- winrt-runtime==2.3.0
2
-
3
- [all]
4
- winrt-Windows.Foundation[all]==2.3.0