py2docfx 0.1.21rc2249766__py3-none-any.whl → 0.1.22.dev2259826__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.
- py2docfx/convert_prepare/generate_conf.py +8 -1
- py2docfx/docfx_yaml/process_doctree.py +9 -20
- py2docfx/docfx_yaml/translator.py +34 -44
- py2docfx/docfx_yaml/type_mapping.py +102 -0
- py2docfx/venv/basevenv/Lib/site-packages/markupsafe/__init__.py +3 -2
- py2docfx/venv/basevenv/Lib/site-packages/yaml/__init__.py +1 -1
- py2docfx/venv/venv1/Lib/site-packages/msal/application.py +3 -1
- py2docfx/venv/venv1/Lib/site-packages/msal/oauth2cli/oauth2.py +5 -2
- py2docfx/venv/venv1/Lib/site-packages/msal/sku.py +1 -1
- py2docfx/venv/venv1/Lib/site-packages/msal/token_cache.py +7 -1
- {py2docfx-0.1.21rc2249766.dist-info → py2docfx-0.1.22.dev2259826.dist-info}/METADATA +1 -1
- {py2docfx-0.1.21rc2249766.dist-info → py2docfx-0.1.22.dev2259826.dist-info}/RECORD +14 -13
- {py2docfx-0.1.21rc2249766.dist-info → py2docfx-0.1.22.dev2259826.dist-info}/WHEEL +0 -0
- {py2docfx-0.1.21rc2249766.dist-info → py2docfx-0.1.22.dev2259826.dist-info}/top_level.txt +0 -0
@@ -35,7 +35,14 @@ def generate_conf(package: PackageInfo, output: str, template_dir: str):
|
|
35
35
|
extension_config = []
|
36
36
|
if hasattr(package, "extension_config"):
|
37
37
|
for key, value in package.extension_config.items():
|
38
|
-
|
38
|
+
# Convert JSON boolean strings to Python boolean string representations
|
39
|
+
if value == True:
|
40
|
+
formatted_value = "True"
|
41
|
+
elif value == False:
|
42
|
+
formatted_value = "False"
|
43
|
+
else:
|
44
|
+
formatted_value = json.dumps(value)
|
45
|
+
extension_config.append(" = ".join([key, formatted_value]))
|
39
46
|
params["EXTENSION_CONFIG"] = "\n".join(extension_config)
|
40
47
|
|
41
48
|
# Write the final conf.py file.
|
@@ -12,16 +12,8 @@ from utils import transform_string
|
|
12
12
|
from enum import EnumMeta
|
13
13
|
from importlib import import_module
|
14
14
|
from logger import get_package_logger
|
15
|
+
from type_mapping import map_type_transformations, PACKAGE, METHOD, FUNCTION, DATA, MODULE, CLASS, EXCEPTION, ATTRIBUTE, PROPERTY, PYDANTIC_MODEL, PYDANTIC_FIELD, PYDANTIC_SETTINGS, PYDANTIC_VALIDATOR, PYDANTIC_CONFIG
|
15
16
|
|
16
|
-
PACKAGE = 'package'
|
17
|
-
METHOD = 'method'
|
18
|
-
FUNCTION = 'function'
|
19
|
-
DATA = 'data'
|
20
|
-
MODULE = 'module'
|
21
|
-
CLASS = 'class'
|
22
|
-
EXCEPTION = 'exception'
|
23
|
-
ATTRIBUTE = 'attribute'
|
24
|
-
PROPERTY = 'property'
|
25
17
|
REFMETHOD = 'meth'
|
26
18
|
REFFUNCTION = 'func'
|
27
19
|
REF_PATTERN = ':(py:)?(func|class|meth|mod|ref):`~?[a-zA-Z_\.<> ]*?`'
|
@@ -151,10 +143,10 @@ def getpositionalOnlyParameters(signature):
|
|
151
143
|
except KeyError:
|
152
144
|
# if the default value is not available, set it to inspect._empty
|
153
145
|
default_value = "<class 'inspect._empty'>"
|
154
|
-
|
146
|
+
|
155
147
|
if default_value != "<class 'inspect._empty'>":
|
156
148
|
positional_only_param[count]['defaultValue'] = default_value
|
157
|
-
|
149
|
+
|
158
150
|
count += 1
|
159
151
|
return positional_only_param
|
160
152
|
|
@@ -180,7 +172,7 @@ def _create_datam(app, cls, module, name, _type, obj, lines=None):
|
|
180
172
|
positional_only_params = []
|
181
173
|
try:
|
182
174
|
if _type in [CLASS, METHOD, FUNCTION]:
|
183
|
-
if not (_type == CLASS and isinstance(type(obj).__call__, type(EnumMeta.__call__))):
|
175
|
+
if not (_type == CLASS and isinstance(type(obj).__call__, type(EnumMeta.__call__))):
|
184
176
|
signature = inspect.signature(obj)
|
185
177
|
args = getParameterArgs(signature)
|
186
178
|
keyword_only_args = getKeywordOnlyParameters(signature)
|
@@ -329,10 +321,10 @@ def insert_children_on_package(app, _type, datam):
|
|
329
321
|
if datam[MODULE] not in app.env.docfx_yaml_packages:
|
330
322
|
return
|
331
323
|
insert_package = app.env.docfx_yaml_packages[datam[MODULE]]
|
332
|
-
|
324
|
+
|
333
325
|
for obj in insert_package:
|
334
326
|
if obj['type'] == PACKAGE and obj['uid'] == datam[MODULE]:
|
335
|
-
if _type in [CLASS, EXCEPTION]:
|
327
|
+
if _type in [CLASS, EXCEPTION]:
|
336
328
|
obj['children'].append(datam['uid'])
|
337
329
|
break
|
338
330
|
if _type in [FUNCTION, DATA]:
|
@@ -388,11 +380,8 @@ def process_docstring(app, _type, name, obj, options, lines):
|
|
388
380
|
return PACKAGE
|
389
381
|
return _type
|
390
382
|
|
391
|
-
|
392
|
-
|
393
|
-
|
394
|
-
if _type == PROPERTY:
|
395
|
-
_type = ATTRIBUTE
|
383
|
+
# Apply type transformations using shared mapping function
|
384
|
+
_type = map_type_transformations(_type)
|
396
385
|
|
397
386
|
_type = check_convert_package_type(obj, _type)
|
398
387
|
cls, module = _get_cls_module(_type, name)
|
@@ -451,4 +440,4 @@ def process_docstring(app, _type, name, obj, options, lines):
|
|
451
440
|
insert_children_on_class(app, _type, datam)
|
452
441
|
insert_children_on_function(app, _type, datam)
|
453
442
|
|
454
|
-
app.env.docfx_info_uid_types[datam['uid']] = _type
|
443
|
+
app.env.docfx_info_uid_types[datam['uid']] = _type
|
@@ -15,16 +15,15 @@ from sphinx.util.docfields import _is_single_paragraph
|
|
15
15
|
from collections import OrderedDict
|
16
16
|
from nodes import remarks
|
17
17
|
from logger import get_package_logger
|
18
|
+
from type_mapping import (
|
19
|
+
translator_type_mapping, CLASS_TYPE, EXCEPTION_TYPE, ATTRIBUTE_TYPE,
|
20
|
+
PYDANTIC_MODEL_TYPE, PYDANTIC_SETTINGS_TYPE, PYDANTIC_FIELD_TYPE, PYDANTIC_CONFIG_TYPE,
|
21
|
+
types_contain_constructor, types_contain_attributes, attribute_types
|
22
|
+
)
|
18
23
|
|
19
24
|
TYPE_SEP_PATTERN = '(\[|\]|, |\(|\))'
|
20
25
|
PARAMETER_NAME = "[*][*](.*?)[*][*]"
|
21
26
|
PARAMETER_TYPE = "[(]((?:.|\n)*)[)]"
|
22
|
-
CLASS_TYPE = 'class'
|
23
|
-
EXCEPTION_TYPE = 'exception'
|
24
|
-
ATTRIBUTE_TYPE = 'attribute'
|
25
|
-
|
26
|
-
types_contain_constructor = {CLASS_TYPE, EXCEPTION_TYPE}
|
27
|
-
types_contain_attributes = {CLASS_TYPE, EXCEPTION_TYPE}
|
28
27
|
|
29
28
|
def translator(app, docname, doctree):
|
30
29
|
|
@@ -45,15 +44,6 @@ def translator(app, docname, doctree):
|
|
45
44
|
else:
|
46
45
|
return para_field.astext()
|
47
46
|
|
48
|
-
def type_mapping(type_name):
|
49
|
-
mapping = {
|
50
|
-
"staticmethod": "method",
|
51
|
-
"classmethod": "method",
|
52
|
-
"exception": "class",
|
53
|
-
}
|
54
|
-
|
55
|
-
return mapping[type_name] if type_name in mapping else type_name
|
56
|
-
|
57
47
|
def _get_uid_and_type_from_desc(node):
|
58
48
|
assert node.tagname == 'desc'
|
59
49
|
if node.attributes['domain'] != 'py':
|
@@ -78,7 +68,7 @@ def translator(app, docname, doctree):
|
|
78
68
|
return True
|
79
69
|
|
80
70
|
return False
|
81
|
-
|
71
|
+
|
82
72
|
def extract_exception_desc(exception_fieldbody_node):
|
83
73
|
def extract_exception_type(exception_node):
|
84
74
|
_type_without_xref = transform_node(exception_node).strip(" \n\r\t")
|
@@ -90,7 +80,7 @@ def translator(app, docname, doctree):
|
|
90
80
|
else:
|
91
81
|
exception_type = _type_without_xref
|
92
82
|
return exception_type
|
93
|
-
|
83
|
+
|
94
84
|
extractedExceptions = []
|
95
85
|
for pararaph_node in exception_fieldbody_node.traverse(nodes.paragraph):
|
96
86
|
for exception_node in pararaph_node:
|
@@ -148,8 +138,8 @@ def translator(app, docname, doctree):
|
|
148
138
|
if fieldtype == 'Raises':
|
149
139
|
if data['exceptions']:
|
150
140
|
data['exceptions'].extend(extract_exception_desc(fieldbody))
|
151
|
-
else:
|
152
|
-
data['exceptions'] = extract_exception_desc(fieldbody)
|
141
|
+
else:
|
142
|
+
data['exceptions'] = extract_exception_desc(fieldbody)
|
153
143
|
|
154
144
|
if fieldtype == 'Returns':
|
155
145
|
returnvalue_ret = transform_node(content[0])
|
@@ -239,14 +229,14 @@ def translator(app, docname, doctree):
|
|
239
229
|
signature_child = extract_sig_child_from_attribute_desc_node(node)
|
240
230
|
content_child = extract_content_child_from_attribute_desc_node(node)
|
241
231
|
curuid = signature_child.get('module', '') + '.' + signature_child.get('fullname', '')
|
242
|
-
addedData = {}
|
232
|
+
addedData = {}
|
243
233
|
name = signature_child.children[0].astext()
|
244
|
-
if isinstance(signature_child, desc_signature) and any(isinstance(n, addnodes.desc_annotation) for n in signature_child):
|
245
|
-
signature_child_ids = signature_child.get('ids', [''])
|
246
|
-
|
234
|
+
if isinstance(signature_child, desc_signature) and any(isinstance(n, addnodes.desc_annotation) for n in signature_child):
|
235
|
+
signature_child_ids = signature_child.get('ids', [''])
|
236
|
+
|
247
237
|
if len(curuid) > 0:
|
248
238
|
parent = curuid[:curuid.rfind('.')]
|
249
|
-
|
239
|
+
|
250
240
|
if curuid in attribute_map:
|
251
241
|
# ensure the order of docstring attributes and real attributes is fixed
|
252
242
|
if len(signature_child_ids) == 0:
|
@@ -254,7 +244,7 @@ def translator(app, docname, doctree):
|
|
254
244
|
' ' + signature_child.astext())
|
255
245
|
# concat the description of duplicated nodes
|
256
246
|
else:
|
257
|
-
attribute_map[curuid]['syntax']['content'] = signature_child.astext()
|
247
|
+
attribute_map[curuid]['syntax']['content'] = signature_child.astext()
|
258
248
|
+ ' ' + attribute_map[curuid]['syntax']['content']
|
259
249
|
else:
|
260
250
|
ancestor_class_content_node = find_ancestor_class_content_node(signature_child['class'], signature_child['module'], signature_child['ids'], class_nodes)
|
@@ -292,14 +282,14 @@ def translator(app, docname, doctree):
|
|
292
282
|
raise Exception('ids of node: ' + repr(signature_child) + ' is missing.')
|
293
283
|
# no ids and no duplicate or uid can not be generated.
|
294
284
|
|
295
|
-
# Currently only utilize summary to avoid code repetition,
|
296
|
-
# if we need to change other attribute generator logic,
|
285
|
+
# Currently only utilize summary to avoid code repetition,
|
286
|
+
# if we need to change other attribute generator logic,
|
297
287
|
# better to get from extracted_content_data below too
|
298
|
-
|
288
|
+
|
299
289
|
extracted_content_data = extract_content(content_child, ATTRIBUTE_TYPE, module_name)
|
300
290
|
if not addedData:
|
301
291
|
# If current attribute doesn't have correct signature child, fill in basic information
|
302
|
-
# TODO: append fullName here, currently when fallback to here,
|
292
|
+
# TODO: append fullName here, currently when fallback to here,
|
303
293
|
# information like fullname, name of attribute comes from process_docstring
|
304
294
|
addedData = {
|
305
295
|
'uid': curuid,
|
@@ -351,9 +341,9 @@ def translator(app, docname, doctree):
|
|
351
341
|
if (first_child.astext().strip(" \n\r\t") == 'property'):
|
352
342
|
return None # Don't generate signature for property
|
353
343
|
elif (first_child.astext().strip(" \n\r\t") in annotation_to_skip):
|
354
|
-
# Don't include 'class' declaration for constructors,
|
344
|
+
# Don't include 'class' declaration for constructors,
|
355
345
|
# don't include 'classmethod' front of signature (To keep behavior consistent)
|
356
|
-
included_child_start = 1
|
346
|
+
included_child_start = 1
|
357
347
|
isClass = True
|
358
348
|
for included_child in node.children[included_child_start:]:
|
359
349
|
# Skip class name when write signature (To keep same behavior as before signature async support)
|
@@ -416,15 +406,15 @@ def translator(app, docname, doctree):
|
|
416
406
|
# Because summary can contain code examples,
|
417
407
|
# need to allow summary line to contain punctuation ony
|
418
408
|
if len(content) > 0:
|
419
|
-
summary.append(content)
|
420
|
-
|
409
|
+
summary.append(content)
|
410
|
+
|
421
411
|
if "desctype" in node.parent and node.parent["desctype"] == CLASS_TYPE:
|
422
412
|
# Make sure class doesn't have 'exceptions' field.
|
423
413
|
data.pop('exceptions', '')
|
424
414
|
|
425
415
|
if summary:
|
426
416
|
data['summary'] = '\n\n'.join(summary)
|
427
|
-
|
417
|
+
|
428
418
|
return data
|
429
419
|
|
430
420
|
|
@@ -434,24 +424,24 @@ def translator(app, docname, doctree):
|
|
434
424
|
if (desc_node['desctype'] in types_contain_attributes):
|
435
425
|
class_nodes.append(desc_node)
|
436
426
|
return class_nodes
|
437
|
-
|
427
|
+
|
438
428
|
class_nodes = extract_class_nodes_from_doctree(doctree)
|
439
429
|
class_added_attributes = {}
|
440
430
|
class_data = {}
|
441
|
-
for node in doctree.traverse(addnodes.desc):
|
431
|
+
for node in doctree.traverse(addnodes.desc):
|
442
432
|
(uid, module_name, node_type) = _get_uid_and_type_from_desc(node)
|
443
433
|
data = {}
|
444
434
|
signature_child = node.children[node.first_child_matching_class(addnodes.desc_signature)]
|
445
435
|
content_child = node.children[node.first_child_matching_class(addnodes.desc_content)]
|
446
|
-
if node_type
|
436
|
+
if node_type in attribute_types:
|
447
437
|
attribute_sig_child = extract_sig_child_from_attribute_desc_node(node)
|
448
438
|
|
449
439
|
if content_child.astext().startswith('alias of'):
|
450
440
|
# Ignore alias attribute
|
451
|
-
# e.g. azure.cognitiveservices.speech.intent.IntentRecognizer.IntentsIte (alias of Iterable[Tuple[Union[str, azure.cognitiveservices.speech.intent.LanguageUnderstandingModel], str]])
|
441
|
+
# e.g. azure.cognitiveservices.speech.intent.IntentRecognizer.IntentsIte (alias of Iterable[Tuple[Union[str, azure.cognitiveservices.speech.intent.LanguageUnderstandingModel], str]])
|
452
442
|
continue
|
453
443
|
|
454
|
-
if attribute_sig_child['class']:
|
444
|
+
if attribute_sig_child['class']:
|
455
445
|
attribute_class = attribute_sig_child['module'] + '.' + attribute_sig_child['class']
|
456
446
|
class_added_attributes.setdefault(attribute_class, OrderedDict())
|
457
447
|
# TODO: Merge attribute_data if same uid
|
@@ -470,19 +460,19 @@ def translator(app, docname, doctree):
|
|
470
460
|
else:
|
471
461
|
raise Exception('Attribute doesn\'t have class information. Attribute_name: {0}'.format(attribute_sig_child['fullname']))
|
472
462
|
continue
|
473
|
-
|
463
|
+
|
474
464
|
data.update(extract_content(content_child, node_type, module_name))
|
475
465
|
data['content'] = extract_signature(signature_child)
|
476
466
|
|
477
|
-
data['type'] =
|
467
|
+
data['type'] = translator_type_mapping(node_type) if node_type else 'unknown'
|
478
468
|
if _is_property_node(signature_child):
|
479
469
|
data['type'] = ATTRIBUTE_TYPE
|
480
|
-
|
470
|
+
|
481
471
|
# Don't include empty data
|
482
472
|
for key, val in data.copy().items():
|
483
473
|
if not val:
|
484
474
|
del data[key]
|
485
|
-
|
475
|
+
|
486
476
|
if uid in app.env.docfx_info_field_data:
|
487
477
|
# Sphinx autodoc already provides method signature, skip declaration in RST comments (py:class/py:method)
|
488
478
|
sig_id = signature_child.get('ids', [''])[0].lower()
|
@@ -502,7 +492,7 @@ def translator(app, docname, doctree):
|
|
502
492
|
for class_name, added_attributes in class_added_attributes.items():
|
503
493
|
if not added_attributes:
|
504
494
|
# `class_added_attributes` Maybe be in default value []
|
505
|
-
# Indicates that all doctree attribute desc nodes under this class
|
495
|
+
# Indicates that all doctree attribute desc nodes under this class
|
506
496
|
# are skipped attributes/properties (like alias)
|
507
497
|
continue
|
508
498
|
|
@@ -0,0 +1,102 @@
|
|
1
|
+
# -*- coding: utf-8 -*-
|
2
|
+
#
|
3
|
+
# ---------------------------------------------------------
|
4
|
+
# Copyright (c) Microsoft Corporation. All rights reserved.
|
5
|
+
# ---------------------------------------------------------
|
6
|
+
|
7
|
+
"""
|
8
|
+
Type mapping utilities for converting various documentation types to standardized forms.
|
9
|
+
"""
|
10
|
+
|
11
|
+
# Standard types
|
12
|
+
PACKAGE = 'package'
|
13
|
+
METHOD = 'method'
|
14
|
+
FUNCTION = 'function'
|
15
|
+
DATA = 'data'
|
16
|
+
MODULE = 'module'
|
17
|
+
CLASS = 'class'
|
18
|
+
EXCEPTION = 'exception'
|
19
|
+
ATTRIBUTE = 'attribute'
|
20
|
+
PROPERTY = 'property'
|
21
|
+
|
22
|
+
# Pydantic specific types
|
23
|
+
PYDANTIC_MODEL = 'pydantic_model'
|
24
|
+
PYDANTIC_FIELD = 'pydantic_field'
|
25
|
+
PYDANTIC_SETTINGS = 'pydantic_settings'
|
26
|
+
PYDANTIC_VALIDATOR = 'pydantic_validator'
|
27
|
+
PYDANTIC_CONFIG = 'pydantic_config'
|
28
|
+
|
29
|
+
# Translator-style constants (for compatibility)
|
30
|
+
CLASS_TYPE = 'class'
|
31
|
+
EXCEPTION_TYPE = 'exception'
|
32
|
+
ATTRIBUTE_TYPE = 'attribute'
|
33
|
+
PYDANTIC_MODEL_TYPE = "pydantic_model"
|
34
|
+
PYDANTIC_SETTINGS_TYPE = "pydantic_settings"
|
35
|
+
PYDANTIC_FIELD_TYPE = "pydantic_field"
|
36
|
+
PYDANTIC_CONFIG_TYPE = "pydantic_config"
|
37
|
+
|
38
|
+
# Type groupings for translator functionality
|
39
|
+
types_contain_constructor = {
|
40
|
+
CLASS_TYPE,
|
41
|
+
PYDANTIC_MODEL_TYPE,
|
42
|
+
PYDANTIC_SETTINGS_TYPE,
|
43
|
+
EXCEPTION_TYPE,
|
44
|
+
PYDANTIC_CONFIG_TYPE,
|
45
|
+
}
|
46
|
+
|
47
|
+
types_contain_attributes = {
|
48
|
+
CLASS_TYPE,
|
49
|
+
PYDANTIC_MODEL_TYPE,
|
50
|
+
PYDANTIC_SETTINGS_TYPE,
|
51
|
+
EXCEPTION_TYPE,
|
52
|
+
PYDANTIC_CONFIG_TYPE,
|
53
|
+
}
|
54
|
+
|
55
|
+
attribute_types = {PYDANTIC_FIELD_TYPE, ATTRIBUTE_TYPE}
|
56
|
+
|
57
|
+
|
58
|
+
def map_type_transformations(type_name):
|
59
|
+
"""
|
60
|
+
Apply type transformations to convert various documentation types to standardized forms.
|
61
|
+
Used by process_doctree.py for initial type processing.
|
62
|
+
|
63
|
+
Args:
|
64
|
+
type_name (str): The original type name
|
65
|
+
|
66
|
+
Returns:
|
67
|
+
str: The transformed type name
|
68
|
+
"""
|
69
|
+
# Type transformations
|
70
|
+
if type_name == EXCEPTION or type_name in {PYDANTIC_MODEL, PYDANTIC_SETTINGS, PYDANTIC_CONFIG}:
|
71
|
+
return CLASS
|
72
|
+
elif type_name == PROPERTY or type_name == PYDANTIC_FIELD:
|
73
|
+
return ATTRIBUTE
|
74
|
+
elif type_name == PYDANTIC_VALIDATOR:
|
75
|
+
return METHOD
|
76
|
+
|
77
|
+
# Return original type if no transformation needed
|
78
|
+
return type_name
|
79
|
+
|
80
|
+
|
81
|
+
def translator_type_mapping(type_name):
|
82
|
+
"""
|
83
|
+
Apply type mapping transformations for translator processing.
|
84
|
+
Used by translator.py for docstring processing.
|
85
|
+
Includes both original translator mappings and process_doctree transformations.
|
86
|
+
|
87
|
+
Args:
|
88
|
+
type_name (str): The original type name
|
89
|
+
|
90
|
+
Returns:
|
91
|
+
str: The mapped type name
|
92
|
+
"""
|
93
|
+
# First apply the process_doctree style transformations
|
94
|
+
transformed_type = map_type_transformations(type_name)
|
95
|
+
|
96
|
+
# Then apply the original translator mappings
|
97
|
+
mapping = {
|
98
|
+
"staticmethod": "method",
|
99
|
+
"classmethod": "method",
|
100
|
+
}
|
101
|
+
|
102
|
+
return mapping[transformed_type] if transformed_type in mapping else transformed_type
|
@@ -214,14 +214,14 @@ class Markup(str):
|
|
214
214
|
if (end := value.find("-->", start)) == -1:
|
215
215
|
break
|
216
216
|
|
217
|
-
value = f"{value[:start]}{value[end + 3:]}"
|
217
|
+
value = f"{value[:start]}{value[end + 3 :]}"
|
218
218
|
|
219
219
|
# remove tags using the same method
|
220
220
|
while (start := value.find("<")) != -1:
|
221
221
|
if (end := value.find(">", start)) == -1:
|
222
222
|
break
|
223
223
|
|
224
|
-
value = f"{value[:start]}{value[end + 1:]}"
|
224
|
+
value = f"{value[:start]}{value[end + 1 :]}"
|
225
225
|
|
226
226
|
# collapse spaces
|
227
227
|
value = " ".join(value.split())
|
@@ -388,6 +388,7 @@ def __getattr__(name: str) -> t.Any:
|
|
388
388
|
"The '__version__' attribute is deprecated and will be removed in"
|
389
389
|
" MarkupSafe 3.1. Use feature detection, or"
|
390
390
|
' `importlib.metadata.version("markupsafe")`, instead.',
|
391
|
+
DeprecationWarning,
|
391
392
|
stacklevel=2,
|
392
393
|
)
|
393
394
|
return importlib.metadata.version("markupsafe")
|
@@ -2326,7 +2326,7 @@ class PublicClientApplication(ClientApplication): # browser app or mobile app
|
|
2326
2326
|
auth_scheme=auth_scheme,
|
2327
2327
|
**data)
|
2328
2328
|
|
2329
|
-
def initiate_device_flow(self, scopes=None, **kwargs):
|
2329
|
+
def initiate_device_flow(self, scopes=None, *, claims_challenge=None, **kwargs):
|
2330
2330
|
"""Initiate a Device Flow instance,
|
2331
2331
|
which will be used in :func:`~acquire_token_by_device_flow`.
|
2332
2332
|
|
@@ -2341,6 +2341,8 @@ class PublicClientApplication(ClientApplication): # browser app or mobile app
|
|
2341
2341
|
flow = self.client.initiate_device_flow(
|
2342
2342
|
scope=self._decorate_scope(scopes or []),
|
2343
2343
|
headers={msal.telemetry.CLIENT_REQUEST_ID: correlation_id},
|
2344
|
+
data={"claims": _merge_claims_challenge_and_capabilities(
|
2345
|
+
self._client_capabilities, claims_challenge)},
|
2344
2346
|
**kwargs)
|
2345
2347
|
flow[self.DEVICE_FLOW_CORRELATION_ID] = correlation_id
|
2346
2348
|
return flow
|
@@ -305,7 +305,7 @@ class Client(BaseClient): # We choose to implement all 4 grants in 1 class
|
|
305
305
|
grant_assertion_encoders = {GRANT_TYPE_SAML2: BaseClient.encode_saml_assertion}
|
306
306
|
|
307
307
|
|
308
|
-
def initiate_device_flow(self, scope=None, **kwargs):
|
308
|
+
def initiate_device_flow(self, scope=None, *, data=None, **kwargs):
|
309
309
|
# type: (list, **dict) -> dict
|
310
310
|
# The naming of this method is following the wording of this specs
|
311
311
|
# https://tools.ietf.org/html/draft-ietf-oauth-device-flow-12#section-3.1
|
@@ -323,8 +323,11 @@ class Client(BaseClient): # We choose to implement all 4 grants in 1 class
|
|
323
323
|
DAE = "device_authorization_endpoint"
|
324
324
|
if not self.configuration.get(DAE):
|
325
325
|
raise ValueError("You need to provide device authorization endpoint")
|
326
|
+
_data = {"client_id": self.client_id, "scope": self._stringify(scope or [])}
|
327
|
+
if isinstance(data, dict):
|
328
|
+
_data.update(data)
|
326
329
|
resp = self._http_client.post(self.configuration[DAE],
|
327
|
-
data=
|
330
|
+
data=_data,
|
328
331
|
headers=dict(self.default_headers, **kwargs.pop("headers", {})),
|
329
332
|
**kwargs)
|
330
333
|
flow = json.loads(resp.text)
|
@@ -126,7 +126,13 @@ class TokenCache(object):
|
|
126
126
|
|
127
127
|
@staticmethod
|
128
128
|
def _is_matching(entry: dict, query: dict, target_set: set = None) -> bool:
|
129
|
-
|
129
|
+
query_with_lowercase_environment = {
|
130
|
+
# __add() canonicalized entry's environment value to lower case,
|
131
|
+
# so we do the same here.
|
132
|
+
k: v.lower() if k == "environment" and isinstance(v, str) else v
|
133
|
+
for k, v in query.items()
|
134
|
+
} if query else {}
|
135
|
+
return is_subdict_of(query_with_lowercase_environment, entry) and (
|
130
136
|
target_set <= set(entry.get("target", "").split())
|
131
137
|
if target_set else True)
|
132
138
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: py2docfx
|
3
|
-
Version: 0.1.
|
3
|
+
Version: 0.1.22.dev2259826
|
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
|
@@ -4,7 +4,7 @@ py2docfx/convert_prepare/__init__.py,sha256=XxtxrP0kmW3ZBHIAoxsPDEHzcgeC0WSnole8
|
|
4
4
|
py2docfx/convert_prepare/arg_parser.py,sha256=7goU287AjAyKGd9d5QKcphMCQOrlPnKpQ_YtdwLSNT8,7618
|
5
5
|
py2docfx/convert_prepare/constants.py,sha256=RC5DqNkqWvx4hb91FrajZ1R9dBFLxcPyoEJ43jdm36E,102
|
6
6
|
py2docfx/convert_prepare/environment.py,sha256=CF8g2hnpwFXsTfvp1O8lwYpR848iCK8bDM2UAWqibEQ,7286
|
7
|
-
py2docfx/convert_prepare/generate_conf.py,sha256=
|
7
|
+
py2docfx/convert_prepare/generate_conf.py,sha256=BL1HXLkO594_6TsIUbfU5dSts9aR8pps_pd971Q1nU8,2600
|
8
8
|
py2docfx/convert_prepare/generate_document.py,sha256=iTOCMBwkfvZEj5dlEGUq4qynUodaYxJuIrG9R5eGk38,2949
|
9
9
|
py2docfx/convert_prepare/get_source.py,sha256=eSRnMppk1U9N6wmvmOmQb6tClpDLwXcyrhkwbid5lE0,6963
|
10
10
|
py2docfx/convert_prepare/git.py,sha256=Cq76ooxejKlVJiJWWbBhbLZ_JvxqN2ka12L8jkl80b4,6492
|
@@ -69,10 +69,11 @@ py2docfx/docfx_yaml/logger.py,sha256=brzFbSgQq3o3n2sy-2pk849AVpaUn1rhJfIs44IYa0Y
|
|
69
69
|
py2docfx/docfx_yaml/miss_reference.py,sha256=NHoQtas0kvFsJXaR4fsk7kHjwV4aJobrr_Q30HaUc_I,2450
|
70
70
|
py2docfx/docfx_yaml/nodes.py,sha256=tBDi35jLJArlobl07DKOkmH2qz7dudXLp_kTUfR_r2w,412
|
71
71
|
py2docfx/docfx_yaml/parameter_utils.py,sha256=04wQCtbS-G2hWM5UGkL22s10LZLUbqbh3RM9rWGOToI,10897
|
72
|
-
py2docfx/docfx_yaml/process_doctree.py,sha256=
|
72
|
+
py2docfx/docfx_yaml/process_doctree.py,sha256=xz4Whx19pprCo12jrZD2rLTVtM1dJsHSsURQOlF6xl0,17207
|
73
73
|
py2docfx/docfx_yaml/return_type_utils.py,sha256=nmdCUOvwdYk2jF6RqmOvU6gjXmXUTPUeCqyHPdKZNUQ,7483
|
74
74
|
py2docfx/docfx_yaml/settings.py,sha256=JQZNwFebczl-zn8Yk2taAGANRi-Hw8hywtDWxqXXFyQ,373
|
75
|
-
py2docfx/docfx_yaml/translator.py,sha256=
|
75
|
+
py2docfx/docfx_yaml/translator.py,sha256=hLSl8WkTMB_Oq5XuzCP4fDRWSOWzpNJN7Gzvy_SkXck,25664
|
76
|
+
py2docfx/docfx_yaml/type_mapping.py,sha256=rgnkxbPRzr3C1NDLjXdAyYg1Zh-y0QcFutlzWvtJaC8,2954
|
76
77
|
py2docfx/docfx_yaml/utils.py,sha256=sJ6aWF9wwIWIoZL6WWsd3FQD-zb3PWrJ5QTWP7PCarY,1567
|
77
78
|
py2docfx/docfx_yaml/write_utils.py,sha256=q5qoYWw6GVDV8a3E8IxcSLWnN9sAer42VFRgadHBkgk,305
|
78
79
|
py2docfx/docfx_yaml/writer.py,sha256=aDxz8Vc8ln0a9PKi08DIILvgMIfXqN5wArDcAQ8Iy8E,35980
|
@@ -354,7 +355,7 @@ py2docfx/venv/basevenv/Lib/site-packages/jinja2/sandbox.py,sha256=-8zxR6TO9kUkci
|
|
354
355
|
py2docfx/venv/basevenv/Lib/site-packages/jinja2/tests.py,sha256=Am5Z6Lmfr2XaH_npIfJJ8MdXtWsbLjMULZJulTAj30E,5905
|
355
356
|
py2docfx/venv/basevenv/Lib/site-packages/jinja2/utils.py,sha256=udQxWIKaq4QDCZiXN31ngKOaGGdaMA5fl0JMaM-F6fg,26971
|
356
357
|
py2docfx/venv/basevenv/Lib/site-packages/jinja2/visitor.py,sha256=ZmeLuTj66ic35-uFH-1m0EKXiw4ObDDb_WuE6h5vPFg,3572
|
357
|
-
py2docfx/venv/basevenv/Lib/site-packages/markupsafe/__init__.py,sha256=
|
358
|
+
py2docfx/venv/basevenv/Lib/site-packages/markupsafe/__init__.py,sha256=ut2LXj-6sqkIVUdSAx-dboB5crAaRG5y7EO447hmaro,13644
|
358
359
|
py2docfx/venv/basevenv/Lib/site-packages/markupsafe/_native.py,sha256=2ptkJ40yCcp9kq3L1NqpgjfpZB-obniYKFFKUOkHh4Q,218
|
359
360
|
py2docfx/venv/basevenv/Lib/site-packages/markupsafe/_speedups.pyi,sha256=LSDmXYOefH4HVpAXuL8sl7AttLw0oXh1njVoVZp2wqQ,42
|
360
361
|
py2docfx/venv/basevenv/Lib/site-packages/markupsafe/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
@@ -1879,7 +1880,7 @@ py2docfx/venv/basevenv/Lib/site-packages/wheel/_commands/convert.py,sha256=0wSJM
|
|
1879
1880
|
py2docfx/venv/basevenv/Lib/site-packages/wheel/_commands/pack.py,sha256=o3iwjfRHl7N9ul-M2kHbewLJZnqBLAWf0tzUCwoiTMw,3078
|
1880
1881
|
py2docfx/venv/basevenv/Lib/site-packages/wheel/_commands/tags.py,sha256=Rv2ySVb8-qX3osKp3uJgxcIMXkjt43XUD0-zvC6KvnY,4775
|
1881
1882
|
py2docfx/venv/basevenv/Lib/site-packages/wheel/_commands/unpack.py,sha256=Y_J7ynxPSoFFTT7H0fMgbBlVErwyDGcObgme5MBuz58,1021
|
1882
|
-
py2docfx/venv/basevenv/Lib/site-packages/yaml/__init__.py,sha256=
|
1883
|
+
py2docfx/venv/basevenv/Lib/site-packages/yaml/__init__.py,sha256=sZ38wzPWp139cwc5ARZFByUvJxtB07X32FUQAzoFR6c,12311
|
1883
1884
|
py2docfx/venv/basevenv/Lib/site-packages/yaml/composer.py,sha256=_Ko30Wr6eDWUeUpauUGT3Lcg9QPBnOPVlTnIMRGJ9FM,4883
|
1884
1885
|
py2docfx/venv/basevenv/Lib/site-packages/yaml/constructor.py,sha256=kNgkfaeLUkwQYY_Q6Ff1Tz2XVw_pG1xVE9Ak7z-viLA,28639
|
1885
1886
|
py2docfx/venv/basevenv/Lib/site-packages/yaml/cyaml.py,sha256=6ZrAG9fAYvdVe2FK_w0hmXoG7ZYsoYUwapG8CiC72H0,3851
|
@@ -2555,7 +2556,7 @@ py2docfx/venv/venv1/Lib/site-packages/jwt/utils.py,sha256=hxOjvDBheBYhz-RIPiEz7Q
|
|
2555
2556
|
py2docfx/venv/venv1/Lib/site-packages/jwt/warnings.py,sha256=50XWOnyNsIaqzUJTk6XHNiIDykiL763GYA92MjTKmok,59
|
2556
2557
|
py2docfx/venv/venv1/Lib/site-packages/msal/__init__.py,sha256=U8y4dCI4xqYgP0iQA19EQsm7ESUqitGR-xySLGX66EA,2089
|
2557
2558
|
py2docfx/venv/venv1/Lib/site-packages/msal/__main__.py,sha256=gk_iJRPMl-9Zq8qx-wylPHiT_h1suhIeR0ir1wR9160,16516
|
2558
|
-
py2docfx/venv/venv1/Lib/site-packages/msal/application.py,sha256=
|
2559
|
+
py2docfx/venv/venv1/Lib/site-packages/msal/application.py,sha256=TqlqaS23ew9mSJtSxrbNBwLYiHBC25G73EDtO2DjBzI,130541
|
2559
2560
|
py2docfx/venv/venv1/Lib/site-packages/msal/auth_scheme.py,sha256=biI1W2ZEV2u5cQpsF1JK2ykLuyTCKaRZicgOa2kQqaA,1505
|
2560
2561
|
py2docfx/venv/venv1/Lib/site-packages/msal/authority.py,sha256=gT86mPhoxmVQ0aU6hOyOcMnXGKpbxDWKhNRWcPgQXAc,11314
|
2561
2562
|
py2docfx/venv/venv1/Lib/site-packages/msal/broker.py,sha256=fdcLXhnWAizF3LrJVqJHsnavamTByeGczLjVaJDcXrM,12956
|
@@ -2565,17 +2566,17 @@ py2docfx/venv/venv1/Lib/site-packages/msal/individual_cache.py,sha256=K2e72EP3eE
|
|
2565
2566
|
py2docfx/venv/venv1/Lib/site-packages/msal/managed_identity.py,sha256=F_Q_MCrO7tx2kQBRJA1UVN9oTmr2XYShExPNRwDzlZk,32212
|
2566
2567
|
py2docfx/venv/venv1/Lib/site-packages/msal/mex.py,sha256=_oub-3zNJUpt1KTRt_XUMxEMTOjHhLZQjzb_VLFHVHc,6455
|
2567
2568
|
py2docfx/venv/venv1/Lib/site-packages/msal/region.py,sha256=N7Z43sbwjnQfoUQC6TBR8xy3v1oY_rI8hH0-AfiXa8g,1738
|
2568
|
-
py2docfx/venv/venv1/Lib/site-packages/msal/sku.py,sha256=
|
2569
|
+
py2docfx/venv/venv1/Lib/site-packages/msal/sku.py,sha256=mszVyYMTOln3g6FFXqfa_SuwrdFC31cbI28YadpwMGo,183
|
2569
2570
|
py2docfx/venv/venv1/Lib/site-packages/msal/telemetry.py,sha256=ePllJwgA14s-n70prBndAoyiQAMYy1aVam6VXexU0Ac,3192
|
2570
2571
|
py2docfx/venv/venv1/Lib/site-packages/msal/throttled_http_client.py,sha256=No8Z2zGQhyxBMFi_mum1S1sCyB7_IaN258JM0vHAhIA,9023
|
2571
|
-
py2docfx/venv/venv1/Lib/site-packages/msal/token_cache.py,sha256=
|
2572
|
+
py2docfx/venv/venv1/Lib/site-packages/msal/token_cache.py,sha256=RJJ23t40W6LXt54PFM0Wd2YWHF1q9WJb5kcP9zQrs14,21036
|
2572
2573
|
py2docfx/venv/venv1/Lib/site-packages/msal/wstrust_request.py,sha256=2S5eKxmK8fklnirBGewtdhkcA7O8JvE1KhJ8-c9k4yw,6098
|
2573
2574
|
py2docfx/venv/venv1/Lib/site-packages/msal/wstrust_response.py,sha256=QfmdjMEf1vED8vGmtIMWI1UvspUHtFJ8ACjMfecje2g,4599
|
2574
2575
|
py2docfx/venv/venv1/Lib/site-packages/msal/oauth2cli/__init__.py,sha256=mss-rvQhJtwqdxDnxyUlR0wqYqlCZt6YeeZbLd3aNd8,219
|
2575
2576
|
py2docfx/venv/venv1/Lib/site-packages/msal/oauth2cli/assertion.py,sha256=CLniYdUJW58aCeKNO6gTuuJGguCxIBtts13wqMdb8qw,5690
|
2576
2577
|
py2docfx/venv/venv1/Lib/site-packages/msal/oauth2cli/authcode.py,sha256=BBBbWvC8m340Vkpye-bRkWgt5uUDWDXseGrbAGwJEZU,19154
|
2577
2578
|
py2docfx/venv/venv1/Lib/site-packages/msal/oauth2cli/http.py,sha256=doA49yyv2vSaqs3JtTl3YSiHkEDnnuPFOxUc1F2GIyA,2824
|
2578
|
-
py2docfx/venv/venv1/Lib/site-packages/msal/oauth2cli/oauth2.py,sha256=
|
2579
|
+
py2docfx/venv/venv1/Lib/site-packages/msal/oauth2cli/oauth2.py,sha256=KQ8zHGGCrm8qCmPvpwEO8yFmC7WKWFb_C9Xr_1YsvMs,42289
|
2579
2580
|
py2docfx/venv/venv1/Lib/site-packages/msal/oauth2cli/oidc.py,sha256=4S0yWXyz1u5aqmXkXVL38o_MIYVnSXyol2eDFUkOWRU,15087
|
2580
2581
|
py2docfx/venv/venv1/Lib/site-packages/msal_extensions/__init__.py,sha256=GJ5lssYoaB-2cvEk1KoIXtwqAFLkdDzewr7O2xFR4-k,396
|
2581
2582
|
py2docfx/venv/venv1/Lib/site-packages/msal_extensions/cache_lock.py,sha256=HT8Hucd1c76VQLGMKZYTLqMxWmUx6j-brVJcBMqQA18,2993
|
@@ -3915,7 +3916,7 @@ py2docfx/venv/venv1/Lib/site-packages/wheel/_commands/convert.py,sha256=0wSJMU0m
|
|
3915
3916
|
py2docfx/venv/venv1/Lib/site-packages/wheel/_commands/pack.py,sha256=o3iwjfRHl7N9ul-M2kHbewLJZnqBLAWf0tzUCwoiTMw,3078
|
3916
3917
|
py2docfx/venv/venv1/Lib/site-packages/wheel/_commands/tags.py,sha256=Rv2ySVb8-qX3osKp3uJgxcIMXkjt43XUD0-zvC6KvnY,4775
|
3917
3918
|
py2docfx/venv/venv1/Lib/site-packages/wheel/_commands/unpack.py,sha256=Y_J7ynxPSoFFTT7H0fMgbBlVErwyDGcObgme5MBuz58,1021
|
3918
|
-
py2docfx-0.1.
|
3919
|
-
py2docfx-0.1.
|
3920
|
-
py2docfx-0.1.
|
3921
|
-
py2docfx-0.1.
|
3919
|
+
py2docfx-0.1.22.dev2259826.dist-info/METADATA,sha256=xTi8c6UJVwYuNDSY5O8A6dbR8WmuBwTblt8Ynk1NQlg,548
|
3920
|
+
py2docfx-0.1.22.dev2259826.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
3921
|
+
py2docfx-0.1.22.dev2259826.dist-info/top_level.txt,sha256=5dH2uP81dczt_qQJ38wiZ-gzoVWasfiJALWRSjdbnYU,9
|
3922
|
+
py2docfx-0.1.22.dev2259826.dist-info/RECORD,,
|
File without changes
|
File without changes
|