1+ from __future__ import annotations
2+
13import json
24import concurrent .futures
35import itertools
2022generation_time = datetime .now (timezone .utc )
2123
2224
23- def get_completion_progress () -> Iterator [' LanguageProjectData' ]:
25+ def get_completion_progress () -> Iterator [LanguageProjectData ]:
2426 clones_dir = Path ('clones' )
25- Repo .clone_from (
26- 'https://github.com/python/devguide.git' ,
27- devguide_dir := Path (clones_dir , 'devguide' ),
28- depth = 1 ,
29- )
27+ if not (devguide_dir := Path (clones_dir , 'devguide' )).exists ():
28+ Repo .clone_from ('https://github.com/python/devguide.git' , devguide_dir , depth = 1 )
29+ else :
30+ Repo (devguide_dir ).git .pull ()
3031 latest_branch = branches_from_peps ()[0 ]
31- Repo .clone_from (
32- 'https://github.com/python/cpython.git' ,
33- cpython_dir := Path (clones_dir , 'cpython' ),
34- depth = 1 ,
35- branch = latest_branch ,
36- )
32+ if not (cpython_dir := Path (clones_dir , 'cpython' )).exists ():
33+ Repo .clone_from (
34+ 'https://github.com/python/cpython.git' ,
35+ cpython_dir ,
36+ depth = 1 ,
37+ branch = latest_branch ,
38+ )
39+ else :
40+ (cpython_repo := Repo (cpython_dir )).git .fetch ()
41+ cpython_repo .git .switch (latest_branch )
42+ cpython_repo .git .pull ()
43+
44+ subprocess .run (['make' , '-C' , cpython_dir / 'Doc' , 'clean' ], check = True )
3745 subprocess .run (['make' , '-C' , cpython_dir / 'Doc' , 'venv' ], check = True )
3846 subprocess .run (['make' , '-C' , cpython_dir / 'Doc' , 'gettext' ], check = True )
3947
@@ -56,7 +64,7 @@ def get_project_data(
5664 repo : str | None ,
5765 languages_built : dict [str , str ],
5866 clones_dir : str ,
59- ) -> ' LanguageProjectData' :
67+ ) -> LanguageProjectData :
6068 built = language .code in languages_built
6169 if repo :
6270 completion , branch , change = get_completion (clones_dir , repo )
0 commit comments