diff --git a/.github/workflows/update.yml b/.github/workflows/update.yml index 302a684ad..e5d4a2424 100644 --- a/.github/workflows/update.yml +++ b/.github/workflows/update.yml @@ -56,8 +56,8 @@ jobs: curl -Lo index.html-public https://github.com/python-docs-translations/dashboard/raw/refs/heads/gh-pages/index.html diff --color=always -u index.html-public build/index.html || : cat build/index.html - - run: uv run generate_metadata.py # generates metadata.html - - name: Deploy metadata view 🚀 + - run: uv run generate_build_details.py # generates build-details.html + - name: Deploy build details view 🚀 if: github.event_name != 'pull_request' uses: JamesIves/github-pages-deploy-action@v4 with: diff --git a/generate_metadata.py b/generate_build_details.py similarity index 86% rename from generate_metadata.py rename to generate_build_details.py index dbceee294..c9d8054db 100644 --- a/generate_metadata.py +++ b/generate_build_details.py @@ -20,18 +20,18 @@ generation_time = datetime.now(timezone.utc) -def get_projects_metadata( +def get_projects_build_details( completion_progress: Sequence[LanguageProjectData], ) -> Iterator[tuple[int, int, datetime | None]]: with concurrent.futures.ProcessPoolExecutor() as executor: return executor.map( - get_metadata, + get_build_details, *zip(*map(get_language_repo_and_completion, completion_progress)), itertools.repeat(Path('clones')), ) -def get_metadata( +def get_build_details( language: Language, repo: str | None, completion: float, clones_dir: str ) -> tuple[int, int, datetime | None]: if not repo or not (repo_path := Path(clones_dir, 'translations', repo)).exists(): @@ -65,10 +65,12 @@ def get_language_repo_and_completion( dacite.from_dict(LanguageProjectData, project) for project in index_json ] - output = env.get_template('metadata.html.jinja').render( - metadata=zip(completion_progress, get_projects_metadata(completion_progress)), + output = env.get_template('build-details.html.jinja').render( + build_details=zip( + completion_progress, get_projects_build_details(completion_progress) + ), generation_time=generation_time, duration=(datetime.now(timezone.utc) - generation_time).seconds, ) - Path('build/metadata.html').write_text(output) + Path('build/build-details.html').write_text(output) diff --git a/templates/base.html.jinja b/templates/base.html.jinja index 538fc19c3..b5186fb53 100644 --- a/templates/base.html.jinja +++ b/templates/base.html.jinja @@ -32,7 +32,7 @@