From 86f49537d575ca0eddec0751529b0a4db3a5f75f Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 5 Oct 2026 22:37:09 +0000 Subject: [PATCH 1/7] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/astral-sh/ruff-pre-commit: c59bba8fb259db0fec2bbb77ad8ba51ea7341b56 → f12be1ebaa5351c1fc76472de98db2c3446c8253](https://github.com/astral-sh/ruff-pre-commit/compare/c59bba8fb259db0fec2bbb77ad8ba51ea7341b56...f12be1ebaa5351c1fc76472de98db2c3446c8253) - [github.com/python-jsonschema/check-jsonschema: 1a4bb160cab6417b3045e1b37b6b72449243e658 → 4f85d46a92dc17713078e5de73f8a13190edf6fc](https://github.com/python-jsonschema/check-jsonschema/compare/1a4bb160cab6417b3045e1b37b6b72449243e658...4f85d46a92dc17713078e5de73f8a13190edf6fc) - [github.com/pre-commit/mirrors-mypy: d2823d321df3af8f878f7ee3414dc94d037145b9 → 2834ec6639549dd6796205c8f011dedcd587288b](https://github.com/pre-commit/mirrors-mypy/compare/d2823d321df3af8f878f7ee3414dc94d037145b9...2834ec6639549dd6796205c8f011dedcd587288b) - [github.com/djlint/djLint: 9112cb64851c95a7802358af285d21ad8b7f6437 → 97266b950ee135d6ef89c9ace9d88baadced6f67](https://github.com/djlint/djLint/compare/9112cb64851c95a7802358af285d21ad8b7f6437...97266b950ee135d6ef89c9ace9d88baadced6f67) - [github.com/zizmorcore/zizmor-pre-commit: e3eebf65325ccc992422292cb7a4baee967cf815 → fa412071e4f5d44d44f9e365f4676f9df92456a2](https://github.com/zizmorcore/zizmor-pre-commit/compare/e3eebf65325ccc992422292cb7a4baee967cf815...fa412071e4f5d44d44f9e365f4676f9df92456a2) --- .pre-commit-config.yaml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index deab1e89d..6c733b6f9 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/astral-sh/ruff-pre-commit - rev: c59bba8fb259db0fec2bbb77ad8ba51ea7341b56 # frozen: v0.15.20 + rev: f12be1ebaa5351c1fc76472de98db2c3446c8253 # frozen: v0.16.10 hooks: - id: ruff-check args: [--fix, --exit-non-zero-on-fix] @@ -20,7 +20,7 @@ repos: - id: trailing-whitespace - repo: https://github.com/python-jsonschema/check-jsonschema - rev: 1a4bb160cab6417b3045e1b37b6b72449243e658 # frozen: 0.37.4 + rev: 4f85d46a92dc17713078e5de73f8a13190edf6fc # frozen: 0.38.2 hooks: - id: check-github-workflows @@ -35,7 +35,7 @@ repos: - id: check-useless-excludes - repo: https://github.com/pre-commit/mirrors-mypy - rev: d2823d321df3af8f878f7ee3414dc94d037145b9 # frozen: v2.1.0 + rev: 2834ec6639549dd6796205c8f011dedcd587288b # frozen: v2.4.0 hooks: - id: mypy additional_dependencies: [types-docutils, types-polib>=1.2.0.20250114, types-requests] @@ -47,13 +47,13 @@ repos: args: [".", "--per-rule-ignores", "DEP002=python-docs-theme", "--package-module-name-map", "gitpython=git,sphinx-lint=sphinxlint"] - repo: https://github.com/djlint/djLint - rev: 9112cb64851c95a7802358af285d21ad8b7f6437 # frozen: v1.36.4 + rev: 97266b950ee135d6ef89c9ace9d88baadced6f67 # frozen: v1.46.4 hooks: - id: djlint-reformat-jinja - id: djlint-jinja - repo: https://github.com/zizmorcore/zizmor-pre-commit - rev: e3eebf65325ccc992422292cb7a4baee967cf815 # frozen: v1.26.1 + rev: fa412071e4f5d44d44f9e365f4676f9df92456a2 # frozen: v1.30.1 hooks: - id: zizmor From dff2c5ca44de1bfbda1d61b36516f25d2be084c5 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 5 Oct 2026 22:37:50 +0000 Subject: [PATCH 2/7] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- generate.py | 6 +++--- repositories.py | 2 +- tests/support.py | 4 ++-- tests/test_contribute.py | 3 ++- tests/test_index.py | 2 +- tests/test_repositories.py | 8 ++++---- tests/test_translated_names.py | 2 +- translated_names.py | 2 +- 8 files changed, 15 insertions(+), 14 deletions(-) diff --git a/generate.py b/generate.py index 36159b11e..20b571c4e 100644 --- a/generate.py +++ b/generate.py @@ -1,12 +1,12 @@ from __future__ import annotations -import json import concurrent.futures import itertools +import json import logging import subprocess from collections.abc import Iterator -from dataclasses import dataclass, asdict +from dataclasses import asdict, dataclass from datetime import datetime, timezone from pathlib import Path @@ -14,8 +14,8 @@ from jinja2 import Environment, FileSystemLoader from urllib3 import PoolManager -import translated_names import contribute +import translated_names from completion import branches_from_peps, get_completion, release_cycle_from_peps from repositories import Language, get_languages_and_repos diff --git a/repositories.py b/repositories.py index d45cdde70..89d698ca7 100644 --- a/repositories.py +++ b/repositories.py @@ -4,7 +4,7 @@ from pathlib import Path from docutils import core -from docutils.nodes import table, row +from docutils.nodes import row, table def get_languages_and_repos( diff --git a/tests/support.py b/tests/support.py index 0841ce479..6a7d9df98 100644 --- a/tests/support.py +++ b/tests/support.py @@ -1,5 +1,5 @@ -import sys import contextlib +import sys # -------------------------------- Imports ----------------------------------- # @@ -11,7 +11,7 @@ def import_scripts(dir='..'): yield cm -class DirsOnSysPath(object): +class DirsOnSysPath: def __init__(self, *paths): self.original_value = sys.path[:] self.original_object = sys.path diff --git a/tests/test_contribute.py b/tests/test_contribute.py index ce0a17fad..32d1dfd11 100644 --- a/tests/test_contribute.py +++ b/tests/test_contribute.py @@ -1,6 +1,7 @@ import unittest -import urllib3 + import support +import urllib3 with support.import_scripts(): import contribute diff --git a/tests/test_index.py b/tests/test_index.py index 709a32d0b..ec17fa204 100644 --- a/tests/test_index.py +++ b/tests/test_index.py @@ -1,8 +1,8 @@ import unittest from dataclasses import replace from datetime import datetime -import support +import support from jinja2 import Environment, FileSystemLoader with support.import_scripts(): diff --git a/tests/test_repositories.py b/tests/test_repositories.py index a95ebe816..ac09c259b 100644 --- a/tests/test_repositories.py +++ b/tests/test_repositories.py @@ -1,9 +1,9 @@ -import unittest -import support -import tempfile import shutil - +import tempfile +import unittest from pathlib import Path + +import support from git import Repo with support.import_scripts(): diff --git a/tests/test_translated_names.py b/tests/test_translated_names.py index 0c2fb1e12..7ae86fe11 100644 --- a/tests/test_translated_names.py +++ b/tests/test_translated_names.py @@ -1,6 +1,6 @@ import unittest -import support +import support from urllib3 import PoolManager with support.import_scripts(): diff --git a/translated_names.py b/translated_names.py index b0b15953b..a9726d93f 100644 --- a/translated_names.py +++ b/translated_names.py @@ -1,6 +1,6 @@ -import tomllib from collections.abc import Iterator +import tomllib from babel import Locale from babel.core import UnknownLocaleError from urllib3 import PoolManager From 565a8f3a13f09c6a852e7a50f5bf56aa189f1abd Mon Sep 17 00:00:00 2001 From: Maciej Olko Date: Fri, 16 Oct 2026 01:02:15 +0200 Subject: [PATCH 3/7] Apply ruff unsafe fixes, fix broad exception handling and default logger usage --- generate.py | 9 +++++---- generate_build_details.py | 9 +++++---- sphinx_lint.py | 4 +--- tests/test_contribute.py | 2 +- tests/test_repositories.py | 2 +- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/generate.py b/generate.py index 20b571c4e..23a751dcd 100644 --- a/generate.py +++ b/generate.py @@ -7,7 +7,7 @@ import subprocess from collections.abc import Iterator from dataclasses import asdict, dataclass -from datetime import datetime, timezone +from datetime import UTC, datetime from pathlib import Path from git import Repo @@ -19,7 +19,8 @@ from completion import branches_from_peps, get_completion, release_cycle_from_peps from repositories import Language, get_languages_and_repos -generation_time = datetime.now(timezone.utc) +logger = logging.getLogger('pydocs-translation-dashboard') +generation_time = datetime.now(UTC) def get_completion_progress() -> Iterator[LanguageProjectData]: @@ -111,7 +112,7 @@ def completion_score(self) -> float: if __name__ == '__main__': logging.basicConfig(level=logging.INFO) - logging.info(f'starting at {generation_time}') + logger.info('starting at %s', generation_time) Path('build').mkdir(parents=True, exist_ok=True) completion_progress = list(get_completion_progress()) @@ -123,7 +124,7 @@ def completion_score(self) -> float: python_version=python_version, release_cycle_status=release_cycle_from_peps()[python_version]['status'], generation_time=generation_time, - duration=(datetime.now(timezone.utc) - generation_time).seconds, + duration=(datetime.now(UTC) - generation_time).seconds, ) Path('build/style.css').write_bytes(Path('src/style.css').read_bytes()) diff --git a/generate_build_details.py b/generate_build_details.py index c9d8054db..075cc7c08 100644 --- a/generate_build_details.py +++ b/generate_build_details.py @@ -2,7 +2,7 @@ import itertools import logging from collections.abc import Iterator, Sequence -from datetime import datetime, timezone +from datetime import UTC, datetime from json import loads from pathlib import Path from sys import argv @@ -17,7 +17,8 @@ from generate import LanguageProjectData from repositories import Language -generation_time = datetime.now(timezone.utc) +logger = logging.getLogger('pydocs-translation-dashboard') +generation_time = datetime.now(UTC) def get_projects_build_details( @@ -54,7 +55,7 @@ def get_language_repo_and_completion( if __name__ == '__main__': logging.basicConfig(level=logging.INFO) - logging.info(f'starting at {generation_time}') + logger.info('starting at %s', generation_time) env = Environment(loader=FileSystemLoader('templates')) if (index_path := Path('build/index.json')).exists(): index_json = loads(Path('build/index.json').read_text()) @@ -70,7 +71,7 @@ def get_language_repo_and_completion( completion_progress, get_projects_build_details(completion_progress) ), generation_time=generation_time, - duration=(datetime.now(timezone.utc) - generation_time).seconds, + duration=(datetime.now(UTC) - generation_time).seconds, ) Path('build/build-details.html').write_text(output) diff --git a/sphinx_lint.py b/sphinx_lint.py index 76d1bc242..9c11b0563 100644 --- a/sphinx_lint.py +++ b/sphinx_lint.py @@ -8,9 +8,7 @@ def store_and_count_failures(clones_dir: str, repo: str, language_code: str) -> int: failed_checks = list(chain.from_iterable(yield_failures(clones_dir, repo))) prefix = f'{Path(clones_dir, "rebased_translations", repo)}/' - log = '\n'.join( - map(lambda check: check.removeprefix(prefix), map(str, failed_checks)) - ) + log = '\n'.join(check.removeprefix(prefix) for check in map(str, failed_checks)) filepath = Path(f'build/warnings-lint-{language_code}.txt') filepath.write_text(log) return len(failed_checks) diff --git a/tests/test_contribute.py b/tests/test_contribute.py index 32d1dfd11..6f99cafa8 100644 --- a/tests/test_contribute.py +++ b/tests/test_contribute.py @@ -43,7 +43,7 @@ def test_links_are_valid(self): if isinstance(e.reason, urllib3.exceptions.ReadTimeoutError): self.skipTest(f'{link}: read timeout, skipping slow server') self.fail(f'{link}: {e}') - except Exception as e: + except urllib3.exceptions.HTTPError as e: self.fail(f'{link}: {e}') diff --git a/tests/test_repositories.py b/tests/test_repositories.py index ac09c259b..1d5233dfc 100644 --- a/tests/test_repositories.py +++ b/tests/test_repositories.py @@ -31,7 +31,7 @@ def test_get_languages_and_repos(self): result = list(repositories.get_languages_and_repos(self.test_repo_path)) for entry in result: - info, repo = entry + info, _repo = entry self.assertIsInstance(info, Language) self.assertIn( From 0159157c3e4dececfc858670ebf8d3cd931bd517 Mon Sep 17 00:00:00 2001 From: Maciej Olko Date: Fri, 16 Oct 2026 01:08:53 +0200 Subject: [PATCH 4/7] Bump ruff pre-commit version to omit 0.16.10 failures --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 6c733b6f9..14e82e1f6 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/astral-sh/ruff-pre-commit - rev: f12be1ebaa5351c1fc76472de98db2c3446c8253 # frozen: v0.16.10 + rev: 38bfb07c0c64c304f47eb52090f8288150c77730 # frozen: v0.17.1 hooks: - id: ruff-check args: [--fix, --exit-non-zero-on-fix] From fbf31b15f07f9251a4c17d5f2164f874376fa808 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Thu, 15 Oct 2026 23:09:34 +0000 Subject: [PATCH 5/7] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- translated_names.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/translated_names.py b/translated_names.py index a9726d93f..b0b15953b 100644 --- a/translated_names.py +++ b/translated_names.py @@ -1,6 +1,6 @@ +import tomllib from collections.abc import Iterator -import tomllib from babel import Locale from babel.core import UnknownLocaleError from urllib3 import PoolManager From 13000937910a4482a62baa2ce43aebc2b8da9dbe Mon Sep 17 00:00:00 2001 From: Maciej Olko Date: Fri, 16 Oct 2026 01:12:09 +0200 Subject: [PATCH 6/7] Bump djLint pre-commit version to ensure latest checks --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 14e82e1f6..ddc43b9cb 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -47,7 +47,7 @@ repos: args: [".", "--per-rule-ignores", "DEP002=python-docs-theme", "--package-module-name-map", "gitpython=git,sphinx-lint=sphinxlint"] - repo: https://github.com/djlint/djLint - rev: 97266b950ee135d6ef89c9ace9d88baadced6f67 # frozen: v1.46.4 + rev: 1399b56bfc493191c39ff1a525a8ab9c11201cd3 # frozen: v1.46.6 hooks: - id: djlint-reformat-jinja - id: djlint-jinja From fbcaa7f5219a49717d0ff7c9c4e18c5f4314f636 Mon Sep 17 00:00:00 2001 From: Maciej Olko Date: Fri, 16 Oct 2026 01:25:34 +0200 Subject: [PATCH 7/7] Move progress bar colors and gradient to CSS, ignore djlint inline style rule for width --- src/style.css | 8 ++++++++ templates/progress_bar.html.jinja | 7 ++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/style.css b/src/style.css index 1d562eb8a..59dacbfdd 100644 --- a/src/style.css +++ b/src/style.css @@ -220,6 +220,14 @@ ul.links-row li:not(:first-child)::before { height: 20px; } +.progress-bar.main-bar { + background: linear-gradient( + to left, + #94cf96 var(--progress-change, 0%), + #4caf50 var(--progress-change, 0%) + ); +} + .outer-label { display: none; padding-left: .5em; diff --git a/templates/progress_bar.html.jinja b/templates/progress_bar.html.jinja index 19b94d799..0da5ac140 100644 --- a/templates/progress_bar.html.jinja +++ b/templates/progress_bar.html.jinja @@ -4,11 +4,12 @@ - change: numeric change value (same units as width) or falsy #}
+ {% set relative_change_percent = change * 100 / width if change and width else 0 %} + {# djlint:off H021 #}
+ --progress-change: {{ relative_change_percent }}%"> + {# djlint:on #} {{ kind }}: {{ '{:.2f}%'.format(width) }} {% if change >= 0.01 %} ({{ '{:+.2f}%'.format(change) }})