winrt-Windows.Networking 2.0.1__tar.gz → 2.2.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_networking-2.0.1 → winrt_windows_networking-2.2.0}/PKG-INFO +4 -4
  2. winrt_windows_networking-2.2.0/all-requirements.txt +3 -0
  3. {winrt_windows_networking-2.0.1 → winrt_windows_networking-2.2.0}/py.Windows.Networking.cpp +234 -128
  4. {winrt_windows_networking-2.0.1 → winrt_windows_networking-2.2.0}/pyproject.toml +3 -2
  5. winrt_windows_networking-2.2.0/pywinrt-version.txt +1 -0
  6. {winrt_windows_networking-2.0.1 → winrt_windows_networking-2.2.0}/requirements.txt +2 -2
  7. {winrt_windows_networking-2.0.1 → winrt_windows_networking-2.2.0}/winrt/_winrt_windows_networking.pyi +5 -5
  8. {winrt_windows_networking-2.0.1 → winrt_windows_networking-2.2.0}/winrt/windows/networking/__init__.py +2 -2
  9. {winrt_windows_networking-2.0.1 → winrt_windows_networking-2.2.0}/winrt_Windows.Networking.egg-info/PKG-INFO +4 -4
  10. winrt_windows_networking-2.2.0/winrt_Windows.Networking.egg-info/requires.txt +4 -0
  11. winrt_windows_networking-2.0.1/all-requirements.txt +0 -3
  12. winrt_windows_networking-2.0.1/pywinrt-version.txt +0 -1
  13. winrt_windows_networking-2.0.1/winrt_Windows.Networking.egg-info/requires.txt +0 -4
  14. {winrt_windows_networking-2.0.1 → winrt_windows_networking-2.2.0}/README.md +0 -0
  15. {winrt_windows_networking-2.0.1 → winrt_windows_networking-2.2.0}/setup.cfg +0 -0
  16. {winrt_windows_networking-2.0.1 → winrt_windows_networking-2.2.0}/setup.py +0 -0
  17. {winrt_windows_networking-2.0.1 → winrt_windows_networking-2.2.0}/winrt/windows/networking/py.typed +0 -0
  18. {winrt_windows_networking-2.0.1 → winrt_windows_networking-2.2.0}/winrt_Windows.Networking.egg-info/SOURCES.txt +0 -0
  19. {winrt_windows_networking-2.0.1 → winrt_windows_networking-2.2.0}/winrt_Windows.Networking.egg-info/dependency_links.txt +0 -0
  20. {winrt_windows_networking-2.0.1 → winrt_windows_networking-2.2.0}/winrt_Windows.Networking.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: winrt-Windows.Networking
3
- Version: 2.0.1
3
+ Version: 2.2.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.13,>=3.9
13
+ Requires-Python: <3.14,>=3.9
14
14
  Description-Content-Type: text/markdown
15
- Requires-Dist: winrt-runtime==2.0.1
15
+ Requires-Dist: winrt-runtime==2.2.0
16
16
  Provides-Extra: all
17
- Requires-Dist: winrt-Windows.Networking.Connectivity[all]==2.0.1; extra == "all"
17
+ Requires-Dist: winrt-Windows.Networking.Connectivity[all]==2.2.0; extra == "all"
18
18
 
19
19
  <!-- warning: Please don't edit this file. It was automatically generated. -->
20
20
 
@@ -0,0 +1,3 @@
1
+ # WARNING: Please don't edit this file. It was generated by Python/WinRT v2.2.0
2
+
3
+ winrt-Windows.Networking.Connectivity[all]==2.2.0
@@ -1,8 +1,7 @@
1
- // WARNING: Please don't edit this file. It was generated by Python/WinRT v2.0.1
1
+ // WARNING: Please don't edit this file. It was generated by Python/WinRT v2.2.0
2
2
 
3
3
  #include "py.Windows.Networking.h"
4
4
 
