py2docfx 0.1.20rc2196756__py3-none-any.whl → 0.1.21.dev2246704__py3-none-any.whl

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 (140) hide show
  1. py2docfx/convert_prepare/get_source.py +1 -1
  2. py2docfx/convert_prepare/package_info.py +37 -27
  3. py2docfx/convert_prepare/tests/test_get_source.py +3 -1
  4. py2docfx/convert_prepare/tests/test_package_info.py +159 -1
  5. py2docfx/docfx_yaml/build_finished.py +1 -1
  6. py2docfx/docfx_yaml/logger.py +42 -28
  7. py2docfx/venv/basevenv/Lib/site-packages/charset_normalizer/api.py +3 -2
  8. py2docfx/venv/basevenv/Lib/site-packages/charset_normalizer/legacy.py +17 -1
  9. py2docfx/venv/basevenv/Lib/site-packages/charset_normalizer/version.py +1 -1
  10. py2docfx/venv/basevenv/Lib/site-packages/requests/__version__.py +2 -2
  11. py2docfx/venv/basevenv/Lib/site-packages/requests/adapters.py +17 -40
  12. py2docfx/venv/basevenv/Lib/site-packages/requests/sessions.py +1 -1
  13. py2docfx/venv/venv1/Lib/site-packages/azure/core/_version.py +1 -1
  14. py2docfx/venv/venv1/Lib/site-packages/azure/core/pipeline/policies/_authentication.py +21 -9
  15. py2docfx/venv/venv1/Lib/site-packages/azure/core/pipeline/policies/_authentication_async.py +21 -9
  16. py2docfx/venv/venv1/Lib/site-packages/azure/core/pipeline/policies/_retry.py +1 -1
  17. py2docfx/venv/venv1/Lib/site-packages/azure/identity/_bearer_token_provider.py +1 -1
  18. py2docfx/venv/venv1/Lib/site-packages/azure/identity/_credentials/authorization_code.py +1 -1
  19. py2docfx/venv/venv1/Lib/site-packages/azure/identity/_credentials/azd_cli.py +82 -17
  20. py2docfx/venv/venv1/Lib/site-packages/azure/identity/_credentials/azure_cli.py +28 -5
  21. py2docfx/venv/venv1/Lib/site-packages/azure/identity/_credentials/azure_powershell.py +28 -4
  22. py2docfx/venv/venv1/Lib/site-packages/azure/identity/_credentials/broker.py +79 -0
  23. py2docfx/venv/venv1/Lib/site-packages/azure/identity/_credentials/chained.py +9 -3
  24. py2docfx/venv/venv1/Lib/site-packages/azure/identity/_credentials/default.py +153 -53
  25. py2docfx/venv/venv1/Lib/site-packages/azure/identity/_credentials/imds.py +25 -1
  26. py2docfx/venv/venv1/Lib/site-packages/azure/identity/_credentials/shared_cache.py +12 -5
  27. py2docfx/venv/venv1/Lib/site-packages/azure/identity/_credentials/vscode.py +163 -144
  28. py2docfx/venv/venv1/Lib/site-packages/azure/identity/_credentials/workload_identity.py +23 -12
  29. py2docfx/venv/venv1/Lib/site-packages/azure/identity/_internal/__init__.py +4 -0
  30. py2docfx/venv/venv1/Lib/site-packages/azure/identity/_internal/interactive.py +14 -2
  31. py2docfx/venv/venv1/Lib/site-packages/azure/identity/_internal/pipeline.py +4 -2
  32. py2docfx/venv/venv1/Lib/site-packages/azure/identity/_internal/utils.py +96 -0
  33. py2docfx/venv/venv1/Lib/site-packages/azure/identity/_version.py +1 -1
  34. py2docfx/venv/venv1/Lib/site-packages/azure/identity/aio/_bearer_token_provider.py +3 -3
  35. py2docfx/venv/venv1/Lib/site-packages/azure/identity/aio/_credentials/authorization_code.py +1 -1
  36. py2docfx/venv/venv1/Lib/site-packages/azure/identity/aio/_credentials/azd_cli.py +32 -13
  37. py2docfx/venv/venv1/Lib/site-packages/azure/identity/aio/_credentials/azure_cli.py +26 -5
  38. py2docfx/venv/venv1/Lib/site-packages/azure/identity/aio/_credentials/azure_powershell.py +13 -2
  39. py2docfx/venv/venv1/Lib/site-packages/azure/identity/aio/_credentials/chained.py +1 -1
  40. py2docfx/venv/venv1/Lib/site-packages/azure/identity/aio/_credentials/default.py +120 -55
  41. py2docfx/venv/venv1/Lib/site-packages/azure/identity/aio/_credentials/imds.py +27 -1
  42. py2docfx/venv/venv1/Lib/site-packages/azure/identity/aio/_credentials/on_behalf_of.py +1 -1
  43. py2docfx/venv/venv1/Lib/site-packages/azure/identity/aio/_credentials/shared_cache.py +12 -5
  44. py2docfx/venv/venv1/Lib/site-packages/azure/identity/aio/_credentials/vscode.py +15 -67
  45. py2docfx/venv/venv1/Lib/site-packages/azure/identity/aio/_credentials/workload_identity.py +17 -13
  46. py2docfx/venv/venv1/Lib/site-packages/cffi/__init__.py +2 -2
  47. py2docfx/venv/venv1/Lib/site-packages/cffi/cparser.py +1 -1
  48. py2docfx/venv/venv1/Lib/site-packages/cffi/recompiler.py +5 -5
  49. py2docfx/venv/venv1/Lib/site-packages/cffi/setuptools_ext.py +13 -0
  50. py2docfx/venv/venv1/Lib/site-packages/cffi/vengine_cpy.py +3 -0
  51. py2docfx/venv/venv1/Lib/site-packages/charset_normalizer/api.py +3 -2
  52. py2docfx/venv/venv1/Lib/site-packages/charset_normalizer/legacy.py +17 -1
  53. py2docfx/venv/venv1/Lib/site-packages/charset_normalizer/version.py +1 -1
  54. py2docfx/venv/venv1/Lib/site-packages/cryptography/__about__.py +1 -1
  55. py2docfx/venv/venv1/Lib/site-packages/cryptography/__init__.py +0 -13
  56. py2docfx/venv/venv1/Lib/site-packages/cryptography/hazmat/_oid.py +8 -0
  57. py2docfx/venv/venv1/Lib/site-packages/cryptography/hazmat/asn1/__init__.py +10 -0
  58. py2docfx/venv/venv1/Lib/site-packages/cryptography/hazmat/asn1/asn1.py +116 -0
  59. py2docfx/venv/venv1/Lib/site-packages/cryptography/hazmat/backends/openssl/backend.py +3 -9
  60. py2docfx/venv/venv1/Lib/site-packages/cryptography/hazmat/bindings/_rust/declarative_asn1.pyi +32 -0
  61. py2docfx/venv/venv1/Lib/site-packages/cryptography/hazmat/bindings/_rust/openssl/kdf.pyi +23 -0
  62. py2docfx/venv/venv1/Lib/site-packages/cryptography/hazmat/bindings/_rust/x509.pyi +1 -13
  63. py2docfx/venv/venv1/Lib/site-packages/cryptography/hazmat/bindings/openssl/_conditional.py +16 -0
  64. py2docfx/venv/venv1/Lib/site-packages/cryptography/hazmat/bindings/openssl/binding.py +16 -1
  65. py2docfx/venv/venv1/Lib/site-packages/cryptography/hazmat/primitives/asymmetric/padding.py +0 -2
  66. py2docfx/venv/venv1/Lib/site-packages/cryptography/hazmat/primitives/asymmetric/rsa.py +8 -0
  67. py2docfx/venv/venv1/Lib/site-packages/cryptography/hazmat/primitives/ciphers/algorithms.py +0 -47
  68. py2docfx/venv/venv1/Lib/site-packages/cryptography/hazmat/primitives/kdf/hkdf.py +6 -91
  69. py2docfx/venv/venv1/Lib/site-packages/cryptography/hazmat/primitives/kdf/kbkdf.py +1 -3
  70. py2docfx/venv/venv1/Lib/site-packages/cryptography/hazmat/primitives/serialization/ssh.py +1 -1
  71. py2docfx/venv/venv1/Lib/site-packages/cryptography/utils.py +0 -2
  72. py2docfx/venv/venv1/Lib/site-packages/cryptography/x509/name.py +2 -3
  73. py2docfx/venv/venv1/Lib/site-packages/google/protobuf/__init__.py +1 -1
  74. py2docfx/venv/venv1/Lib/site-packages/google/protobuf/any_pb2.py +2 -2
  75. py2docfx/venv/venv1/Lib/site-packages/google/protobuf/api_pb2.py +12 -8
  76. py2docfx/venv/venv1/Lib/site-packages/google/protobuf/compiler/plugin_pb2.py +2 -2
  77. py2docfx/venv/venv1/Lib/site-packages/google/protobuf/descriptor.py +398 -246
  78. py2docfx/venv/venv1/Lib/site-packages/google/protobuf/descriptor_pb2.py +74 -72
  79. py2docfx/venv/venv1/Lib/site-packages/google/protobuf/descriptor_pool.py +5 -4
  80. py2docfx/venv/venv1/Lib/site-packages/google/protobuf/duration_pb2.py +2 -2
  81. py2docfx/venv/venv1/Lib/site-packages/google/protobuf/empty_pb2.py +2 -2
  82. py2docfx/venv/venv1/Lib/site-packages/google/protobuf/field_mask_pb2.py +2 -2
  83. py2docfx/venv/venv1/Lib/site-packages/google/protobuf/internal/api_implementation.py +0 -6
  84. py2docfx/venv/venv1/Lib/site-packages/google/protobuf/internal/extension_dict.py +3 -3
  85. py2docfx/venv/venv1/Lib/site-packages/google/protobuf/internal/field_mask.py +3 -3
  86. py2docfx/venv/venv1/Lib/site-packages/google/protobuf/internal/python_edition_defaults.py +1 -1
  87. py2docfx/venv/venv1/Lib/site-packages/google/protobuf/internal/python_message.py +10 -2
  88. py2docfx/venv/venv1/Lib/site-packages/google/protobuf/internal/type_checkers.py +47 -5
  89. py2docfx/venv/venv1/Lib/site-packages/google/protobuf/json_format.py +55 -32
  90. py2docfx/venv/venv1/Lib/site-packages/google/protobuf/runtime_version.py +6 -26
  91. py2docfx/venv/venv1/Lib/site-packages/google/protobuf/source_context_pb2.py +2 -2
  92. py2docfx/venv/venv1/Lib/site-packages/google/protobuf/struct_pb2.py +2 -2
  93. py2docfx/venv/venv1/Lib/site-packages/google/protobuf/text_format.py +30 -19
  94. py2docfx/venv/venv1/Lib/site-packages/google/protobuf/timestamp_pb2.py +2 -2
  95. py2docfx/venv/venv1/Lib/site-packages/google/protobuf/type_pb2.py +2 -2
  96. py2docfx/venv/venv1/Lib/site-packages/google/protobuf/wrappers_pb2.py +2 -2
  97. py2docfx/venv/venv1/Lib/site-packages/psutil/__init__.py +39 -19
  98. py2docfx/venv/venv1/Lib/site-packages/psutil/_common.py +3 -5
  99. py2docfx/venv/venv1/Lib/site-packages/psutil/_psaix.py +1 -2
  100. py2docfx/venv/venv1/Lib/site-packages/psutil/_psbsd.py +53 -78
  101. py2docfx/venv/venv1/Lib/site-packages/psutil/_pslinux.py +55 -38
  102. py2docfx/venv/venv1/Lib/site-packages/psutil/_psosx.py +40 -12
  103. py2docfx/venv/venv1/Lib/site-packages/psutil/_psposix.py +0 -1
  104. py2docfx/venv/venv1/Lib/site-packages/psutil/_pssunos.py +1 -2
  105. py2docfx/venv/venv1/Lib/site-packages/psutil/_pswindows.py +33 -13
  106. py2docfx/venv/venv1/Lib/site-packages/psutil/tests/__init__.py +185 -122
  107. py2docfx/venv/venv1/Lib/site-packages/psutil/tests/__main__.py +2 -3
  108. py2docfx/venv/venv1/Lib/site-packages/psutil/tests/test_bsd.py +5 -10
  109. py2docfx/venv/venv1/Lib/site-packages/psutil/tests/test_connections.py +3 -4
  110. py2docfx/venv/venv1/Lib/site-packages/psutil/tests/test_contracts.py +41 -45
  111. py2docfx/venv/venv1/Lib/site-packages/psutil/tests/test_linux.py +35 -38
  112. py2docfx/venv/venv1/Lib/site-packages/psutil/tests/test_memleaks.py +4 -8
  113. py2docfx/venv/venv1/Lib/site-packages/psutil/tests/test_misc.py +6 -12
  114. py2docfx/venv/venv1/Lib/site-packages/psutil/tests/test_osx.py +17 -8
  115. py2docfx/venv/venv1/Lib/site-packages/psutil/tests/test_posix.py +29 -17
  116. py2docfx/venv/venv1/Lib/site-packages/psutil/tests/test_process.py +74 -75
  117. py2docfx/venv/venv1/Lib/site-packages/psutil/tests/test_process_all.py +11 -13
  118. py2docfx/venv/venv1/Lib/site-packages/psutil/tests/test_scripts.py +2 -3
  119. py2docfx/venv/venv1/Lib/site-packages/psutil/tests/test_sudo.py +117 -0
  120. py2docfx/venv/venv1/Lib/site-packages/psutil/tests/test_system.py +21 -31
  121. py2docfx/venv/venv1/Lib/site-packages/psutil/tests/test_testutils.py +23 -23
  122. py2docfx/venv/venv1/Lib/site-packages/psutil/tests/test_unicode.py +15 -8
  123. py2docfx/venv/venv1/Lib/site-packages/psutil/tests/test_windows.py +65 -33
  124. py2docfx/venv/venv1/Lib/site-packages/pycparser/__init__.py +1 -1
  125. py2docfx/venv/venv1/Lib/site-packages/pycparser/c_generator.py +1 -1
  126. py2docfx/venv/venv1/Lib/site-packages/pycparser/c_lexer.py +14 -0
  127. py2docfx/venv/venv1/Lib/site-packages/pycparser/c_parser.py +30 -7
  128. py2docfx/venv/venv1/Lib/site-packages/pycparser/lextab.py +1 -1
  129. py2docfx/venv/venv1/Lib/site-packages/pycparser/yacctab.py +132 -127
  130. py2docfx/venv/venv1/Lib/site-packages/requests/__version__.py +2 -2
  131. py2docfx/venv/venv1/Lib/site-packages/requests/adapters.py +17 -40
  132. py2docfx/venv/venv1/Lib/site-packages/requests/sessions.py +1 -1
  133. py2docfx/venv/venv1/Lib/site-packages/typing_extensions.py +91 -18
  134. {py2docfx-0.1.20rc2196756.dist-info → py2docfx-0.1.21.dev2246704.dist-info}/METADATA +1 -1
  135. {py2docfx-0.1.20rc2196756.dist-info → py2docfx-0.1.21.dev2246704.dist-info}/RECORD +137 -135
  136. py2docfx/venv/venv1/Lib/site-packages/azure/identity/_internal/linux_vscode_adapter.py +0 -100
  137. py2docfx/venv/venv1/Lib/site-packages/azure/identity/_internal/macos_vscode_adapter.py +0 -34
  138. py2docfx/venv/venv1/Lib/site-packages/azure/identity/_internal/win_vscode_adapter.py +0 -77
  139. {py2docfx-0.1.20rc2196756.dist-info → py2docfx-0.1.21.dev2246704.dist-info}/WHEEL +0 -0
  140. {py2docfx-0.1.20rc2196756.dist-info → py2docfx-0.1.21.dev2246704.dist-info}/top_level.txt +0 -0
