File tree Expand file tree Collapse file tree 5 files changed +45
-6
lines changed Expand file tree Collapse file tree 5 files changed +45
-6
lines changed Original file line number Diff line number Diff line change 1919 - uses : actions/checkout@v4
2020 - run : sudo apt-get install -y gettext
2121 - run : uv run generate.py # generates "index.html"
22- - run : mkdir -p build && cp index.html style.css build
22+ - run : mkdir -p build && cp index.html style.css warnings* build
2323 - name : Deploy 🚀
2424 if : github.event_name != 'pull_request'
2525 uses : JamesIves/github-pages-deploy-action@v4
Original file line number Diff line number Diff line change 1+ from pathlib import Path
2+ from shutil import copyfile
3+
4+ import sphinx .cmd .build
5+
6+
7+ def number (clones_dir : str , repo : str , language_code : str ) -> int :
8+ Path (clones_dir , f'cpython/Doc/locales/{ language_code } ' ).mkdir (parents = True )
9+ Path (clones_dir , f'cpython/Doc/locales/{ language_code } /LC_MESSAGES' ).symlink_to (
10+ Path (clones_dir , repo ), True
11+ )
12+ sphinx .cmd .build .main (
13+ (
14+ '--builder' ,
15+ 'html' ,
16+ '--fresh-env' ,
17+ '--jobs' ,
18+ 'auto' ,
19+ '--define' ,
20+ f'language={ language_code } ' ,
21+ '--verbose' ,
22+ '--warning-file' ,
23+ warning_file := f'{ clones_dir } /warnings-{ language_code } .txt' ,
24+ f'{ clones_dir } /cpython/Doc' , # sourcedir
25+ './build' , # outputdir
26+ )
27+ )
28+ copyfile (warning_file , f'warnings-{ language_code } .txt' )
29+ return len (Path (warning_file ).read_text ().splitlines ())
Original file line number Diff line number Diff line change 66# "jinja2",
77# "requests",
88# "docutils",
9+ # "sphinx",
10+ # "python-docs-theme",
911# ]
1012# ///
1113import subprocess
1921from git import Repo
2022from jinja2 import Template
2123
22- import contribute
24+ import build_warnings
2325import build_status
26+ import contribute
2427from visitors import get_number_of_visitors
2528from completion import branches_from_devguide , get_completion , TranslatorsData
26- from repositories import get_languages_and_repos , Language
29+ from repositories import Language , get_languages_and_repos
2730
2831generation_time = datetime .now (timezone .utc )
2932
@@ -50,16 +53,19 @@ def get_completion_progress() -> Iterator['LanguageProjectData']:
5053 if repo :
5154 completion , translators_data = get_completion (clones_dir , repo )
5255 visitors_num = get_number_of_visitors (language .code ) if built else 0
56+ issues = build_warnings .number (clones_dir , repo , language .code )
5357 else :
5458 completion = 0.0
5559 translators_data = TranslatorsData (0 , False )
5660 visitors_num = 0
61+ issues = 0
5762 yield LanguageProjectData (
5863 language ,
5964 repo ,
6065 completion ,
6166 translators_data ,
6267 visitors_num ,
68+ issues ,
6369 built ,
6470 in_switcher = languages_built .get (language .code ),
6571 uses_platform = language .code in contribute .pulling_from_transifex ,
@@ -74,6 +80,7 @@ class LanguageProjectData:
7480 completion : float
7581 translators : TranslatorsData
7682 visitors : int
83+ issues : int
7784 built : bool
7885 in_switcher : bool | None
7986 uses_platform : bool
Original file line number Diff line number Diff line change 3939.progress-bar .low + .progress-bar-outer-label {
4040 display : inline-block;
4141}
42- td [data-label = "visitors" ], td [data-label = "translators" ] {
42+ td [data-label = "visitors" ], td [data-label = "translators" ], td [ data-label = "issues" ] {
4343 text-align : right;
4444}
4545td [data-label = "completion" ] {
Original file line number Diff line number Diff line change 1212 <th >language</th >
1313 <th >contribute</th >
1414 <th >build</th >
15- <th >visitors* </th >
15+ <th >visitors¹ </th >
1616 <th >translators</th >
17+ <th >warnings²</th >
1718 <th >completion</th >
1819</tr >
1920</thead >
4748 {{ project.translators.number }}
4849 {% if project .translators .link %} </a >{% endif %}
4950 </td >
51+ <td data-label =" issues" ><a href =" warnings-{{ project.language.code }}.txt" target =" _blank" >{{ project.issues }}</a ></td >
5052 <td data-label =" completion" >
5153 <div class =" progress-bar" style =" width : {{ project.completion }}%;" >{{ "{:.2f}".format(project.completion) }}%</div >
5254 <div class =" progress-bar-outer-label" >{{ "{:.2f}".format(project.completion) }}%</div >
5557{% endfor %}
5658</tbody >
5759</table >
58- <p >* sum of <a href =" https://plausible.io/data-policy#how-we-count-unique-users-without-cookies" target =" _blank" >daily unique visitors</a > since 8 June 2024</p >
60+ <p >¹ sum of <a href =" https://plausible.io/data-policy#how-we-count-unique-users-without-cookies" target =" _blank" >daily unique visitors</a > since 8 June 2024</p >
61+ <p >² number of Sphinx build process warnings</p >
5962<p >For more information about translations, see the <a href =" https://devguide.python.org/documentation/translating/" target =" _blank" >Python Developer’s Guide</a >.</p >
6063<p >Last updated at {{ generation_time.strftime('%A, %-d %B %Y, %-H:%M:%S %Z') }} (in {{ duration // 60 }}:{{ "{:02}".format(duration % 60) }} minutes).</p >
6164</body >
You can’t perform that action at this time.
0 commit comments