Skip to content

Commit 7cd49b4

Browse files
committed
Fix some typing issues revealed with latest BS4
Fixes #278
1 parent 6470b9d commit 7cd49b4

File tree

5 files changed

+239
-170
lines changed

5 files changed

+239
-170
lines changed

docs/src/markdown/about/changelog.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog
22

3+
## 2.6.1
4+
5+
- **FIX**: Typing fixes.
6+
37
## 2.6
48

59
- **NEW**: Add official support for Python 3.13.

pyproject.toml

+3-1
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,9 @@ lint.ignore = [
9999
"RUF012",
100100
"RUF005",
101101
"PGH004",
102-
"RUF100"
102+
"RUF100",
103+
"RUF022",
104+
"RUF023"
103105
]
104106

105107
[tool.tox]

soupsieve/__init__.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
from . import css_match as cm
3232
from . import css_types as ct
3333
from .util import DEBUG, SelectorSyntaxError # noqa: F401
34-
import bs4 # type: ignore[import-untyped]
34+
import bs4
3535
from typing import Any, Iterator, Iterable
3636

3737
__all__ = (
@@ -84,7 +84,7 @@ def closest(
8484
*,
8585
custom: dict[str, str] | None = None,
8686
**kwargs: Any
87-
) -> bs4.Tag:
87+
) -> bs4.Tag | None:
8888
"""Match closest ancestor."""
8989

9090
return compile(select, namespaces, flags, **kwargs).closest(tag)
@@ -126,7 +126,7 @@ def select_one(
126126
*,
127127
custom: dict[str, str] | None = None,
128128
**kwargs: Any
129-
) -> bs4.Tag:
129+
) -> bs4.Tag | None:
130130
"""Select a single tag."""
131131

132132
return compile(select, namespaces, flags, **kwargs).select_one(tag)

soupsieve/__meta__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -193,5 +193,5 @@ def parse_version(ver: str) -> Version:
193193
return Version(major, minor, micro, release, pre, post, dev)
194194

195195

196-
__version_info__ = Version(2, 6, 0, "final")
196+
__version_info__ = Version(2, 6, 1, "final")
197197
__version__ = __version_info__._get_canonical()

0 commit comments

Comments
 (0)