From dc1b2003b44b9fd831b5870d988e4f0af93b3389 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 26 Aug 2025 15:32:39 +0300 Subject: [PATCH] [pre-commit.ci] pre-commit autoupdate (#12930) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * [pre-commit.ci] pre-commit autoupdate updates: - [github.com/astral-sh/ruff-pre-commit: v0.12.9 → v0.12.10](https://github.com/astral-sh/ruff-pre-commit/compare/v0.12.9...v0.12.10) - [github.com/pre-commit/mirrors-mypy: v1.15.0 → v1.17.1](https://github.com/pre-commit/mirrors-mypy/compare/v1.15.0...v1.17.1) * Update word_break.py * Update word_break.py * Update word_break.py * Update word_break.py * Update word_break.py * Update covid_stats_via_xpath.py * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Update pyproject.toml * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Update pyproject.toml * Update pyproject.toml * Update covid_stats_via_xpath.py * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Maxim Smolskiy --- .pre-commit-config.yaml | 4 ++-- dynamic_programming/word_break.py | 2 +- web_programming/covid_stats_via_xpath.py | 12 +++++++----- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 252cfebc53a8..6eb0906fb23a 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -16,7 +16,7 @@ repos: - id: auto-walrus - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.12.9 + rev: v0.12.10 hooks: - id: ruff-check - id: ruff-format @@ -47,7 +47,7 @@ repos: - id: validate-pyproject - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.15.0 + rev: v1.17.1 hooks: - id: mypy args: diff --git a/dynamic_programming/word_break.py b/dynamic_programming/word_break.py index 4d7ac869080c..c4ba2d7aa976 100644 --- a/dynamic_programming/word_break.py +++ b/dynamic_programming/word_break.py @@ -90,7 +90,7 @@ def is_breakable(index: int) -> bool: if index == len_string: return True - trie_node = trie + trie_node: Any = trie for i in range(index, len_string): trie_node = trie_node.get(string[i], None) diff --git a/web_programming/covid_stats_via_xpath.py b/web_programming/covid_stats_via_xpath.py index f7db51b63169..9c016ba414ea 100644 --- a/web_programming/covid_stats_via_xpath.py +++ b/web_programming/covid_stats_via_xpath.py @@ -1,5 +1,5 @@ """ -This is to show simple COVID19 info fetching from worldometers site using lxml +This is to show simple COVID19 info fetching from worldometers archive site using lxml * The main motivation to use lxml in place of bs4 is that it is faster and therefore more convenient to use in Python web projects (e.g. Django or Flask-based) """ @@ -19,12 +19,14 @@ class CovidData(NamedTuple): - cases: int - deaths: int - recovered: int + cases: str + deaths: str + recovered: str -def covid_stats(url: str = "https://www.worldometers.info/coronavirus/") -> CovidData: +def covid_stats( + url: str = "https://web.archive.org/web/20250825095350/https://www.worldometers.info/coronavirus/", +) -> CovidData: xpath_str = '//div[@class = "maincounter-number"]/span/text()' return CovidData( *html.fromstring(httpx.get(url, timeout=10).content).xpath(xpath_str)