@@ -5,8 +5,8 @@
5
5
  __title__ = "requests"
6
6
  __description__ = "Python HTTP for Humans."
7
7
  __url__ = "https://requests.readthedocs.io"
8
- __version__ = "2.32.4"
9
- __build__ = 0x023204
8
+ __version__ = "2.32.5"
9
+ __build__ = 0x023205
10
10
  __author__ = "Kenneth Reitz"
11
11
  __author_email__ = "me@kennethreitz.org"
12
12
  __license__ = "Apache-2.0"
@@ -27,7 +27,6 @@ from urllib3.poolmanager import PoolManager, proxy_from_url
27
27
  from urllib3.util import Timeout as TimeoutSauce
28
28
  from urllib3.util import parse_url
29
29
  from urllib3.util.retry import Retry
30
- from urllib3.util.ssl_ import create_urllib3_context
31
30
 
32
31
  from .auth import _basic_auth_str
33
32
  from .compat import basestring, urlparse
@@ -74,19 +73,6 @@ DEFAULT_RETRIES = 0
74
73
  DEFAULT_POOL_TIMEOUT = None
75
74
 
76
75
 
77
- try:
78
- import ssl # noqa: F401
79
-
80
- _preloaded_ssl_context = create_urllib3_context()
81
- _preloaded_ssl_context.load_verify_locations(
82
- extract_zipped_paths(DEFAULT_CA_BUNDLE_PATH)
83
- )
84
- except ImportError:
85
- # Bypass default SSLContext creation when Python
86
- # interpreter isn't built with the ssl module.
87
- _preloaded_ssl_context = None
88
-
89
-
90
76
  def _urllib3_request_context(
91
77
  request: "PreparedRequest",
92
78
  verify: "bool | str | None",
@@ -99,19 +85,9 @@ def _urllib3_request_context(
99
85
  scheme = parsed_request_url.scheme.lower()
100
86
  port = parsed_request_url.port
101
87
 
102
- # Determine if we have and should use our default SSLContext
103
- # to optimize performance on standard requests.
104
- poolmanager_kwargs = getattr(poolmanager, "connection_pool_kw", {})
105
- has_poolmanager_ssl_context = poolmanager_kwargs.get("ssl_context")
106
- should_use_default_ssl_context = (
107
- _preloaded_ssl_context is not None and not has_poolmanager_ssl_context
108
- )
109
-
110
88
  cert_reqs = "CERT_REQUIRED"
111
89
  if verify is False:
112
90
  cert_reqs = "CERT_NONE"
113
- elif verify is True and should_use_default_ssl_context:
114
- pool_kwargs["ssl_context"] = _preloaded_ssl_context
115
91
  elif isinstance(verify, str):
116
92
  if not os.path.isdir(verify):
117
93
  pool_kwargs["ca_certs"] = verify
@@ -314,26 +290,27 @@ class HTTPAdapter(BaseAdapter):
314
290
  :param cert: The SSL certificate to verify.
315
291
  """
316
292
  if url.lower().startswith("https") and verify:
317
- conn.cert_reqs = "CERT_REQUIRED"
293
+ cert_loc = None
318
294
 
319
- # Only load the CA certificates if 'verify' is a string indicating the CA bundle to use.
320
- # Otherwise, if verify is a boolean, we don't load anything since
321
- # the connection will be using a context with the default certificates already loaded,
322
- # and this avoids a call to the slow load_verify_locations()
295
+ # Allow self-specified cert location.
323
296
  if verify is not True:
324
- # `verify` must be a str with a path then
325
297
  cert_loc = verify
326
298
 
327
- if not os.path.exists(cert_loc):
328
- raise OSError(
329
- f"Could not find a suitable TLS CA certificate bundle, "
330
- f"invalid path: {cert_loc}"
331
- )
299
+ if not cert_loc:
300
+ cert_loc = extract_zipped_paths(DEFAULT_CA_BUNDLE_PATH)
332
301
 
333
- if not os.path.isdir(cert_loc):
334
- conn.ca_certs = cert_loc
335
- else:
336
- conn.ca_cert_dir = cert_loc
302
+ if not cert_loc or not os.path.exists(cert_loc):
303
+ raise OSError(
304
+ f"Could not find a suitable TLS CA certificate bundle, "
305
+ f"invalid path: {cert_loc}"
306
+ )
307
+
308
+ conn.cert_reqs = "CERT_REQUIRED"
309
+
310
+ if not os.path.isdir(cert_loc):
311
+ conn.ca_certs = cert_loc
312
+ else:
313
+ conn.ca_cert_dir = cert_loc
337
314
  else:
338
315
  conn.cert_reqs = "CERT_NONE"
339
316
  conn.ca_certs = None
@@ -410,7 +387,7 @@ class HTTPAdapter(BaseAdapter):
410
387
  ``"cert_reqs"`` will be set
411
388
  * If ``verify`` is a string, (i.e., it is a user-specified trust bundle)
412
389
  ``"ca_certs"`` will be set if the string is not a directory recognized
413
- by :py:func:`os.path.isdir`, otherwise ``"ca_certs_dir"`` will be
390
+ by :py:func:`os.path.isdir`, otherwise ``"ca_cert_dir"`` will be
414
391
  set.
415
392
  * If ``"cert"`` is specified, ``"cert_file"`` will always be set. If
416
393
  ``"cert"`` is a tuple with a second item, ``"key_file"`` will also
@@ -535,7 +535,7 @@ class Session(SessionRedirectMixin):
535
535
  for multipart encoding upload.
536
536
  :param auth: (optional) Auth tuple or callable to enable
537
537
  Basic/Digest/Custom HTTP Auth.
538
- :param timeout: (optional) How long to wait for the server to send
538
+ :param timeout: (optional) How many seconds to wait for the server to send
539
539
  data before giving up, as a float, or a :ref:`(connect timeout,
540
540
  read timeout) <timeouts>` tuple.
541
541
  :type timeout: float or tuple
@@ -14,6 +14,7 @@ import types as _types
14
14
  import typing
15
15
  import warnings
16
16
 
17
+ # Breakpoint: https://github.com/python/cpython/pull/119891
17
18
  if sys.version_info >= (3, 14):
18
19
  import annotationlib
19
20
 
@@ -70,6 +71,7 @@ __all__ = [
70
71
  'clear_overloads',
71
72
  'dataclass_transform',
72
73
  'deprecated',
74
+ 'disjoint_base',
73
75
  'Doc',
74
76
  'evaluate_forward_ref',
75
77
  'get_overloads',
@@ -100,6 +102,7 @@ __all__ = [
100
102
  'TypeGuard',
101
103
  'TypeIs',
102
104
  'TYPE_CHECKING',
105
+ 'type_repr',
103
106
  'Never',
104
107
  'NoReturn',
105
108
  'ReadOnly',
@@ -151,6 +154,7 @@ __all__ = [
151
154
  # for backward compatibility
152
155
  PEP_560 = True
153
156
  GenericMeta = type
157
+ # Breakpoint: https://github.com/python/cpython/pull/116129
154
158
  _PEP_696_IMPLEMENTED = sys.version_info >= (3, 13, 0, "beta")
155
159
 
156
160
  # Added with bpo-45166 to 3.10.1+ and some 3.9 versions
@@ -168,6 +172,7 @@ class _Sentinel:
168
172
  _marker = _Sentinel()
169
173
 
170
174
 
175
+ # Breakpoint: https://github.com/python/cpython/pull/27342
171
176
  if sys.version_info >= (3, 10):
172
177
  def _should_collect_from_parameters(t):
173
178
  return isinstance(
@@ -189,6 +194,7 @@ T_co = typing.TypeVar('T_co', covariant=True) # Any type covariant containers.
189
194
  T_contra = typing.TypeVar('T_contra', contravariant=True) # Ditto contravariant.
190
195
 
191
196
 
197
+ # Breakpoint: https://github.com/python/cpython/pull/31841
192
198
  if sys.version_info >= (3, 11):
193
199
  from typing import Any
194
200
  else:
@@ -277,6 +283,7 @@ class _ExtensionsSpecialForm(typing._SpecialForm, _root=True):
277
283
 
278
284
  Final = typing.Final
279
285
 
286
+ # Breakpoint: https://github.com/python/cpython/pull/30530
280
287
  if sys.version_info >= (3, 11):
281
288
  final = typing.final
282
289
  else:
@@ -315,11 +322,39 @@ else:
315
322
  return f
316
323
 
317
324
 
325
+ if hasattr(typing, "disjoint_base"): # 3.15
326
+ disjoint_base = typing.disjoint_base
327
+ else:
328
+ def disjoint_base(cls):
329
+ """This decorator marks a class as a disjoint base.
330
+
331
+ Child classes of a disjoint base cannot inherit from other disjoint bases that are
332
+ not parent classes of the disjoint base.
333
+
334
+ For example:
335
+
336
+ @disjoint_base
337
+ class Disjoint1: pass
338
+
339
+ @disjoint_base
340
+ class Disjoint2: pass
341
+
342
+ class Disjoint3(Disjoint1, Disjoint2): pass # Type checker error
343
+
344
+ Type checkers can use knowledge of disjoint bases to detect unreachable code
345
+ and determine when two types can overlap.
346
+
347
+ See PEP 800."""
348
+ cls.__disjoint_base__ = True
349
+ return cls
350
+
351
+
318
352
  def IntVar(name):
319
353
  return typing.TypeVar(name)
320
354
 
321
355
 
322
356
  # A Literal bug was fixed in 3.11.0, 3.10.1 and 3.9.8
357
+ # Breakpoint: https://github.com/python/cpython/pull/29334
323
358
  if sys.version_info >= (3, 10, 1):
324
359
  Literal = typing.Literal
325
360
  else:
@@ -480,6 +515,7 @@ Text = typing.Text
480
515
  TYPE_CHECKING = typing.TYPE_CHECKING
481
516
 
482
517
 
518
+ # Breakpoint: https://github.com/python/cpython/pull/118681
483
519
  if sys.version_info >= (3, 13, 0, "beta"):
484
520
  from typing import AsyncContextManager, AsyncGenerator, ContextManager, Generator
485
521
  else:
@@ -590,6 +626,7 @@ def _caller(depth=1, default='__main__'):
590
626
 
591
627
  # `__match_args__` attribute was removed from protocol members in 3.13,
592
628
  # we want to backport this change to older Python versions.
629
+ # Breakpoint: https://github.com/python/cpython/pull/110683
593
630
  if sys.version_info >= (3, 13):
594
631
  Protocol = typing.Protocol
595
632
  else:
@@ -770,6 +807,7 @@ else:
770
807
  cls.__init__ = _no_init
771
808
 
772
809
 
810
+ # Breakpoint: https://github.com/python/cpython/pull/113401
773
811
  if sys.version_info >= (3, 13):
774
812
  runtime_checkable = typing.runtime_checkable
775
813
  else:
@@ -830,6 +868,7 @@ runtime = runtime_checkable
830
868
 
831
869
 
832
870
  # Our version of runtime-checkable protocols is faster on Python <=3.11
871
+ # Breakpoint: https://github.com/python/cpython/pull/112717
833
872
  if sys.version_info >= (3, 12):
834
873
  SupportsInt = typing.SupportsInt
835
874
  SupportsFloat = typing.SupportsFloat
@@ -1159,6 +1198,7 @@ else:
1159
1198
  mutable_keys.add(annotation_key)
1160
1199
  readonly_keys.discard(annotation_key)
1161
1200
 
1201
+ # Breakpoint: https://github.com/python/cpython/pull/119891
1162
1202
  if sys.version_info >= (3, 14):
1163
1203
  def __annotate__(format):
1164
1204
  annos = {}
@@ -1249,6 +1289,7 @@ else:
1249
1289
  raise TypeError("TypedDict takes either a dict or keyword arguments,"
1250
1290
  " but not both")
1251
1291
  if kwargs:
1292
+ # Breakpoint: https://github.com/python/cpython/pull/104891
1252
1293
  if sys.version_info >= (3, 13):
1253
1294
  raise TypeError("TypedDict takes no keyword arguments")
1254
1295
  warnings.warn(
@@ -1458,6 +1499,7 @@ else: # <=3.13
1458
1499
  hint = typing.get_type_hints(
1459
1500
  obj, globalns=globalns, localns=localns, include_extras=True
1460
1501
  )
1502
+ # Breakpoint: https://github.com/python/cpython/pull/30304
1461
1503
  if sys.version_info < (3, 11):
1462
1504
  _clean_optional(obj, hint, globalns, localns)
1463
1505
  if include_extras:
@@ -1530,7 +1572,8 @@ else: # <=3.13
1530
1572
 
1531
1573
  # Python 3.9 has get_origin() and get_args() but those implementations don't support
1532
1574
  # ParamSpecArgs and ParamSpecKwargs, so only Python 3.10's versions will do.
1533
- if sys.version_info[:2] >= (3, 10):
1575
+ # Breakpoint: https://github.com/python/cpython/pull/25298
1576
+ if sys.version_info >= (3, 10):
1534
1577
  get_origin = typing.get_origin
1535
1578
  get_args = typing.get_args
1536
1579
  # 3.9
@@ -2096,6 +2139,7 @@ def _concatenate_getitem(self, parameters):
2096
2139
 
2097
2140
 
2098
2141
  # 3.11+; Concatenate does not accept ellipsis in 3.10
2142
+ # Breakpoint: https://github.com/python/cpython/pull/30969
2099
2143
  if sys.version_info >= (3, 11):
2100
2144
  Concatenate = typing.Concatenate
2101
2145
  # <=3.10
@@ -2432,7 +2476,9 @@ For more information, see PEP 646 and PEP 692.
2432
2476
  """
2433
2477
 
2434
2478
 
2435
- if sys.version_info >= (3, 12): # PEP 692 changed the repr of Unpack[]
2479
+ # PEP 692 changed the repr of Unpack[]
2480
+ # Breakpoint: https://github.com/python/cpython/pull/104048
2481
+ if sys.version_info >= (3, 12):
2436
2482
  Unpack = typing.Unpack
2437
2483
 
2438
2484
  def _is_unpack(obj):
@@ -2695,8 +2741,9 @@ else: # <=3.10
2695
2741
  raise AssertionError(f"Expected code to be unreachable, but got: {value}")
2696
2742
 
2697
2743
 
2744
+ # dataclass_transform exists in 3.11 but lacks the frozen_default parameter
2745
+ # Breakpoint: https://github.com/python/cpython/pull/99958
2698
2746
  if sys.version_info >= (3, 12): # 3.12+
2699
- # dataclass_transform exists in 3.11 but lacks the frozen_default parameter
2700
2747
  dataclass_transform = typing.dataclass_transform
2701
2748
  else: # <=3.11
2702
2749
  def dataclass_transform(
@@ -2827,6 +2874,7 @@ else: # <=3.11
2827
2874
 
2828
2875
 
2829
2876
  # Python 3.13.3+ contains a fix for the wrapped __new__
2877
+ # Breakpoint: https://github.com/python/cpython/pull/132160
2830
2878
  if sys.version_info >= (3, 13, 3):
2831
2879
  deprecated = warnings.deprecated
2832
2880
  else:
@@ -2956,6 +3004,7 @@ else:
2956
3004
  return arg(*args, **kwargs)
2957
3005
 
2958
3006
  if asyncio.coroutines.iscoroutinefunction(arg):
3007
+ # Breakpoint: https://github.com/python/cpython/pull/99247
2959
3008
  if sys.version_info >= (3, 12):
2960
3009
  wrapper = inspect.markcoroutinefunction(wrapper)
2961
3010
  else:
@@ -2969,6 +3018,7 @@ else:
2969
3018
  f"a class or callable, not {arg!r}"
2970
3019
  )
2971
3020
 
3021
+ # Breakpoint: https://github.com/python/cpython/pull/23702
2972
3022
  if sys.version_info < (3, 10):
2973
3023
  def _is_param_expr(arg):
2974
3024
  return arg is ... or isinstance(
@@ -3045,6 +3095,7 @@ if not hasattr(typing, "TypeVarTuple"):
3045
3095
 
3046
3096
  expect_val = f"at least {elen}"
3047
3097
 
3098
+ # Breakpoint: https://github.com/python/cpython/pull/27515
3048
3099
  things = "arguments" if sys.version_info >= (3, 10) else "parameters"
3049
3100
  raise TypeError(f"Too {'many' if alen > elen else 'few'} {things}"
3050
3101
  f" for {cls}; actual {alen}, expected {expect_val}")
@@ -3238,6 +3289,7 @@ else:
3238
3289
  # This was explicitly disallowed in 3.9-3.10, and only half-worked in <=3.8.
3239
3290
  # On 3.12, we added __orig_bases__ to call-based NamedTuples
3240
3291
  # On 3.13, we deprecated kwargs-based NamedTuples
3292
+ # Breakpoint: https://github.com/python/cpython/pull/105609
3241
3293
  if sys.version_info >= (3, 13):
3242
3294
  NamedTuple = typing.NamedTuple
3243
3295
  else:
@@ -3313,6 +3365,7 @@ else:
3313
3365
  # using add_note() until py312.
3314
3366
  # Making sure exceptions are raised in the same way
3315
3367
  # as in "normal" classes seems most important here.
3368
+ # Breakpoint: https://github.com/python/cpython/pull/95915
3316
3369
  if sys.version_info >= (3, 12):
3317
3370
  e.add_note(msg)
3318
3371
  raise
@@ -3461,6 +3514,7 @@ else:
3461
3514
 
3462
3515
  # NewType is a class on Python 3.10+, making it pickleable
3463
3516
  # The error message for subclassing instances of NewType was improved on 3.11+
3517
+ # Breakpoint: https://github.com/python/cpython/pull/30268
3464
3518
  if sys.version_info >= (3, 11):
3465
3519
  NewType = typing.NewType
3466
3520
  else:
@@ -3513,6 +3567,7 @@ else:
3513
3567
  def __reduce__(self):
3514
3568
  return self.__qualname__
3515
3569
 
3570
+ # Breakpoint: https://github.com/python/cpython/pull/21515
3516
3571
  if sys.version_info >= (3, 10):
3517
3572
  # PEP 604 methods
3518
3573
  # It doesn't make sense to have these methods on Python <3.10
@@ -3524,10 +3579,12 @@ else:
3524
3579
  return typing.Union[other, self]
3525
3580
 
3526
3581
 
3582
+ # Breakpoint: https://github.com/python/cpython/pull/124795
3527
3583
  if sys.version_info >= (3, 14):
3528
3584
  TypeAliasType = typing.TypeAliasType
3529
3585
  # <=3.13
3530
3586
  else:
3587
+ # Breakpoint: https://github.com/python/cpython/pull/103764
3531
3588
  if sys.version_info >= (3, 12):
3532
3589
  # 3.12-3.13
3533
3590
  def _is_unionable(obj):
@@ -3723,6 +3780,7 @@ else:
3723
3780
  def __call__(self):
3724
3781
  raise TypeError("Type alias is not callable")
3725
3782
 
3783
+ # Breakpoint: https://github.com/python/cpython/pull/21515
3726
3784
  if sys.version_info >= (3, 10):
3727
3785
  def __or__(self, right):
3728
3786
  # For forward compatibility with 3.12, reject Unions
@@ -3835,15 +3893,19 @@ if _CapsuleType is not None:
3835
3893
  __all__.append("CapsuleType")
3836
3894
 
3837
3895
 
3838
- if sys.version_info >= (3,14):
3896
+ if sys.version_info >= (3, 14):
3839
3897
  from annotationlib import Format, get_annotations
3840
3898
  else:
3899
+ # Available since Python 3.14.0a3
3900
+ # PR: https://github.com/python/cpython/pull/124415
3841
3901
  class Format(enum.IntEnum):
3842
3902
  VALUE = 1
3843
3903
  VALUE_WITH_FAKE_GLOBALS = 2
3844
3904
  FORWARDREF = 3
3845
3905
  STRING = 4
3846
3906
 
3907
+ # Available since Python 3.14.0a1
3908
+ # PR: https://github.com/python/cpython/pull/119891
3847
3909
  def get_annotations(obj, *, globals=None, locals=None, eval_str=False,
3848
3910
  format=Format.VALUE):
3849
3911
  """Compute the annotations dict for an object.
@@ -4031,23 +4093,13 @@ else:
4031
4093
  # as a way of emulating annotation scopes when calling `eval()`
4032
4094
  type_params = getattr(owner, "__type_params__", None)
4033
4095
 
4034
- # type parameters require some special handling,
4035
- # as they exist in their own scope
4036
- # but `eval()` does not have a dedicated parameter for that scope.
4037
- # For classes, names in type parameter scopes should override
4038
- # names in the global scope (which here are called `localns`!),
4039
- # but should in turn be overridden by names in the class scope
4040
- # (which here are called `globalns`!)
4096
+ # Type parameters exist in their own scope, which is logically
4097
+ # between the locals and the globals. We simulate this by adding
4098
+ # them to the globals.
4041
4099
  if type_params is not None:
4042
4100
  globals = dict(globals)
4043
- locals = dict(locals)
4044
4101
  for param in type_params:
4045
- param_name = param.__name__
4046
- if (
4047
- _FORWARD_REF_HAS_CLASS and not forward_ref.__forward_is_class__
4048
- ) or param_name not in globals:
4049
- globals[param_name] = param
4050
- locals.pop(param_name, None)
4102
+ globals[param.__name__] = param
4051
4103
 
4052
4104
  arg = forward_ref.__forward_arg__
4053
4105
  if arg.isidentifier() and not keyword.iskeyword(arg):
@@ -4181,6 +4233,7 @@ class Sentinel:
4181
4233
  def __call__(self, *args, **kwargs):
4182
4234
  raise TypeError(f"{type(self).__name__!r} object is not callable")
4183
4235
 
4236
+ # Breakpoint: https://github.com/python/cpython/pull/21515
4184
4237
  if sys.version_info >= (3, 10):
4185
4238
  def __or__(self, other):
4186
4239
  return typing.Union[self, other]
@@ -4192,6 +4245,26 @@ class Sentinel:
4192
4245
  raise TypeError(f"Cannot pickle {type(self).__name__!r} object")
4193
4246
 
4194
4247
 
4248
+ if sys.version_info >= (3, 14, 0, "beta"):
4249
+ type_repr = annotationlib.type_repr
4250
+ else:
4251
+ def type_repr(value):
4252
+ """Convert a Python value to a format suitable for use with the STRING format.
4253
+
4254
+ This is intended as a helper for tools that support the STRING format but do
4255
+ not have access to the code that originally produced the annotations. It uses
4256
+ repr() for most objects.
4257
+
4258
+ """
4259
+ if isinstance(value, (type, _types.FunctionType, _types.BuiltinFunctionType)):
4260
+ if value.__module__ == "builtins":
4261
+ return value.__qualname__
4262
+ return f"{value.__module__}.{value.__qualname__}"
4263
+ if value is ...:
4264
+ return "..."
4265
+ return repr(value)
4266
+
4267
+
4195
4268
  # Aliases for items that are in typing in all supported versions.
4196
4269
  # We use hasattr() checks so this library will continue to import on
4197
4270
  # future versions of Python that may remove these names.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: py2docfx
3
- Version: 0.1.20rc2196756
3
+ Version: 0.1.21.dev2246704
4
4
  Summary: A package built based on Sphinx which download source code package and generate yaml files supported by docfx.
5
5
  Author: Microsoft Corporation
6
6
  License: MIT License