Skip to content

Commit d966080

Browse files
DEV: Upgrade to ruff 0.10.0 (#3191)
1 parent 493cb6b commit d966080

File tree

4 files changed

+8
-7
lines changed

4 files changed

+8
-7
lines changed

pypdf/_cmap.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ def build_char_map_from_dict(
7373
unknown_char_map: Tuple[str, float, Union[str, Dict[int, str]], Dict[Any, Any]] = (
7474
"Unknown",
7575
9999,
76-
{key: "�" for key in range(256)},
76+
dict.fromkeys(range(256), "�"),
7777
{},
7878
)
7979

pypdf/_text_extraction/_layout_mode/_font_widths.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -195,13 +195,13 @@
195195
"~": 469,
196196
},
197197
}
198+
199+
# 4 fonts, includes bold, oblique and bold oblique variants
198200
STANDARD_WIDTHS[
199201
"Courier"
200-
] = { # 4 fonts, includes bold, oblique and boldoblique variants
201-
c: 600 for c in STANDARD_WIDTHS["Times"] # fixed width
202-
}
203-
STANDARD_WIDTHS["ZapfDingbats"] = {c: 1000 for c in STANDARD_WIDTHS["Times"]} # 1 font
204-
STANDARD_WIDTHS["Symbol"] = {c: 500 for c in STANDARD_WIDTHS["Times"]} # 1 font
202+
] = dict.fromkeys(STANDARD_WIDTHS["Times"], 600) # fixed width
203+
STANDARD_WIDTHS["ZapfDingbats"] = dict.fromkeys(STANDARD_WIDTHS["Times"], 1000) # 1 font
204+
STANDARD_WIDTHS["Symbol"] = dict.fromkeys(STANDARD_WIDTHS["Times"], 500) # 1 font
205205
# add aliases per table H.3 on page 1110 of the PDF 1.7 standard
206206
STANDARD_WIDTHS["CourierNew"] = STANDARD_WIDTHS["Courier"]
207207
STANDARD_WIDTHS["Arial"] = STANDARD_WIDTHS["Helvetica"]

pyproject.toml

+1
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,7 @@ ignore = [
189189
"SIM105", # contextlib.suppress
190190
"SIM108", # Don't enforce ternary operators
191191
"SLF001", # Private member accessed
192+
"TC006", # To discuss: Add quotes to type expression in `typing.cast()`
192193
"TD002", # Authors of TODOs can be found via git
193194
"TD003", # For the moment, fix it later: Missing issue link on the line following this TODO
194195
"TD005", # Missing issue description after `TODO`

requirements/ci-3.11.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ pytest-xdist==3.6.1
6060
# via -r requirements/ci.in
6161
pyyaml==6.0.2
6262
# via -r requirements/ci.in
63-
ruff==0.9.4
63+
ruff==0.10.0
6464
# via -r requirements/ci.in
6565
tomli==2.0.2
6666
# via

0 commit comments

Comments
 (0)