Skip to content

Commit dc1b200

Browse files
[pre-commit.ci] pre-commit autoupdate (TheAlgorithms#12930)
* [pre-commit.ci] pre-commit autoupdate updates: - [github.com/astral-sh/ruff-pre-commit: v0.12.9 → v0.12.10](astral-sh/ruff-pre-commit@v0.12.9...v0.12.10) - [github.com/pre-commit/mirrors-mypy: v1.15.0 → v1.17.1](pre-commit/mirrors-mypy@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 <mithridatus@mail.ru>
1 parent 8c1c6c1 commit dc1b200

File tree

3 files changed

+10
-8
lines changed

3 files changed

+10
-8
lines changed

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ repos:
1616
- id: auto-walrus
1717

1818
- repo: https://github.com/astral-sh/ruff-pre-commit
19-
rev: v0.12.9
19+
rev: v0.12.10
2020
hooks:
2121
- id: ruff-check
2222
- id: ruff-format
@@ -47,7 +47,7 @@ repos:
4747
- id: validate-pyproject
4848

4949
- repo: https://github.com/pre-commit/mirrors-mypy
50-
rev: v1.15.0
50+
rev: v1.17.1
5151
hooks:
5252
- id: mypy
5353
args:

dynamic_programming/word_break.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ def is_breakable(index: int) -> bool:
9090
if index == len_string:
9191
return True
9292

93-
trie_node = trie
93+
trie_node: Any = trie
9494
for i in range(index, len_string):
9595
trie_node = trie_node.get(string[i], None)
9696

web_programming/covid_stats_via_xpath.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
"""
2-
This is to show simple COVID19 info fetching from worldometers site using lxml
2+
This is to show simple COVID19 info fetching from worldometers archive site using lxml
33
* The main motivation to use lxml in place of bs4 is that it is faster and therefore
44
more convenient to use in Python web projects (e.g. Django or Flask-based)
55
"""
@@ -19,12 +19,14 @@
1919

2020

2121
class CovidData(NamedTuple):
22-
cases: int
23-
deaths: int
24-
recovered: int
22+
cases: str
23+
deaths: str
24+
recovered: str
2525

2626

27-
def covid_stats(url: str = "https://www.worldometers.info/coronavirus/") -> CovidData:
27+
def covid_stats(
28+
url: str = "https://web.archive.org/web/20250825095350/https://www.worldometers.info/coronavirus/",
29+
) -> CovidData:
2830
xpath_str = '//div[@class = "maincounter-number"]/span/text()'
2931
return CovidData(
3032
*html.fromstring(httpx.get(url, timeout=10).content).xpath(xpath_str)

0 commit comments

Comments
 (0)