|
16 | 16 | from dataclasses import dataclass, asdict |
17 | 17 | from datetime import datetime, timezone |
18 | 18 | from pathlib import Path |
19 | | -from tempfile import TemporaryDirectory |
20 | 19 |
|
21 | 20 | from git import Repo |
22 | 21 | from jinja2 import Template |
|
31 | 30 |
|
32 | 31 |
|
33 | 32 | def get_completion_progress() -> Iterator['LanguageProjectData']: |
34 | | - with TemporaryDirectory() as clones_dir: |
35 | | - Repo.clone_from( |
36 | | - 'https://github.com/python/devguide.git', |
37 | | - devguide_dir := Path(clones_dir, 'devguide'), |
38 | | - depth=1, |
39 | | - ) |
40 | | - latest_branch = branches_from_devguide(devguide_dir)[0] |
41 | | - Repo.clone_from( |
42 | | - 'https://github.com/python/cpython.git', |
43 | | - cpython_dir := Path(clones_dir, 'cpython'), |
44 | | - depth=1, |
45 | | - branch=latest_branch, |
46 | | - ) |
47 | | - subprocess.run(['make', '-C', cpython_dir / 'Doc', 'venv'], check=True) |
48 | | - subprocess.run(['make', '-C', cpython_dir / 'Doc', 'gettext'], check=True) |
49 | | - languages_built = dict(build_status.get_languages(PoolManager())) |
| 33 | + clones_dir = Path('clones') |
| 34 | + Repo.clone_from( |
| 35 | + 'https://github.com/python/devguide.git', |
| 36 | + devguide_dir := Path(clones_dir, 'devguide'), |
| 37 | + depth=1, |
| 38 | + ) |
| 39 | + latest_branch = branches_from_devguide(devguide_dir)[0] |
| 40 | + Repo.clone_from( |
| 41 | + 'https://github.com/python/cpython.git', |
| 42 | + cpython_dir := Path(clones_dir, 'cpython'), |
| 43 | + depth=1, |
| 44 | + branch=latest_branch, |
| 45 | + ) |
| 46 | + subprocess.run(['make', '-C', cpython_dir / 'Doc', 'venv'], check=True) |
| 47 | + subprocess.run(['make', '-C', cpython_dir / 'Doc', 'gettext'], check=True) |
| 48 | + languages_built = dict(build_status.get_languages(PoolManager())) |
50 | 49 |
|
51 | | - with concurrent.futures.ThreadPoolExecutor() as executor: |
52 | | - return executor.map( |
53 | | - get_project_data, |
54 | | - *zip(*get_languages_and_repos(devguide_dir)), |
55 | | - itertools.repeat(languages_built), |
56 | | - itertools.repeat(clones_dir), |
57 | | - ) |
| 50 | + with concurrent.futures.ThreadPoolExecutor() as executor: |
| 51 | + return executor.map( |
| 52 | + get_project_data, |
| 53 | + *zip(*get_languages_and_repos(devguide_dir)), |
| 54 | + itertools.repeat(languages_built), |
| 55 | + itertools.repeat(clones_dir), |
| 56 | + ) |
58 | 57 |
|
59 | 58 |
|
60 | 59 | def get_project_data( |
|
0 commit comments