py2docfx 0.1.4.dev1696736__py3-none-any.whl → 0.1.4.dev1704806__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.
@@ -28,11 +28,11 @@ def string_representer(dumper, data):
28
28
  style="'" if (scientific_notation_regex.match(data)) else None)
29
29
  yml.add_representer(str, string_representer)
30
30
 
31
- def insert_node_to_toc_tree_return_is_root_package(toc_yaml, uid, project_name, toc_node_map):
31
+ def insert_node_to_toc_tree(toc_yaml, uid, project_name, toc_node_map):
32
32
  # Build nested TOC
33
33
  parent_level = uid
34
34
  cur_node = None
35
- is_root = False
35
+
36
36
  # Try all ancestors azure.core.class1 -> azure.core -> azure
37
37
  while parent_level.count('.') >= 1:
38
38
  parent_level = '.'.join(parent_level.split('.')[:-1])
@@ -51,13 +51,11 @@ def insert_node_to_toc_tree_return_is_root_package(toc_yaml, uid, project_name,
51
51
  # uid is representing a package in TOC as root node
52
52
  if cur_node is None:
53
53
  # if uid doesn't contain '.', the name needn't to simplify
54
- cur_node = {'name': uid}
54
+ cur_node = {'name': uid, 'uid': uid}
55
55
  toc_yaml.append(cur_node)
56
- is_root = True
57
56
 
58
57
  # insert to uid-toc map
59
58
  toc_node_map[uid] = cur_node
60
- return is_root
61
59
 
62
60
  def merge_params(arg_params, doc_params):
63
61
  merged_params = deepcopy(doc_params)
@@ -241,7 +239,6 @@ def build_finished(app, exception):
241
239
 
242
240
  references = []
243
241
  # Merge module data with class data
244
- package_obj = None
245
242
  for obj in yaml_data:
246
243
  obj = filter_out_self_from_args(obj)
247
244
 
@@ -260,14 +257,11 @@ def build_finished(app, exception):
260
257
  # To distinguish distribution package and import package
261
258
  if obj.get('type', '') == 'package' and obj.get('kind', '') != 'distribution':
262
259
  obj['kind'] = 'import'
263
- package_obj = obj
264
260
 
265
261
  if (obj['type'] == 'class' and obj['inheritance']):
266
262
  convert_class_to_enum_if_needed(obj)
267
263
 
268
- is_root = insert_node_to_toc_tree_return_is_root_package(toc_yaml, uid, project_name, toc_node_map)
269
- if is_root and package_obj is not None:
270
- package_obj['kind'] = 'rootImport' # API Browser only list root packages for ApiList feature
264
+ insert_node_to_toc_tree(toc_yaml, uid, project_name, toc_node_map)
271
265
 
272
266
  for data_set in (app.env.docfx_yaml_packages,
273
267
  app.env.docfx_yaml_modules,
@@ -178,30 +178,5 @@ def test_build_finished_check_toc(tmp_path, app):
178
178
  assert 'Blueprint' == toc[0]['items'][3]['name']
179
179
  assert 'azure.durable_functions.Blueprint' == toc[0]['items'][3]['uid']
180
180
 
181
- @pytest.mark.sphinx('yaml', testroot='build-finished')
182
- def test_build_finished_check_root_package_type(tmp_path, app):
183
- app.builder.outdir = tmp_path
184
- app.config.project = 'azure-durable-functions'
185
- app.env.docfx_yaml_packages = {
186
- 'azure.durable_functions':[{'uid':'azure.durable_functions','type':'package'}],
187
- 'azure.durable_functions.models':[{'uid':'azure.durable_functions.models','type':'package'}],
188
- }
189
- app.env.docfx_yaml_modules = {
190
- 'azure.durable_functions.constants':[{'uid':'azure.durable_functions.constants','type':'module'}],
191
- 'azure.durable_functions.models.DurableEntityContext':[{'uid':'azure.durable_functions.models.DurableEntityContext','type':'module'}],
192
- }
193
- app.env.docfx_yaml_classes = {'azure.durable_functions.Blueprint':[{'uid':'azure.durable_functions.Blueprint','type':'class', 'inheritance':[]}]}
194
181
 
195
- # Act
196
- build_finished(app, None)
197
-
198
- # Assert after build_finished
199
- rootPackageYaml = None
200
- with open(os.path.join(tmp_path, API_ROOT, 'azure.durable_functions.yml'), 'r', encoding='utf-8') as file:
201
- rootPackageYaml = yaml.safe_load(file)
202
- assert 'rootImport' == rootPackageYaml['type']
203
-
204
- subPackageYaml = None
205
- with open(os.path.join(tmp_path, API_ROOT, 'azure.durable_functions.models.yml'), 'r', encoding='utf-8') as file:
206
- subPackageYaml = yaml.safe_load(file)
207
- assert 'import' == subPackageYaml['type']
182
+ 1
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: py2docfx
3
- Version: 0.1.4.dev1696736
3
+ Version: 0.1.4.dev1704806
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
@@ -53,7 +53,7 @@ py2docfx/convert_prepare/tests/data/subpackage/azure-mgmt-containerservice/azure
53
53
  py2docfx/convert_prepare/tests/data/subpackage/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_03_31/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
54
54
  py2docfx/convert_prepare/tests/data/subpackage/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_03_31/models.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
55
55
  py2docfx/docfx_yaml/__init__.py,sha256=KCEizAXv-SXtrYhvFfLHdBWDhz51AA9uagaeTL-Itpo,100
56
- py2docfx/docfx_yaml/build_finished.py,sha256=i7oPa_zdWplwiVUNUqwAArM7gTskkWeeflv03N_i6Bg,13468
56
+ py2docfx/docfx_yaml/build_finished.py,sha256=i8Ms3NSqxlzyJjQgG3uat3yPI4g2HZ_O08jeYKB56To,13127
57
57
  py2docfx/docfx_yaml/build_init.py,sha256=lAw-fnBVQbySfZ7Sut_NpFQUjnqLOmnGQrTBBH2RXcg,1860
58
58
  py2docfx/docfx_yaml/common.py,sha256=UN1MUmjUoN1QSFDR1Cm_bfRuHr6FQiOe5VQV6s8xzjc,6841
59
59
  py2docfx/docfx_yaml/convert_class.py,sha256=boKDaxnXbnLxja62UFXi3eChGDB_WBW6ouUUJgOhdpE,2098
@@ -74,7 +74,7 @@ py2docfx/docfx_yaml/writer.py,sha256=BQ02TshJM7O53_n07i_DJ-WtI7PYNyBJ2OLzivq4iiA
74
74
  py2docfx/docfx_yaml/yaml_builder.py,sha256=qSxXVS4iFCc1ZdL5QzLrv8hy3LHIQCrhO4WcTp01vag,2575
75
75
  py2docfx/docfx_yaml/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
76
76
  py2docfx/docfx_yaml/tests/conftest.py,sha256=CykkZxaDZ-3a1EIQdGBieSmHL9FdyTE2xTJZe9QgKcg,1214
77
- py2docfx/docfx_yaml/tests/test_build_finished.py,sha256=PSyWuY_XWmNeSjQl4kBwHUWpEhQHuEXQCZPWtFZ7vb4,8433
77
+ py2docfx/docfx_yaml/tests/test_build_finished.py,sha256=x1aaOzUJxQkmwEaVgKxtC7kvVPeO7cCgFNDQq2GApxQ,6979
78
78
  py2docfx/docfx_yaml/tests/test_method_arguments.py,sha256=Cvj9aoADtacKciVN8nempXW-KQL8nujSa9GNVuk6l_8,1578
79
79
  py2docfx/docfx_yaml/tests/test_numpy_syntax.py,sha256=ssb3J_-Jzjybhh4eycCA_LkXbGflyZyIUAiTjlEYLiw,863
80
80
  py2docfx/docfx_yaml/tests/test_translator_attributes.py,sha256=qZCsQGffq31k3UzpXkJpycplOXIq9gi2SxY6vu0DTfw,5224
@@ -123,7 +123,7 @@ py2docfx/docfx_yaml/tests/roots/test-writer-uri/conf.py,sha256=avcbnIOV2mlGQwhMQ
123
123
  py2docfx/docfx_yaml/tests/roots/test-writer-versions/code_with_version_directives.py,sha256=UuizbrJPaG_PcaH18BvbI9KQevOaLd4SslpnzMSqcrE,1030
124
124
  py2docfx/docfx_yaml/tests/roots/test-writer-versions/conf.py,sha256=SCEKrm9VigArfdgf-GAieJD-40d0ctT6urmGIjFOZLM,404
125
125
  py2docfx/docfx_yaml/tests/utils/test_utils.py,sha256=d0OYSUQ6NyoZx5mlLdNGGNhiNmmQhjVT4hQ6jY3VE_M,3383
126
- py2docfx-0.1.4.dev1696736.dist-info/METADATA,sha256=2zzC4BCfZ37vD0QjsbCh-3_7-gqYFUHdnYGMiDo1lQU,601
127
- py2docfx-0.1.4.dev1696736.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
128
- py2docfx-0.1.4.dev1696736.dist-info/top_level.txt,sha256=5dH2uP81dczt_qQJ38wiZ-gzoVWasfiJALWRSjdbnYU,9
129
- py2docfx-0.1.4.dev1696736.dist-info/RECORD,,
126
+ py2docfx-0.1.4.dev1704806.dist-info/METADATA,sha256=f1OaV-74qAPu_WpRfHnwiifgmnxLOgILYnzXeumNJvU,601
127
+ py2docfx-0.1.4.dev1704806.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
128
+ py2docfx-0.1.4.dev1704806.dist-info/top_level.txt,sha256=5dH2uP81dczt_qQJ38wiZ-gzoVWasfiJALWRSjdbnYU,9
129
+ py2docfx-0.1.4.dev1704806.dist-info/RECORD,,