py2docfx 0.1.10.dev1870753__py3-none-any.whl → 0.1.10.dev1871013__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 +12 -1
- py2docfx/convert_prepare/environment.py +8 -4
- {py2docfx-0.1.10.dev1870753.dist-info → py2docfx-0.1.10.dev1871013.dist-info}/METADATA +1 -1
- {py2docfx-0.1.10.dev1870753.dist-info → py2docfx-0.1.10.dev1871013.dist-info}/RECORD +6 -6
- {py2docfx-0.1.10.dev1870753.dist-info → py2docfx-0.1.10.dev1871013.dist-info}/WHEEL +0 -0
- {py2docfx-0.1.10.dev1870753.dist-info → py2docfx-0.1.10.dev1871013.dist-info}/top_level.txt +0 -0
py2docfx/__main__.py
CHANGED
@@ -245,6 +245,7 @@ async def donwload_package_generate_documents(
|
|
245
245
|
|
246
246
|
start_num = len(required_package_list)
|
247
247
|
env_prepare_tasks = []
|
248
|
+
env_remove_tasks = []
|
248
249
|
|
249
250
|
for idx in range(min([py2docfxEnvironment.VENV_BUFFER, len(package_info_list)])):
|
250
251
|
env_prepare_tasks.append(asyncio.create_task(
|
@@ -308,13 +309,21 @@ async def donwload_package_generate_documents(
|
|
308
309
|
ado_token)
|
309
310
|
)
|
310
311
|
)
|
311
|
-
|
312
|
+
if idx >= 1:
|
313
|
+
env_remove_tasks.append(asyncio.create_task(py2docfxEnvironment.remove_environment(idx-1)))
|
314
|
+
if idx > py2docfxEnvironment.VENV_BUFFER and env_remove_tasks[idx-py2docfxEnvironment.VENV_BUFFER] != None:
|
315
|
+
print(f"Removing venv {idx-py2docfxEnvironment.VENV_BUFFER}")
|
316
|
+
await env_remove_tasks[idx-py2docfxEnvironment.VENV_BUFFER]
|
312
317
|
|
313
318
|
if output_doc_folder:
|
314
319
|
start_time = time.time()
|
315
320
|
move_root_toc_to_target(YAML_OUTPUT_ROOT, output_doc_folder)
|
316
321
|
end_time = time.time()
|
317
322
|
print(f"<move_root_toc_to_target>{end_time-start_time}<move_root_toc_to_target/>")
|
323
|
+
|
324
|
+
for idx in range(len(env_remove_tasks)):
|
325
|
+
if env_remove_tasks[idx] != None and not env_remove_tasks[idx].done():
|
326
|
+
await env_remove_tasks[idx]
|
318
327
|
|
319
328
|
def prepare_out_dir(output_root: str | os.PathLike) -> os.PathLike | None:
|
320
329
|
# prepare output_root\DOC_FOLDER_NAME (if folder contains files, raise exception)
|
@@ -344,6 +353,8 @@ def main(argv) -> int:
|
|
344
353
|
shutil.rmtree("source_repo")
|
345
354
|
if os.path.exists("target_repo"):
|
346
355
|
shutil.rmtree("target_repo")
|
356
|
+
|
357
|
+
# TODO: may need to purge pip cache
|
347
358
|
(package_info_list, required_package_list, github_token, ado_token, output_root, \
|
348
359
|
venv_required) = parse_command_line_args(argv)
|
349
360
|
venv_required = False
|
@@ -10,6 +10,7 @@ from py2docfx.convert_prepare import pip_utils
|
|
10
10
|
REQUIREMENT_MODULES = ["setuptools", "sphinx==6.1.3", "pyyaml", "jinja2==3.0.3", "wheel"]
|
11
11
|
VENV_DIR = "venv"
|
12
12
|
VENV_BUFFER = 10
|
13
|
+
VENV_DELETE_BUFFER = 10
|
13
14
|
PIP_INSTALL_COMMAND = ["-m", "pip", "install", "--upgrade"]
|
14
15
|
|
15
16
|
PIP_INSTALL_VENV_COMMON_OPTIONS = [
|
@@ -72,8 +73,11 @@ async def prepare_venv(venv_num: int, required_package_list: list[PackageInfo],
|
|
72
73
|
await install_required_packages(get_venv_exe(venv_num), required_package_list, github_token, ado_token)
|
73
74
|
print(f"<CI INFO>: venv{venv_num} setup complete.")
|
74
75
|
|
75
|
-
def remove_environment(venv_num: int):
|
76
|
-
|
76
|
+
async def remove_environment(venv_num: int):
|
77
|
+
venv_path = get_venv_path(venv_num)
|
78
|
+
if os.path.exists(venv_path):
|
77
79
|
print(f"<CI INFO>: Removing venv{venv_num}...")
|
78
|
-
shutil.rmtree
|
79
|
-
|
80
|
+
return asyncio.to_thread(shutil.rmtree, venv_path)
|
81
|
+
|
82
|
+
# Example usage
|
83
|
+
# asyncio.run(remove_environment(1))
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: py2docfx
|
3
|
-
Version: 0.1.10.
|
3
|
+
Version: 0.1.10.dev1871013
|
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=
|
2
|
+
py2docfx/__main__.py,sha256=Nq5DzPY8RZNuUqUUTW6rF_k_75LNrGG39lX4injCWrY,15719
|
3
3
|
py2docfx/convert_prepare/__init__.py,sha256=XxtxrP0kmW3ZBHIAoxsPDEHzcgeC0WSnole8Lk6CjKs,11
|
4
|
-
py2docfx/convert_prepare/environment.py,sha256=
|
4
|
+
py2docfx/convert_prepare/environment.py,sha256=_gGbLRnuOnL8vsU-b7jZITqIN9CUeSXNFB8_xKWtKjk,3656
|
5
5
|
py2docfx/convert_prepare/generate_conf.py,sha256=wqs6iyElzJarH-20_qEL9zvZvt5xfBMsGXSXPSZy6wg,2295
|
6
6
|
py2docfx/convert_prepare/generate_document.py,sha256=cLfFr7od0RHADkXyh2gaPreXZGvKNBUlduBosYTuPbk,3118
|
7
7
|
py2docfx/convert_prepare/get_source.py,sha256=eEIbfLkGdBSOIJElMBTiXkKlkujb_hdFu5g6InNroTg,5851
|
@@ -1882,7 +1882,7 @@ py2docfx/venv/venv0/Scripts/rst2s5.py,sha256=lnv7lRNv1Oz3gjI5BOJlTqfCJQLJxgwJ9l3
|
|
1882
1882
|
py2docfx/venv/venv0/Scripts/rst2xetex.py,sha256=5_9VjwA5RKUMJG9L__1ZiS8DIeLHRdPWeWW7B4otM8M,909
|
1883
1883
|
py2docfx/venv/venv0/Scripts/rst2xml.py,sha256=hU2nzGVbXbQBnH_ydI5f2VDkGQyDMUdTgz3rfa45JMg,638
|
1884
1884
|
py2docfx/venv/venv0/Scripts/rstpep2html.py,sha256=uLmCJKfEKPeeWS0n76HharN9YEYIuCRQQXfPPBJaRso,706
|
1885
|
-
py2docfx-0.1.10.
|
1886
|
-
py2docfx-0.1.10.
|
1887
|
-
py2docfx-0.1.10.
|
1888
|
-
py2docfx-0.1.10.
|
1885
|
+
py2docfx-0.1.10.dev1871013.dist-info/METADATA,sha256=tnMc1MCAhdOQTwQam94xJuJfhlBL1Elbd28qOYpzGFI,601
|
1886
|
+
py2docfx-0.1.10.dev1871013.dist-info/WHEEL,sha256=eOLhNAGa2EW3wWl_TU484h7q1UNgy0JXjjoqKoxAAQc,92
|
1887
|
+
py2docfx-0.1.10.dev1871013.dist-info/top_level.txt,sha256=5dH2uP81dczt_qQJ38wiZ-gzoVWasfiJALWRSjdbnYU,9
|
1888
|
+
py2docfx-0.1.10.dev1871013.dist-info/RECORD,,
|
File without changes
|
File without changes
|