Skip to content

Commit 8015f37

Browse files
committed
Persist clones directories
1 parent fd33e03 commit 8015f37

File tree

2 files changed

+24
-24
lines changed

2 files changed

+24
-24
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
index.html
22
metadata.html
33
warnings-*.txt
4+
clones

generate.py

Lines changed: 23 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
from dataclasses import dataclass, asdict
1717
from datetime import datetime, timezone
1818
from pathlib import Path
19-
from tempfile import TemporaryDirectory
2019

2120
from git import Repo
2221
from jinja2 import Template
@@ -31,30 +30,30 @@
3130

3231

3332
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()))
5049

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+
)
5857

5958

6059
def get_project_data(

0 commit comments

Comments
 (0)