py2docfx 0.1.10.dev1814907__py3-none-any.whl → 0.1.10.dev1817528__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/__main__.py CHANGED
@@ -4,6 +4,7 @@ import os
4
4
  import shutil
5
5
  import sys
6
6
  import threading
7
+ import time
7
8
 
8
9
  from py2docfx import PACKAGE_ROOT
9
10
  from py2docfx.convert_prepare.environment import VirtualEnvironmentManager
@@ -213,12 +214,22 @@ def parse_command_line_args(argv) -> (
213
214
  return ([package_info], [], github_token, ado_token, output_root)
214
215
 
215
216
  def folder_clean_up(folder: str | os.PathLike) -> None:
217
+ start_time = time.time()
216
218
  if os.path.exists(folder):
217
219
  shutil.rmtree(folder)
220
+ end_time = time.time()
221
+ with open(os.path.join(PACKAGE_ROOT, "time.txt"), "a") as f:
222
+ f.write(f"File clean up for {folder} is done in {end_time - start_time} seconds\n")
223
+ print(f"<CI INFO>: File clean up for {folder} is done in {end_time - start_time} seconds")
218
224
 
219
225
  def folder_copy(src: str | os.PathLike, dst: str | os.PathLike) -> None:
226
+ start_time = time.time()
220
227
  if os.path.exists(src):
221
228
  shutil.copytree(src, dst)
229
+ end_time = time.time()
230
+ with open(os.path.join(PACKAGE_ROOT, "time.txt"), "a") as f:
231
+ f.write(f"File copy from {src} to {dst} is done in {end_time - start_time} seconds\n")
232
+ print(f"<CI INFO>: File copy from {src} to {dst} is done in {end_time - start_time} seconds")
222
233
 
223
234
  def donwload_package_generate_documents(
224
235
  package_info_list: list[PackageInfo],
@@ -232,6 +243,7 @@ def donwload_package_generate_documents(
232
243
  template_venv_path = venv_manager.create_template_venv(template_venv_id)
233
244
 
234
245
  def initial_venv_cache():
246
+ start_time = time.time()
235
247
  package_count = len(package_info_list)
236
248
  cache_cout = CACHED_VIRTUALENV_LENGTH
237
249
  if package_count < CACHED_VIRTUALENV_LENGTH:
@@ -246,6 +258,10 @@ def donwload_package_generate_documents(
246
258
 
247
259
  for thread in threads:
248
260
  thread.join()
261
+ end_time = time.time()
262
+ with open(os.path.join(PACKAGE_ROOT, "time.txt"), "a") as f:
263
+ f.write(f"Initial virtual environment cache is done in {end_time - start_time} seconds\n")
264
+ print(f"<CI INFO>: Initial virtual environment cache is done in {end_time - start_time} seconds")
249
265
 
250
266
  def donwload_one_package_generate_document(
251
267
  package: PackageInfo,
@@ -282,8 +298,13 @@ def donwload_package_generate_documents(
282
298
  thread = threading.Thread(target = folder_copy, args=[template_venv_path, dest_venv_path])
283
299
  thread.start()
284
300
 
301
+ start_time = time.time()
285
302
  donwload_one_package_generate_document(package, package_index, env_executable)
286
-
303
+ end_time = time.time()
304
+ #write time stemp into a text file
305
+ with open(os.path.join(PACKAGE_ROOT, "time.txt"), "a") as f:
306
+ f.write(f"Package {package.name} is processed in {end_time - start_time} seconds\n")
307
+ print(f"<CI INFO>: Package {package.name} is processed in {end_time - start_time} seconds")
287
308
  # used venv clean up
288
309
  folder_clean_up(os.path.join(PACKAGE_ROOT, "venv", worker_venv_id))
289
310
  print(f"<CI INFO>: Vitrual environment ID: {worker_venv_id} is cleaned up")
@@ -1,6 +1,7 @@
1
1
  import os
2
2
  import subprocess
3
3
  import sys
4
+ import time
4
5
 
5
6
  from py2docfx import PACKAGE_ROOT
6
7
  from py2docfx.convert_prepare.get_source import get_source
@@ -48,7 +49,7 @@ class VirtualEnvironmentManager:
48
49
  install_package(package, executable)
49
50
 
50
51
  def create_template_venv(self, venv_name: str) -> str:
51
-
52
+ start_time = time.time()
52
53
  venv_dir = os.path.join(PACKAGE_ROOT, "venv", venv_name)
53
54
 
54
55
  try:
@@ -62,5 +63,8 @@ class VirtualEnvironmentManager:
62
63
  install_converter_requirements(env_executable)
63
64
  if (self.required_package_list is not None) and (len(self.required_package_list) > 0):
64
65
  self.install_required_packages(env_executable)
65
-
66
+ end_time = time.time()
67
+ with open(os.path.join(PACKAGE_ROOT, "time.txt"), "a") as f:
68
+ f.write(f"Time taken to create virtual environment ID {venv_name}: {end_time - start_time} seconds\n")
69
+ print(f"<CI INFO>: Time taken to create virtual environment ID {venv_name}: {end_time - start_time} seconds")
66
70
  return venv_dir
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: py2docfx
3
- Version: 0.1.10.dev1814907
3
+ Version: 0.1.10.dev1817528
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
@@ -1,7 +1,7 @@
1
1
  py2docfx/__init__.py,sha256=kPRhPGPC1JknDotkksG428c1iIgfFr_4_7Jm-llrowY,72
2
- py2docfx/__main__.py,sha256=1KfgM7X3vTSmuxG_4wvgjU08zd84E59bwtOk2PxcCbQ,12870
2
+ py2docfx/__main__.py,sha256=KfTj3kuRIK08hWeS9Snx1HSfxtackE6qsovLZDeweIk,14239
3
3
  py2docfx/convert_prepare/__init__.py,sha256=XxtxrP0kmW3ZBHIAoxsPDEHzcgeC0WSnole8Lk6CjKs,11
4
- py2docfx/convert_prepare/environment.py,sha256=X7Ep8J826L_p2fXiuEMdnBY_e91XQBNAwfF62N-8PbY,2569
4
+ py2docfx/convert_prepare/environment.py,sha256=T3xGM8UFW1HZq5Z9rkEoRc6yrSu5hn0RIEwvCGi_2Wk,2949
5
5
  py2docfx/convert_prepare/generate_conf.py,sha256=wqs6iyElzJarH-20_qEL9zvZvt5xfBMsGXSXPSZy6wg,2295
6
6
  py2docfx/convert_prepare/generate_document.py,sha256=TcGAgLMrpPqHUOVRSX7Amp6ld7hQhKT_IqFzIGdqiRE,2473
7
7
  py2docfx/convert_prepare/get_source.py,sha256=JQ_6VIiu902U22l4lE7z6DLtu_DneJhRQWEPdogWZ6Q,5035
@@ -3648,7 +3648,7 @@ py2docfx/venv/template/Scripts/rst2s5.py,sha256=RtHXdYAt4Mz07kU5M1XfvQWS32qaGGIo
3648
3648
  py2docfx/venv/template/Scripts/rst2xetex.py,sha256=gR9zUREEfvziEHrN3Jf0twa0elJuy2YyZsImNpai6sQ,912
3649
3649
  py2docfx/venv/template/Scripts/rst2xml.py,sha256=Fz416Y_8EbQLhwL98NUloZJVUny3LeLfe0M9FHeuVI0,641
3650
3650
  py2docfx/venv/template/Scripts/rstpep2html.py,sha256=Yv2rSlbSgdjF1KQrfcdwjkd-QqmRYwvYwMfk1VAs7Ro,709
3651
- py2docfx-0.1.10.dev1814907.dist-info/METADATA,sha256=TNX2Wq0URP2XQmodwatOoV1Ssn6cY1Zp2IPdkjFcYjo,602
3652
- py2docfx-0.1.10.dev1814907.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
3653
- py2docfx-0.1.10.dev1814907.dist-info/top_level.txt,sha256=5dH2uP81dczt_qQJ38wiZ-gzoVWasfiJALWRSjdbnYU,9
3654
- py2docfx-0.1.10.dev1814907.dist-info/RECORD,,
3651
+ py2docfx-0.1.10.dev1817528.dist-info/METADATA,sha256=9kbZJFKWAtw64BCiZ9_unS8LK-58yPEHYcAI_l7oBJI,602
3652
+ py2docfx-0.1.10.dev1817528.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
3653
+ py2docfx-0.1.10.dev1817528.dist-info/top_level.txt,sha256=5dH2uP81dczt_qQJ38wiZ-gzoVWasfiJALWRSjdbnYU,9
3654
+ py2docfx-0.1.10.dev1817528.dist-info/RECORD,,