Skip to content

Commit cf1c116

Browse files
committed
chore: upgrade dev dependecies
1 parent e0eed6b commit cf1c116

19 files changed

+55
-49
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ For the purpose of determining breaking changes:
2222

2323
- Update license metadata as per [PEP 639](https://peps.python.org/pep-0639)
2424
- Add tests for PyPy 3.11
25+
- Upgrade dev dependencies
2526

2627
## [1.1.0] - 2024-10-10
2728

dev-requirements.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,17 @@
22
-e .
33

44
# build
5-
build==1.2.2
5+
build==1.3.0
66

77
# docs
88
mkdocs==1.6.1
99

1010
# lint
11-
ruff==0.6.9
11+
ruff==0.14.1
1212

1313
# tests
14-
pytest==8.3.3
15-
pytest-cov==5.0.0
14+
pytest==8.4.2
15+
pytest-cov==7.0.0
1616

1717
# type
18-
mypy==1.11.2
18+
mypy==1.18.2

pyproject.toml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ ignore_missing_imports = false
8484
follow_imports = "normal"
8585
mypy_path = "stubs"
8686
# Platform configuration
87-
python_version = 3.13
87+
python_version = "3.13"
8888
# Disallow dynamic typing
8989
disallow_any_unimported = true
9090
disallow_any_decorated = true
@@ -143,8 +143,6 @@ target-version = "py39"
143143
[tool.ruff.lint]
144144
select = ["ALL"]
145145
ignore = [
146-
"ANN101",
147-
"ANN102",
148146
"C901",
149147
"COM812",
150148
"D",

src/bigxml/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99
"HandlerTypeHelper",
1010
"Parser",
1111
"Streamable",
12-
"xml_handle_element",
13-
"xml_handle_text",
1412
"XMLElement",
1513
"XMLElementAttributes",
1614
"XMLText",
15+
"xml_handle_element",
16+
"xml_handle_text",
1717
)

src/bigxml/handle_mgr.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ def iter_from(
100100
],
101101
) -> Iterator[Union["XMLElement", T]]: ...
102102

103-
@overload # type: ignore[misc]
103+
@overload
104104
def iter_from(
105105
self,
106106
*handlers: Any, # noqa: ANN401

src/bigxml/handler_creator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ def handle(
135135
return None
136136

137137
@staticmethod
138-
def _handle_from_class( # type: ignore[misc]
138+
def _handle_from_class(
139139
klass: type[Any], node: Union["XMLElement", "XMLText"]
140140
) -> Optional[Iterable[object]]:
141141
# instantiate class

src/bigxml/handler_marker.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
class ___xml_handle_xxx_wrapped(Protocol[T_co]): # noqa: N801
2020
# wrapper for classes
2121
@overload
22-
def __call__( # type: ignore[misc]
22+
def __call__(
2323
self,
2424
obj: K,
2525
) -> K: ...
@@ -49,22 +49,21 @@ def wrapper(obj: F) -> F:
4949
if isinstance(markable, staticmethod):
5050
# staticmethod(xml_handle_element(...)) works as expected
5151
# xml_handle_element(staticmethod(...)) needs special care
52-
markable = cast(F, markable.__func__)
52+
markable = cast("F", markable.__func__)
5353

5454
add_mark(markable, tuple(args))
5555

5656
return obj
5757

5858
return cast(
59-
___xml_handle_xxx_wrapped[XMLElement],
59+
"___xml_handle_xxx_wrapped[XMLElement]",
6060
wrapper,
6161
)
6262

6363

6464
# @xml_handle_text (for classes)
6565
@overload
66-
def xml_handle_text(obj: K, /) -> K: # type: ignore[misc]
67-
...
66+
def xml_handle_text(obj: K, /) -> K: ...
6867

6968

7069
# @xml_handle_text (for functions)

src/bigxml/stream.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ def _flatten_stream(stream: Streamable) -> Generator[Optional[memoryview], int,
1919
# buffer protocol (bytes, etc.)
2020
try:
2121
# we try-except instead of isinstance(stream, Buffer) for compatibility reasons
22-
yield memoryview(cast(Buffer, stream))
22+
yield memoryview(cast("Buffer", stream))
2323
return # noqa: TRY300
2424
except TypeError:
2525
pass
@@ -28,7 +28,7 @@ def _flatten_stream(stream: Streamable) -> Generator[Optional[memoryview], int,
2828
if hasattr(stream, "read"):
2929
while True:
3030
size = yield None
31-
data = cast(SupportsRead[Any], stream).read(size)
31+
data = cast("SupportsRead[Any]", stream).read(size)
3232
if not data:
3333
break # EOF
3434
try:
@@ -57,7 +57,7 @@ def _flatten_stream(stream: Streamable) -> Generator[Optional[memoryview], int,
5757

5858
# stream iterator (recursive)
5959
try:
60-
substreams = iter(cast(Iterable[Streamable], stream))
60+
substreams = iter(cast("Iterable[Streamable]", stream))
6161
except TypeError:
6262
# other types not supported
6363
raise TypeError(f"Invalid stream type: {type(stream).__name__}") from None

src/bigxml/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ def __next__(self) -> T:
4040
def extract_namespace_name(name: str) -> tuple[str, str]:
4141
match = _EXTRACT_NAMESPACE_REGEX.match(name)
4242
if match:
43-
return cast(tuple[str, str], match.groups())
43+
return cast("tuple[str, str]", match.groups())
4444
return ("", name)
4545

4646

stubs/defusedxml/ElementTree.pyi

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
# ruff: noqa: FBT001
22
# note: only used items are defined here, with used typing
33

4-
from typing import Iterator, Optional, Protocol, Sequence, TypeVar
4+
from collections.abc import Iterator, Sequence
5+
from typing import Optional, Protocol, TypeVar
56
from xml.etree.ElementTree import Element, ParseError
67

78
_T_co = TypeVar("_T_co", covariant=True)
@@ -19,4 +20,4 @@ def iterparse(
1920

2021
class DefusedXmlException(ValueError): ... # noqa: N818
2122

22-
__all__ = ("DefusedXmlException", "Element", "iterparse", "ParseError")
23+
__all__ = ("DefusedXmlException", "Element", "ParseError", "iterparse")

0 commit comments

Comments
 (0)