5
-
6
5
  namespace py::cpp::Windows::Networking
7
6
  {
8
7
  // ----- EndpointPair class --------------------
@@ -25,7 +24,7 @@ namespace py::cpp::Windows::Networking
25
24
  auto param2 = py::convert_to<winrt::Windows::Networking::HostName>(args, 2);
26
25
  auto param3 = py::convert_to<winrt::hstring>(args, 3);
27
26
 
28
- winrt::Windows::Networking::EndpointPair instance{ param0, param1, param2, param3 };
27
+ winrt::Windows::Networking::EndpointPair instance{param0, param1, param2, param3};
29
28
  return py::wrap(instance, type);
30
29
  }
31
30
  catch (...)
@@ -51,14 +50,21 @@ namespace py::cpp::Windows::Networking
51
50
 
52
51
  static PyObject* EndpointPair_get_RemoteServiceName(py::wrapper::Windows::Networking::EndpointPair* self, void* /*unused*/) noexcept
53
52
  {
54
- if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Networking.EndpointPair", L"RemoteServiceName"))
55
- {
56
- PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
57
- return nullptr;
58
- }
59
-
60
53
  try
61
54
  {
55
+ static std::optional<bool> is_property_present{};
56
+
57
+ if (!is_property_present.has_value())
58
+ {
59
+ is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Networking.EndpointPair", L"RemoteServiceName");
60
+ }
61
+
62
+ if (!is_property_present.value())
63
+ {
64
+ PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
65
+ return nullptr;
66
+ }
67
+
62
68
  return py::convert(self->obj.RemoteServiceName());
63
69
  }
64
70
  catch (...)
@@ -70,12 +76,6 @@ namespace py::cpp::Windows::Networking
70
76
 
71
77
  static int EndpointPair_put_RemoteServiceName(py::wrapper::Windows::Networking::EndpointPair* self, PyObject* arg, void* /*unused*/) noexcept
72
78
  {
73
- if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Networking.EndpointPair", L"RemoteServiceName"))
74
- {
75
- PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
76
- return -1;
77
- }
78
-
79
79
  if (arg == nullptr)
80
80
  {
81
81
  PyErr_SetString(PyExc_AttributeError, "can't delete attribute");
@@ -84,6 +84,19 @@ namespace py::cpp::Windows::Networking
84
84
 
85
85
  try
86
86
  {
87
+ static std::optional<bool> is_property_present{};
88
+
89
+ if (!is_property_present.has_value())
90
+ {
91
+ is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Networking.EndpointPair", L"RemoteServiceName");
92
+ }
93
+
94
+ if (!is_property_present.value())
95
+ {
96
+ PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
97
+ return -1;
98
+ }
99
+
87
100
  auto param0 = py::convert_to<winrt::hstring>(arg);
88
101
 
89
102
  self->obj.RemoteServiceName(param0);
@@ -98,14 +111,21 @@ namespace py::cpp::Windows::Networking
98
111
 
99
112
  static PyObject* EndpointPair_get_RemoteHostName(py::wrapper::Windows::Networking::EndpointPair* self, void* /*unused*/) noexcept
100
113
  {
101
- if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Networking.EndpointPair", L"RemoteHostName"))
102
- {
103
- PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
104
- return nullptr;
105
- }
106
-
107
114
  try
108
115
  {
116
+ static std::optional<bool> is_property_present{};
117
+
118
+ if (!is_property_present.has_value())
119
+ {
120
+ is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Networking.EndpointPair", L"RemoteHostName");
121
+ }
122
+
123
+ if (!is_property_present.value())
124
+ {
125
+ PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
126
+ return nullptr;
127
+ }
128
+
109
129
  return py::convert(self->obj.RemoteHostName());
110
130
  }
111
131
  catch (...)
@@ -117,12 +137,6 @@ namespace py::cpp::Windows::Networking
117
137
 
118
138
  static int EndpointPair_put_RemoteHostName(py::wrapper::Windows::Networking::EndpointPair* self, PyObject* arg, void* /*unused*/) noexcept
119
139
  {
120
- if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Networking.EndpointPair", L"RemoteHostName"))
121
- {
122
- PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
123
- return -1;
124
- }
125
-
126
140
  if (arg == nullptr)
127
141
  {
128
142
  PyErr_SetString(PyExc_AttributeError, "can't delete attribute");
@@ -131,6 +145,19 @@ namespace py::cpp::Windows::Networking
131
145
 
132
146
  try
133
147
  {
148
+ static std::optional<bool> is_property_present{};
149
+
150
+ if (!is_property_present.has_value())
151
+ {
152
+ is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Networking.EndpointPair", L"RemoteHostName");
153
+ }
154
+
155
+ if (!is_property_present.value())
156
+ {
157
+ PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
158
+ return -1;
159
+ }
160
+
134
161
  auto param0 = py::convert_to<winrt::Windows::Networking::HostName>(arg);
135
162
 
136
163
  self->obj.RemoteHostName(param0);
@@ -145,14 +172,21 @@ namespace py::cpp::Windows::Networking
145
172
 
146
173
  static PyObject* EndpointPair_get_LocalServiceName(py::wrapper::Windows::Networking::EndpointPair* self, void* /*unused*/) noexcept
147
174
  {
148
- if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Networking.EndpointPair", L"LocalServiceName"))
149
- {
150
- PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
151
- return nullptr;
152
- }
153
-
154
175
  try
155
176
  {
177
+ static std::optional<bool> is_property_present{};
178
+
179
+ if (!is_property_present.has_value())
180
+ {
181
+ is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Networking.EndpointPair", L"LocalServiceName");
182
+ }
183
+
184
+ if (!is_property_present.value())
185
+ {
186
+ PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
187
+ return nullptr;
188
+ }
189
+
156
190
  return py::convert(self->obj.LocalServiceName());
157
191
  }
158
192
  catch (...)
@@ -164,12 +198,6 @@ namespace py::cpp::Windows::Networking
164
198
 
165
199
  static int EndpointPair_put_LocalServiceName(py::wrapper::Windows::Networking::EndpointPair* self, PyObject* arg, void* /*unused*/) noexcept
166
200
  {
167
- if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Networking.EndpointPair", L"LocalServiceName"))
168
- {
169
- PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
170
- return -1;
171
- }
172
-
173
201
  if (arg == nullptr)
174
202
  {
175
203
  PyErr_SetString(PyExc_AttributeError, "can't delete attribute");
@@ -178,6 +206,19 @@ namespace py::cpp::Windows::Networking
178
206
 
179
207
  try
180
208
  {
209
+ static std::optional<bool> is_property_present{};
210
+
211
+ if (!is_property_present.has_value())
212
+ {
213
+ is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Networking.EndpointPair", L"LocalServiceName");
214
+ }
215
+
216
+ if (!is_property_present.value())
217
+ {
218
+ PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
219
+ return -1;
220
+ }
221
+
181
222
  auto param0 = py::convert_to<winrt::hstring>(arg);
182
223
 
183
224
  self->obj.LocalServiceName(param0);
@@ -192,14 +233,21 @@ namespace py::cpp::Windows::Networking
192
233
 
193
234
  static PyObject* EndpointPair_get_LocalHostName(py::wrapper::Windows::Networking::EndpointPair* self, void* /*unused*/) noexcept
194
235
  {
195
- if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Networking.EndpointPair", L"LocalHostName"))
196
- {
197
- PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
198
- return nullptr;
199
- }
200
-
201
236
  try
202
237
  {
238
+ static std::optional<bool> is_property_present{};
239
+
240
+ if (!is_property_present.has_value())
241
+ {
242
+ is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Networking.EndpointPair", L"LocalHostName");
243
+ }
244
+
245
+ if (!is_property_present.value())
246
+ {
247
+ PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
248
+ return nullptr;
249
+ }
250
+
203
251
  return py::convert(self->obj.LocalHostName());
204
252
  }
205
253
  catch (...)
@@ -211,12 +259,6 @@ namespace py::cpp::Windows::Networking
211
259
 
212
260
  static int EndpointPair_put_LocalHostName(py::wrapper::Windows::Networking::EndpointPair* self, PyObject* arg, void* /*unused*/) noexcept
213
261
  {
214
- if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Networking.EndpointPair", L"LocalHostName"))
215
- {
216
- PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
217
- return -1;
218
- }
219
-
220
262
  if (arg == nullptr)
221
263
  {
222
264
  PyErr_SetString(PyExc_AttributeError, "can't delete attribute");
@@ -225,6 +267,19 @@ namespace py::cpp::Windows::Networking
225
267
 
226
268
  try
227
269
  {
270
+ static std::optional<bool> is_property_present{};
271
+
272
+ if (!is_property_present.has_value())
273
+ {
274
+ is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Networking.EndpointPair", L"LocalHostName");
275
+ }
276
+
277
+ if (!is_property_present.value())
278
+ {
279
+ PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
280
+ return -1;
281
+ }
282
+
228
283
  auto param0 = py::convert_to<winrt::Windows::Networking::HostName>(arg);
229
284
 
230
285
  self->obj.LocalHostName(param0);
@@ -275,23 +330,20 @@ namespace py::cpp::Windows::Networking
275
330
  { }
276
331
  };
277
332
 
278
- static PyType_Slot _type_slots_EndpointPair[] =
279
- {
333
+ static PyType_Slot _type_slots_EndpointPair[] = {
280
334
  { Py_tp_new, reinterpret_cast<void*>(_new_EndpointPair) },
281
335
  { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_EndpointPair) },
282
336
  { Py_tp_methods, reinterpret_cast<void*>(_methods_EndpointPair) },
283
337
  { Py_tp_getset, reinterpret_cast<void*>(_getset_EndpointPair) },
284
- { },
338
+ { }
285
339
  };
286
340
 
287
- static PyType_Spec type_spec_EndpointPair =
288
- {
341
+ static PyType_Spec type_spec_EndpointPair = {
289
342
  "winrt._winrt_windows_networking.EndpointPair",
290
343
  sizeof(py::wrapper::Windows::Networking::EndpointPair),
291
344
  0,
292
345
  Py_TPFLAGS_DEFAULT,
293
- _type_slots_EndpointPair
294
- };
346
+ _type_slots_EndpointPair};
295
347
 
296
348
  // ----- HostName class --------------------
297
349
 
@@ -310,7 +362,7 @@ namespace py::cpp::Windows::Networking
310
362
  {
311
363
  auto param0 = py::convert_to<winrt::hstring>(args, 0);
312
364
 
313
- winrt::Windows::Networking::HostName instance{ param0 };
365
+ winrt::Windows::Networking::HostName instance{param0};
314
366
  return py::wrap(instance, type);
315
367
  }
316
368
  catch (...)
@@ -340,14 +392,21 @@ namespace py::cpp::Windows::Networking
340
392
 
341
393
  if (arg_count == 2)
342
394
  {
343
- if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Networking.HostName", L"Compare", 2))
344
- {
345
- py::set_arg_count_version_error(2);
346
- return nullptr;
347
- }
348
-
349
395
  try
350
396
  {
397
+ static std::optional<bool> is_overload_present{};
398
+
399
+ if (!is_overload_present.has_value())
400
+ {
401
+ is_overload_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Networking.HostName", L"Compare", 2);
402
+ }
403
+
404
+ if (!is_overload_present.value())
405
+ {
406
+ py::set_arg_count_version_error(2);
407
+ return nullptr;
408
+ }
409
+
351
410
  auto param0 = py::convert_to<winrt::hstring>(args, 0);
352
411
  auto param1 = py::convert_to<winrt::hstring>(args, 1);
353
412
 
@@ -372,14 +431,21 @@ namespace py::cpp::Windows::Networking
372
431
 
373
432
  if (arg_count == 1)
374
433
  {
375
- if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Networking.HostName", L"IsEqual", 1))
376
- {
377
- py::set_arg_count_version_error(1);
378
- return nullptr;
379
- }
380
-
381
434
  try
382
435
  {
436
+ static std::optional<bool> is_overload_present{};
437
+
438
+ if (!is_overload_present.has_value())
439
+ {
440
+ is_overload_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Networking.HostName", L"IsEqual", 1);
441
+ }
442
+
443
+ if (!is_overload_present.value())
444
+ {
445
+ py::set_arg_count_version_error(1);
446
+ return nullptr;
447
+ }
448
+
383
449
  auto param0 = py::convert_to<winrt::Windows::Networking::HostName>(args, 0);
384
450
 
385
451
  return py::convert(self->obj.IsEqual(param0));
@@ -403,14 +469,21 @@ namespace py::cpp::Windows::Networking
403
469
 
404
470
  if (arg_count == 0)
405
471
  {
406
- if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Networking.HostName", L"ToString", 0))
407
- {
408
- py::set_arg_count_version_error(0);
409
- return nullptr;
410
- }
411
-
412
472
  try
413
473
  {
474
+ static std::optional<bool> is_overload_present{};
475
+
476
+ if (!is_overload_present.has_value())
477
+ {
478
+ is_overload_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Networking.HostName", L"ToString", 0);
479
+ }
480
+
481
+ if (!is_overload_present.value())
482
+ {
483
+ py::set_arg_count_version_error(0);
484
+ return nullptr;
485
+ }
486
+
414
487
  return py::convert(self->obj.ToString());
415
488
  }
416
489
  catch (...)
@@ -428,14 +501,21 @@ namespace py::cpp::Windows::Networking
428
501
 
429
502
  static PyObject* HostName_get_CanonicalName(py::wrapper::Windows::Networking::HostName* self, void* /*unused*/) noexcept
430
503
  {
431
- if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Networking.HostName", L"CanonicalName"))
432
- {
433
- PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
434
- return nullptr;
435
- }
436
-
437
504
  try
438
505
  {
506
+ static std::optional<bool> is_property_present{};
507
+
508
+ if (!is_property_present.has_value())
509
+ {
510
+ is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Networking.HostName", L"CanonicalName");
511
+ }
512
+
513
+ if (!is_property_present.value())
514
+ {
515
+ PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
516
+ return nullptr;
517
+ }
518
+
439
519
  return py::convert(self->obj.CanonicalName());
440
520
  }
441
521
  catch (...)
@@ -447,14 +527,21 @@ namespace py::cpp::Windows::Networking
447
527
 
448
528
  static PyObject* HostName_get_DisplayName(py::wrapper::Windows::Networking::HostName* self, void* /*unused*/) noexcept
449
529
  {
450
- if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Networking.HostName", L"DisplayName"))
451
- {
452
- PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
453
- return nullptr;
454
- }
455
-
456
530
  try
457
531
  {
532
+ static std::optional<bool> is_property_present{};
533
+
534
+ if (!is_property_present.has_value())
535
+ {
536
+ is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Networking.HostName", L"DisplayName");
537
+ }
538
+
539
+ if (!is_property_present.value())
540
+ {
541
+ PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
542
+ return nullptr;
543
+ }
544
+
458
545
  return py::convert(self->obj.DisplayName());
459
546
  }
460
547
  catch (...)
@@ -466,14 +553,21 @@ namespace py::cpp::Windows::Networking
466
553
 
467
554
  static PyObject* HostName_get_IPInformation(py::wrapper::Windows::Networking::HostName* self, void* /*unused*/) noexcept
468
555
  {
469
- if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Networking.HostName", L"IPInformation"))
470
- {
471
- PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
472
- return nullptr;
473
- }
474
-
475
556
  try
476
557
  {
558
+ static std::optional<bool> is_property_present{};
559
+
560
+ if (!is_property_present.has_value())
561
+ {
562
+ is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Networking.HostName", L"IPInformation");
563
+ }
564
+
565
+ if (!is_property_present.value())
566
+ {
567
+ PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
568
+ return nullptr;
569
+ }
570
+
477
571
  return py::convert(self->obj.IPInformation());
478
572
  }
479
573
  catch (...)
@@ -485,14 +579,21 @@ namespace py::cpp::Windows::Networking
485
579
 
486
580
  static PyObject* HostName_get_RawName(py::wrapper::Windows::Networking::HostName* self, void* /*unused*/) noexcept
487
581
  {
488
- if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Networking.HostName", L"RawName"))
489
- {
490
- PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
491
- return nullptr;
492
- }
493
-
494
582
  try
495
583
  {
584
+ static std::optional<bool> is_property_present{};
585
+
586
+ if (!is_property_present.has_value())
587
+ {
588
+ is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Networking.HostName", L"RawName");
589
+ }
590
+
591
+ if (!is_property_present.value())
592
+ {
593
+ PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
594
+ return nullptr;
595
+ }
596
+
496
597
  return py::convert(self->obj.RawName());
497
598
  }
498
599
  catch (...)
@@ -504,14 +605,21 @@ namespace py::cpp::Windows::Networking
504
605
 
505
606
  static PyObject* HostName_get_Type(py::wrapper::Windows::Networking::HostName* self, void* /*unused*/) noexcept
506
607
  {
507
- if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Networking.HostName", L"Type"))
508
- {
509
- PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
510
- return nullptr;
511
- }
512
-
513
608
  try
514
609
  {
610
+ static std::optional<bool> is_property_present{};
611
+
612
+ if (!is_property_present.has_value())
613
+ {
614
+ is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Networking.HostName", L"Type");
615
+ }
616
+
617
+ if (!is_property_present.value())
618
+ {
619
+ PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
620
+ return nullptr;
621
+ }
622
+
515
623
  return py::convert(self->obj.Type());
516
624
  }
517
625
  catch (...)
@@ -575,24 +683,21 @@ namespace py::cpp::Windows::Networking
575
683
  { }
576
684
  };
577
685
 
578
- static PyType_Slot _type_slots_HostName[] =
579
- {
686
+ static PyType_Slot _type_slots_HostName[] = {
580
687
  { Py_tp_new, reinterpret_cast<void*>(_new_HostName) },
581
688
  { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_HostName) },
582
689
  { Py_tp_methods, reinterpret_cast<void*>(_methods_HostName) },
583
690
  { Py_tp_getset, reinterpret_cast<void*>(_getset_HostName) },
584
691
  { Py_tp_str, reinterpret_cast<void*>(_str_HostName) },
585
- { },
692
+ { }
586
693
  };
587
694
 
588
- static PyType_Spec type_spec_HostName =
589
- {
695
+ static PyType_Spec type_spec_HostName = {
590
696
  "winrt._winrt_windows_networking.HostName",
591
697
  sizeof(py::wrapper::Windows::Networking::HostName),
592
698
  0,
593
699
  Py_TPFLAGS_DEFAULT,
594
- _type_slots_HostName
595
- };
700
+ _type_slots_HostName};
596
701
 
597
702
  static PyGetSetDef getset_HostName_Static[] = {
598
703
  { }
@@ -621,20 +726,19 @@ namespace py::cpp::Windows::Networking
621
726
  };
622
727
 
623
728
  // ----- Windows.Networking Initialization --------------------
624
- PyDoc_STRVAR(module_doc, "Windows::Networking");
625
729
 
730
+ PyDoc_STRVAR(module_doc, "Windows.Networking");
626
731
 
627
- static PyModuleDef module_def
628
- = {PyModuleDef_HEAD_INIT,
629
- "_winrt_windows_networking",
630
- module_doc,
631
- 0,
632
- nullptr,
633
- nullptr,
634
- nullptr,
635
- nullptr,
636
- nullptr};
637
-
732
+ static PyModuleDef module_def = {
733
+ PyModuleDef_HEAD_INIT,
734
+ "_winrt_windows_networking",
735
+ module_doc,
736
+ 0,
737
+ nullptr,
738
+ nullptr,
739
+ nullptr,
740
+ nullptr,
741
+ nullptr};
638
742
  } // py::cpp::Windows::Networking
639
743
 
640
744
  PyMODINIT_FUNC PyInit__winrt_windows_networking(void) noexcept
@@ -666,7 +770,8 @@ PyMODINIT_FUNC PyInit__winrt_windows_networking(void) noexcept
666
770
  return nullptr;
667
771
  }
668
772
 
669
- if (py::register_python_type(module.get(), &type_spec_EndpointPair, object_bases.get(), nullptr) == -1)
773
+ py::pytype_handle EndpointPair_type{py::register_python_type(module.get(), &type_spec_EndpointPair, object_bases.get(), nullptr)};
774
+ if (!EndpointPair_type)
670
775
  {
671
776
  return nullptr;
672
777
  }
@@ -677,7 +782,8 @@ PyMODINIT_FUNC PyInit__winrt_windows_networking(void) noexcept
677
782
  return nullptr;
678
783
  }
679
784
 
680
- if (py::register_python_type(module.get(), &type_spec_HostName, object_bases.get(), reinterpret_cast<PyTypeObject*>(type_HostName_Static.get())) == -1)
785
+ py::pytype_handle HostName_type{py::register_python_type(module.get(), &type_spec_HostName, object_bases.get(), reinterpret_cast<PyTypeObject*>(type_HostName_Static.get()))};
786
+ if (!HostName_type)
681
787
  {
682
788
  return nullptr;
683
789
  }
@@ -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.13"
19
+ requires-python = ">=3.9,<3.14"
20
20
 
21
21
  [project.urls]
22
22
  # Homepage = "https://github.com/pywinrt/pywinrt"
@@ -36,7 +36,8 @@ optional-dependencies.all = { file = "all-requirements.txt" }
36
36
  # use local winrt-sdk build dependency
37
37
  environment = { PYTHONPATH="../winrt-sdk/src" }
38
38
  # don't install winrt-sdk from PyPI
39
- build-frontend = { name = "build", args = ["--skip-dependency-check", "--no-isolation"] }
39
+ build-frontend = { name = "build[uv]", args = ["--skip-dependency-check", "--no-isolation"] }
40
+ before-build = "uv pip install setuptools"
40
41
  # don't build for PyPy
41
42
  skip = "pp*"
42
43
  # suppress warnings about ARM64 testing
@@ -0,0 +1 @@
1
+ 2.2.0
@@ -1,3 +1,3 @@
1
- # WARNING: Please don't edit this file. It was generated by Python/WinRT v2.0.1
1
+ # WARNING: Please don't edit this file. It was generated by Python/WinRT v2.2.0
2
2
 
3
- winrt-runtime==2.0.1
3
+ winrt-runtime==2.2.0
@@ -1,4 +1,4 @@
1
- # WARNING: Please don't edit this file. It was generated by Python/WinRT v2.0.1
1
+ # WARNING: Please don't edit this file. It was generated by Python/WinRT v2.2.0
2
2
 
3
3
  import datetime
4
4
  import sys
@@ -9,7 +9,7 @@ from builtins import property as _property
9
9
 
10
10
  import winrt._winrt
11
11
  import winrt.system
12
- import winrt.windows.networking.connectivity
12
+ import winrt.windows.networking.connectivity as windows_networking_connectivity
13
13
 
14
14
  from winrt.windows.networking import DomainNameType, HostNameSortOptions, HostNameType
15
15
 
@@ -19,7 +19,7 @@ Self = typing.TypeVar('Self')
19
19
  class EndpointPair(winrt.system.Object):
20
20
  @staticmethod
21
21
  def _from(obj: winrt.system.Object, /) -> EndpointPair: ...
22
- def __new__(cls: typing.Type[EndpointPair], local_host_name: typing.Optional[HostName], local_service_name: str, remote_host_name: typing.Optional[HostName], remote_service_name: str) -> EndpointPair:...
22
+ def __new__(cls: typing.Type[EndpointPair], local_host_name: typing.Optional[HostName], local_service_name: str, remote_host_name: typing.Optional[HostName], remote_service_name: str) -> EndpointPair: ...
23
23
  @_property
24
24
  def remote_service_name(self) -> str: ...
25
25
  @remote_service_name.setter
@@ -46,7 +46,7 @@ class HostName(winrt.system.Object, metaclass=HostName_Static):
46
46
  def __str__(self) -> str: ...
47
47
  @staticmethod
48
48
  def _from(obj: winrt.system.Object, /) -> HostName: ...
49
- def __new__(cls: typing.Type[HostName], host_name: str) -> HostName:...
49
+ def __new__(cls: typing.Type[HostName], host_name: str) -> HostName: ...
50
50
  def is_equal(self, host_name: typing.Optional[HostName], /) -> bool: ...
51
51
  def to_string(self) -> str: ...
52
52
  @_property
@@ -54,7 +54,7 @@ class HostName(winrt.system.Object, metaclass=HostName_Static):
54
54
  @_property
55
55
  def display_name(self) -> str: ...
56
56
  @_property
57
- def i_p_information(self) -> typing.Optional[winrt.windows.networking.connectivity.IPInformation]: ...
57
+ def i_p_information(self) -> typing.Optional[windows_networking_connectivity.IPInformation]: ...
58
58
  @_property
59
59
  def raw_name(self) -> str: ...
60
60
  @_property
@@ -1,4 +1,4 @@
1
- # WARNING: Please don't edit this file. It was generated by Python/WinRT v2.0.1
1
+ # WARNING: Please don't edit this file. It was generated by Python/WinRT v2.2.0
2
2
 
3
3
  import enum
4
4
 
@@ -18,7 +18,7 @@ class DomainNameType(enum.IntEnum):
18
18
  FULLY_QUALIFIED = 1
19
19
 
20
20
  class HostNameSortOptions(enum.IntFlag):
21
- NONE = 0
21
+ NONE = 0x0
22
22
  OPTIMIZE_FOR_LONG_CONNECTIONS = 0x2
23
23
 
24
24
  class HostNameType(enum.IntEnum):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: winrt-Windows.Networking
3
- Version: 2.0.1
3
+ Version: 2.2.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.13,>=3.9
13
+ Requires-Python: <3.14,>=3.9
14
14
  Description-Content-Type: text/markdown
15
- Requires-Dist: winrt-runtime==2.0.1
15
+ Requires-Dist: winrt-runtime==2.2.0
16
16
  Provides-Extra: all
17
- Requires-Dist: winrt-Windows.Networking.Connectivity[all]==2.0.1; extra == "all"
17
+ Requires-Dist: winrt-Windows.Networking.Connectivity[all]==2.2.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==2.2.0
2
+
3
+ [all]
4
+ winrt-Windows.Networking.Connectivity[all]==2.2.0
@@ -1,3 +0,0 @@
1
- # WARNING: Please don't edit this file. It was generated by Python/WinRT v2.0.1
2
-
3
- winrt-Windows.Networking.Connectivity[all]==2.0.1
@@ -1 +0,0 @@
1
- 2.0.1
@@ -1,4 +0,0 @@
1
- winrt-runtime==2.0.1
2
-
3
- [all]
4
- winrt-Windows.Networking.Connectivity[all]==2.0.1