Skip to content

Commit 2aba49e

Browse files
committed
Bump tools.
1 parent d5755ee commit 2aba49e

5 files changed

Lines changed: 11 additions & 16 deletions

File tree

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
exclude: tests/test_data
22
repos:
33
- repo: https://github.com/astral-sh/ruff-pre-commit
4-
rev: v0.12.5
4+
rev: v0.14.4
55
hooks:
66
- id: ruff-check
77
args: [ --fix ]
88
- id: ruff-format
99
- repo: https://github.com/pre-commit/pre-commit-hooks
10-
rev: v5.0.0
10+
rev: v6.0.0
1111
hooks:
1212
- id: end-of-file-fixer
1313
- id: trailing-whitespace

pyproject.toml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,8 @@ regex = true
6464
[tool.coverage.run]
6565
branch = true
6666

67-
[tool.coverage.report]
68-
exclude_also = [
69-
"if TYPE_CHECKING:",
70-
]
67+
[tool.mypy]
68+
strict = true
7169

7270
[[tool.mypy.overrides]]
7371
module = "tests.*"

src/protego/_utils.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,7 @@ def _unquote(url: str, ignore: str = "", errors: str = "replace") -> str:
4545

4646
def _hexescape(char: str) -> str:
4747
"""Escape char as RFC 2396 specifies"""
48-
hex_repr = hex(ord(char))[2:].upper()
49-
if len(hex_repr) == 1:
50-
hex_repr = f"0{hex_repr}"
51-
return f"%{hex_repr}"
48+
return f"%{ord(char):02X}"
5249

5350

5451
def _quote_path(path: str) -> str:

tests/test_protego.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1012,7 +1012,7 @@ def test_disallow_target_url_path_is_missing(self):
10121012

10131013
def test_bytestrings(self):
10141014
content = b"User-Agent: FootBot\nDisallow: /something"
1015-
with pytest.raises(ValueError, match="Protego.parse expects str, got bytes"):
1015+
with pytest.raises(ValueError, match=r"Protego\.parse expects str, got bytes"):
10161016
Protego.parse(content=content) # type: ignore[arg-type]
10171017

10181018
def test_leading_double_slash_in_pattern(self):

tox.ini

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ envlist = py
44
[testenv]
55
deps =
66
pytest
7-
pytest-cov
7+
pytest-cov >= 7.0.0
88
commands =
99
pytest --cov=protego --cov-report=xml --cov-report= {posargs:tests}
1010

@@ -16,17 +16,17 @@ skip_install = true
1616
[testenv:twinecheck]
1717
basepython = python3
1818
deps =
19-
twine==6.1.0
20-
build==1.2.2.post1
19+
twine==6.2.0
20+
build==1.3.0
2121
commands =
2222
python -m build --sdist
2323
twine check dist/*
2424

2525
[testenv:typing]
2626
basepython = python3
2727
deps =
28-
mypy==1.17.0
28+
mypy==1.18.2
2929
pytest
3030
scrapy==2.13.3
3131
commands =
32-
mypy --strict {posargs: src tests}
32+
mypy {posargs: src tests}

0 commit comments

Comments
 (0)