Skip to content

Commit 271945b

Browse files
authored
MAINT: Update packages + ruff (#2006)
1 parent dcf997a commit 271945b

File tree

9 files changed

+36
-34
lines changed

9 files changed

+36
-34
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ repos:
3333
additional_dependencies: [black==22.1.0]
3434
exclude: "docs/user/robustness.md"
3535
- repo: https://github.com/charliermarsh/ruff-pre-commit
36-
rev: 'v0.0.278'
36+
rev: 'v0.0.280'
3737
hooks:
3838
- id: ruff
3939
args: ['--fix']

pypdf/_writer.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2905,7 +2905,7 @@ def merge(
29052905
) # need for the outline processing below
29062906
for dest in reader._namedDests.values():
29072907
arr = dest.dest_array
2908-
if "/Names" in self._root_object and dest["/Title"] in cast( # noqa: SIM114
2908+
if "/Names" in self._root_object and dest["/Title"] in cast(
29092909
list,
29102910
cast(
29112911
DictionaryObject,
@@ -2940,7 +2940,7 @@ def merge(
29402940
"TreeObject",
29412941
self.add_outline_item(
29422942
TextStringObject(outline_item),
2943-
list(srcpages.values())[0].indirect_reference,
2943+
next(iter(srcpages.values())).indirect_reference,
29442944
fit=PAGE_FIT,
29452945
).get_object(),
29462946
)

pypdf/generic/_data_structures.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -259,10 +259,10 @@ def _clone(
259259
== cast(DictionaryObject, src[k]).get("/Type", None)
260260
)
261261
):
262-
cur_obj: Optional["DictionaryObject"] = cast(
262+
cur_obj: Optional[DictionaryObject] = cast(
263263
"DictionaryObject", src[k]
264264
)
265-
prev_obj: Optional["DictionaryObject"] = self
265+
prev_obj: Optional[DictionaryObject] = self
266266
while cur_obj is not None:
267267
clon = cast(
268268
"DictionaryObject",
@@ -786,7 +786,7 @@ def _reset_node_tree_relationship(child_obj: Any) -> None:
786786
class StreamObject(DictionaryObject):
787787
def __init__(self) -> None:
788788
self.__data: Optional[str] = None
789-
self.decoded_self: Optional["DecodedStreamObject"] = None
789+
self.decoded_self: Optional[DecodedStreamObject] = None
790790

791791
def _clone(
792792
self,
@@ -865,7 +865,7 @@ def initializeFromDictionary(
865865
def initialize_from_dictionary(
866866
data: Dict[str, Any]
867867
) -> Union["EncodedStreamObject", "DecodedStreamObject"]:
868-
retval: Union["EncodedStreamObject", "DecodedStreamObject"]
868+
retval: Union[EncodedStreamObject, DecodedStreamObject]
869869
if SA.FILTER in data:
870870
retval = EncodedStreamObject()
871871
else:
@@ -931,7 +931,7 @@ def setData(self, data: Any) -> None: # deprecated
931931

932932
class EncodedStreamObject(StreamObject):
933933
def __init__(self) -> None:
934-
self.decoded_self: Optional["DecodedStreamObject"] = None
934+
self.decoded_self: Optional[DecodedStreamObject] = None
935935

936936
@property
937937
def decodedSelf(self) -> Optional["DecodedStreamObject"]: # deprecated

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ ignore = [
120120
"DTZ001", # The use of `datetime.datetime()` without `tzinfo` is necessary
121121
"PLC",
122122
# Personal preference
123+
"PLR1714", # Consider merging multiple comparisons
123124
"FA100", # Missing `from __future__ import annotations`, but uses `typing.Dict`
124125
"TD002", # Authors of TODOs can be found via git
125126
"FIX002", # TODOs should typically not be in the code, but sometimes are ok

requirements/ci-3.11.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ pytest-socket==0.6.0
6161
# via -r requirements/ci.in
6262
pytest-timeout==2.1.0
6363
# via -r requirements/ci.in
64-
ruff==0.0.278
64+
ruff==0.0.280
6565
# via -r requirements/ci.in
6666
typeguard==3.0.2
6767
# via -r requirements/ci.in

requirements/ci.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ pycryptodome==3.18.0
5959
# via -r requirements/ci.in
6060
pyflakes==2.5.0
6161
# via flake8
62-
pyparsing==3.0.9
62+
pyparsing==3.1.0
6363
# via packaging
6464
pytest==7.0.1
6565
# via
@@ -79,13 +79,13 @@ tomli==1.2.3
7979
# via
8080
# mypy
8181
# pytest
82-
typed-ast==1.5.4
82+
typed-ast==1.5.5
8383
# via mypy
8484
typeguard==2.13.3
8585
# via -r requirements/ci.in
8686
types-dataclasses==0.6.6
8787
# via -r requirements/ci.in
88-
types-pillow==9.5.0.4
88+
types-pillow==10.0.0.2
8989
# via -r requirements/ci.in
9090
typing-extensions==4.1.1
9191
# via

requirements/dev.txt

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,25 +8,25 @@ black==23.3.0
88
# via -r requirements/dev.in
99
build==0.10.0
1010
# via pip-tools
11-
certifi==2023.5.7
11+
certifi==2023.7.22
1212
# via requests
1313
cfgv==3.3.1
1414
# via pre-commit
15-
charset-normalizer==3.1.0
15+
charset-normalizer==3.2.0
1616
# via requests
17-
click==8.1.3
17+
click==8.1.6
1818
# via
1919
# black
2020
# pip-tools
2121
coverage[toml]==7.2.7
2222
# via pytest-cov
23-
distlib==0.3.6
23+
distlib==0.3.7
2424
# via virtualenv
2525
docutils==0.20.1
2626
# via flit
27-
exceptiongroup==1.1.1
27+
exceptiongroup==1.1.2
2828
# via pytest
29-
filelock==3.12.1
29+
filelock==3.12.2
3030
# via virtualenv
3131
flit==3.9.0
3232
# via -r requirements/dev.in
@@ -51,23 +51,23 @@ pathspec==0.11.1
5151
# via black
5252
pillow==9.5.0
5353
# via -r requirements/dev.in
54-
pip-tools==6.13.0
54+
pip-tools==6.14.0
5555
# via -r requirements/dev.in
56-
platformdirs==3.5.3
56+
platformdirs==3.9.1
5757
# via
5858
# black
5959
# virtualenv
60-
pluggy==1.0.0
60+
pluggy==1.2.0
6161
# via pytest
6262
pre-commit==2.17.0
6363
# via -r requirements/dev.in
6464
pyproject-hooks==1.0.0
6565
# via build
66-
pytest==7.3.2
66+
pytest==7.4.0
6767
# via pytest-cov
6868
pytest-cov==4.1.0
6969
# via -r requirements/dev.in
70-
pyyaml==6.0
70+
pyyaml==6.0.1
7171
# via pre-commit
7272
requests==2.31.0
7373
# via flit
@@ -78,16 +78,17 @@ tomli==2.0.1
7878
# black
7979
# build
8080
# coverage
81+
# pip-tools
8182
# pytest
8283
tomli-w==1.0.0
8384
# via flit
84-
typing-extensions==4.6.3
85+
typing-extensions==4.7.1
8586
# via black
86-
urllib3==2.0.3
87+
urllib3==2.0.4
8788
# via requests
88-
virtualenv==20.23.0
89+
virtualenv==20.24.1
8990
# via pre-commit
90-
wheel==0.40.0
91+
wheel==0.41.0
9192
# via
9293
# -r requirements/dev.in
9394
# pip-tools

requirements/docs.txt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ attrs==23.1.0
1010
# via -r requirements/docs.in
1111
babel==2.12.1
1212
# via sphinx
13-
certifi==2023.5.7
13+
certifi==2023.7.22
1414
# via requests
15-
charset-normalizer==3.1.0
15+
charset-normalizer==3.2.0
1616
# via requests
1717
docutils==0.17.1
1818
# via
@@ -23,7 +23,7 @@ idna==3.4
2323
# via requests
2424
imagesize==1.4.1
2525
# via sphinx
26-
importlib-metadata==6.6.0
26+
importlib-metadata==6.7.0
2727
# via
2828
# attrs
2929
# sphinx
@@ -49,7 +49,7 @@ pygments==2.15.1
4949
# via sphinx
5050
pytz==2023.3
5151
# via babel
52-
pyyaml==6.0
52+
pyyaml==6.0.1
5353
# via myst-parser
5454
requests==2.31.0
5555
# via sphinx
@@ -77,11 +77,11 @@ sphinxcontrib-qthelp==1.0.3
7777
# via sphinx
7878
sphinxcontrib-serializinghtml==1.1.5
7979
# via sphinx
80-
typing-extensions==4.6.3
80+
typing-extensions==4.7.1
8181
# via
8282
# importlib-metadata
8383
# markdown-it-py
84-
urllib3==2.0.3
84+
urllib3==2.0.4
8585
# via requests
8686
zipp==3.15.0
8787
# via importlib-metadata

0 commit comments

Comments
 (0)