Skip to content
Open
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
6 changes: 3 additions & 3 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@ jobs:
fail-fast: false
matrix:
include:
- python-version: 3.13
- python-version: 3.14
env:
TOXENV: pylint
- python-version: 3.13 # Keep in sync with .readthedocs.yml
env:
TOXENV: docs
- python-version: 3.13
- python-version: 3.14
env:
TOXENV: typing
- python-version: 3.13
- python-version: 3.14
env:
TOXENV: twinecheck

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: 3.13
python-version: 3.14

- name: Build
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tests-macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13", "3.14.0-rc.2"]
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]

steps:
- uses: actions/checkout@v5
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/tests-ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13", "3.14.0-rc.2", "pypy3.11"]
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14", "pypy3.11"]

steps:
- uses: actions/checkout@v5

- name: Install system libraries
if: contains(matrix.python-version, 'pypy') || contains(matrix.python-version, '3.14.0-rc')
if: contains(matrix.python-version, 'pypy')
run: |
sudo apt-get update
sudo apt-get install libxml2-dev libxslt-dev
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tests-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13", "3.14.0-rc.2"]
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]

steps:
- uses: actions/checkout@v5
Expand Down
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.13.0
rev: v0.14.4
hooks:
- id: ruff-check
args: [ --fix ]
Expand All @@ -10,7 +10,7 @@ repos:
hooks:
- id: blacken-docs
additional_dependencies:
- black==25.1.0
- black==25.9.0
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v6.0.0
hooks:
Expand Down
8 changes: 4 additions & 4 deletions cssselect/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import operator
import re
import sys
from typing import TYPE_CHECKING, Literal, Optional, Protocol, Union, cast, overload
from typing import TYPE_CHECKING, Literal, Protocol, TypeAlias, Union, cast, overload

if TYPE_CHECKING:
from collections.abc import Iterable, Iterator, Sequence
Expand Down Expand Up @@ -46,7 +46,7 @@ class SelectorSyntaxError(SelectorError, SyntaxError):

#### Parsed objects

Tree = Union[
Tree: TypeAlias = Union[
"Element",
"Hash",
"Class",
Expand All @@ -59,7 +59,7 @@ class SelectorSyntaxError(SelectorError, SyntaxError):
"SpecificityAdjustment",
"CombinedSelector",
]
PseudoElement = Union["FunctionalPseudoElement", str]
PseudoElement: TypeAlias = Union["FunctionalPseudoElement", str]


class Selector:
Expand Down Expand Up @@ -831,7 +831,7 @@ def parse_series(tokens: Iterable[Token]) -> tuple[int, int]:
#### Token objects


class Token(tuple[str, Optional[str]]): # noqa: SLOT001
class Token(tuple[str, str | None]): # noqa: SLOT001
@overload
def __new__(
cls,
Expand Down
4 changes: 1 addition & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,11 @@ description = "cssselect parses CSS3 Selectors and translates them to XPath 1.0"
readme = "README.rst"
authors = [{ name = "Ian Bicking", email = "ianb@colorstudy.com" }]
maintainers = [{ name = "Paul Tremberth", email = "paul.tremberth@gmail.com" }]
requires-python = ">=3.9"
requires-python = ">=3.10"
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
Expand Down Expand Up @@ -65,7 +64,6 @@ exclude_also = [
"def __repr__",
"if sys.version_info",
"if __name__ == '__main__':",
"if TYPE_CHECKING:",
]

[tool.pylint.MASTER]
Expand Down
6 changes: 3 additions & 3 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ envlist = pre-commit,pylint,py,docs,typing
[testenv]
deps =
lxml>=4.4
pytest-cov>=2.8
pytest-cov>=7.0.0
pytest>=5.4
sybil
commands =
Expand All @@ -15,7 +15,7 @@ commands =
[testenv:pylint]
deps =
{[testenv]deps}
pylint==3.3.8
pylint==4.0.2
commands =
pylint {posargs: cssselect tests docs}

Expand All @@ -29,7 +29,7 @@ commands =
[testenv:typing]
deps =
{[testenv]deps}
mypy==1.18.1
mypy==1.18.2
types-lxml==2025.8.25
commands =
mypy --strict {posargs: cssselect tests}
Expand Down