|
14 | 14 | from git import Repo |
15 | 15 | from jinja2 import Template |
16 | 16 |
|
17 | | -import completion |
18 | 17 | import visitors |
| 18 | +from completion import branches_from_devguide, get_completion |
19 | 19 |
|
20 | 20 | completion_progress = [] |
21 | 21 | generation_time = datetime.now(timezone.utc) |
22 | 22 |
|
23 | 23 | with TemporaryDirectory() as clones_dir: |
24 | | - Repo.clone_from(f'https://github.com/python/cpython.git', Path(clones_dir, 'cpython'), depth=1, branch='3.13') |
| 24 | + Repo.clone_from( |
| 25 | + f'https://github.com/python/cpython.git', Path(clones_dir, 'cpython'), depth=1, branch=branches_from_devguide()[0] |
| 26 | + ) |
25 | 27 | subprocess.run(['make', '-C', Path(clones_dir, 'cpython/Doc'), 'venv'], check=True) |
26 | 28 | subprocess.run(['make', '-C', Path(clones_dir, 'cpython/Doc'), 'gettext'], check=True) |
27 | 29 | for language in ('es', 'fr', 'id', 'it', 'ja', 'ko', 'pl', 'pt-br', 'tr', 'uk', 'zh-cn', 'zh-tw'): |
28 | | - completion_number = completion.get_completion(clones_dir, language) |
| 30 | + completion_number = get_completion(clones_dir, language) |
29 | 31 | visitors_number = visitors.get_number_of_visitors(language) |
30 | 32 | completion_progress.append((language, completion_number, visitors_number)) |
31 | 33 | print(completion_progress[-1]) |
|
55 | 57 | </a> |
56 | 58 | </td> |
57 | 59 | <td data-label="visitors"> |
58 | | - <a href="https://https://plausible.io/docs.python.org?filters=((contains,page,(/{{ language }}/)))" target="_blank"> |
| 60 | + <a href="https://plausible.io/docs.python.org?filters=((contains,page,(/{{ language }}/)))" target="_blank"> |
59 | 61 | {{ '{:,}'.format(visitors) }} |
60 | 62 | </a> |
61 | 63 | </td> |
|
0 commit comments