Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix some typing issues revealed with latest BS4 #279

Merged
merged 1 commit into from
Feb 19, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions docs/src/markdown/about/changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 2.6.1

- **FIX**: Typing fixes.

## 2.6

- **NEW**: Add official support for Python 3.13.
Expand Down
4 changes: 3 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,9 @@ lint.ignore = [
"RUF012",
"RUF005",
"PGH004",
"RUF100"
"RUF100",
"RUF022",
"RUF023"
]

[tool.tox]
Expand Down
6 changes: 3 additions & 3 deletions soupsieve/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
from . import css_match as cm
from . import css_types as ct
from .util import DEBUG, SelectorSyntaxError # noqa: F401
import bs4 # type: ignore[import-untyped]
import bs4
from typing import Any, Iterator, Iterable

__all__ = (
Expand Down Expand Up @@ -84,7 +84,7 @@ def closest(
*,
custom: dict[str, str] | None = None,
**kwargs: Any
) -> bs4.Tag:
) -> bs4.Tag | None:
"""Match closest ancestor."""

return compile(select, namespaces, flags, **kwargs).closest(tag)
Expand Down Expand Up @@ -126,7 +126,7 @@ def select_one(
*,
custom: dict[str, str] | None = None,
**kwargs: Any
) -> bs4.Tag:
) -> bs4.Tag | None:
"""Select a single tag."""

return compile(select, namespaces, flags, **kwargs).select_one(tag)
Expand Down
2 changes: 1 addition & 1 deletion soupsieve/__meta__.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,5 +193,5 @@ def parse_version(ver: str) -> Version:
return Version(major, minor, micro, release, pre, post, dev)


__version_info__ = Version(2, 6, 0, "final")
__version_info__ = Version(2, 6, 1, "final")
__version__ = __version_info__._get_canonical()
Loading
Loading