Skip to content

Commit 8b85fc9

Browse files
committed
Move tool configs into pyproject.toml.
1 parent a10c020 commit 8b85fc9

File tree

9 files changed

+71
-59
lines changed

9 files changed

+71
-59
lines changed

.bumpversion.cfg

Lines changed: 0 additions & 11 deletions
This file was deleted.

.coveragerc

Lines changed: 0 additions & 7 deletions
This file was deleted.

mypy.ini

Lines changed: 0 additions & 11 deletions
This file was deleted.

pylintrc

Lines changed: 0 additions & 23 deletions
This file was deleted.

pyproject.toml

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,68 @@
1+
[tool.bumpversion]
2+
current_version = "2.3.1"
3+
commit = true
4+
tag = true
5+
tag_name = "v{new_version}"
6+
7+
[[tool.bumpversion.files]]
8+
filename = "setup.py"
9+
10+
[[tool.bumpversion.files]]
11+
filename = "w3lib/__init__.py"
12+
13+
[[tool.bumpversion.files]]
14+
filename = "docs/conf.py"
15+
16+
[tool.coverage.run]
17+
branch = true
18+
include = ["w3lib/*"]
19+
20+
[tool.coverage.report]
21+
exclude_also = [
22+
"if TYPE_CHECKING:",
23+
]
24+
25+
[tool.mypy]
26+
check_untyped_defs = true
27+
28+
[[tool.mypy.overrides]]
29+
# All non-tests functions must be typed.
30+
module = "w3lib.*"
31+
disallow_untyped_defs = true
32+
33+
[[tool.mypy.overrides]]
34+
# Allow test functions to be untyped
35+
module = "tests.*"
36+
disallow_untyped_defs = false
37+
38+
[tool.pylint.MASTER]
39+
persistent = "no"
40+
41+
[tool.pylint."MESSAGES CONTROL"]
42+
enable = [
43+
"useless-suppression",
44+
]
45+
disable = [
46+
"fixme",
47+
"import-error",
48+
"import-outside-toplevel",
49+
"invalid-name",
50+
"line-too-long",
51+
"missing-class-docstring",
52+
"missing-function-docstring",
53+
"missing-module-docstring",
54+
"raise-missing-from",
55+
"redefined-builtin",
56+
"redefined-outer-name",
57+
"too-many-arguments",
58+
"too-many-branches",
59+
"too-many-lines",
60+
"too-many-positional-arguments",
61+
"too-many-public-methods",
62+
"unused-argument",
63+
"unused-variable",
64+
]
65+
166
[tool.ruff.lint]
267
extend-select = [
368
# flake8-bugbear

pytest.ini

Lines changed: 0 additions & 2 deletions
This file was deleted.

tox.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ envlist = py39, py310, py311, py312, py313, pypy3.10, docs, pylint, typing, pre-
88

99
[testenv]
1010
deps =
11+
coverage >= 7.2.0
1112
pytest !=3.1.1, !=3.1.2
1213
pytest-cov
1314
commands =

w3lib/encoding.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -177,13 +177,13 @@ def read_bom(data: bytes) -> tuple[None, None] | tuple[str, bytes]:
177177
178178
>>> import w3lib.encoding
179179
>>> w3lib.encoding.read_bom(b'\xfe\xff\x6c\x34')
180-
('utf-16-be', '\xfe\xff')
180+
('utf-16-be', b'\xfe\xff')
181181
>>> w3lib.encoding.read_bom(b'\xff\xfe\x34\x6c')
182-
('utf-16-le', '\xff\xfe')
182+
('utf-16-le', b'\xff\xfe')
183183
>>> w3lib.encoding.read_bom(b'\x00\x00\xfe\xff\x00\x00\x6c\x34')
184-
('utf-32-be', '\x00\x00\xfe\xff')
184+
('utf-32-be', b'\x00\x00\xfe\xff')
185185
>>> w3lib.encoding.read_bom(b'\xff\xfe\x00\x00\x34\x6c\x00\x00')
186-
('utf-32-le', '\xff\xfe\x00\x00')
186+
('utf-32-le', b'\xff\xfe\x00\x00')
187187
>>> w3lib.encoding.read_bom(b'\x01\x02\x03\x04')
188188
(None, None)
189189
>>>

w3lib/http.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ def basic_auth_header(
110110
111111
>>> import w3lib.http
112112
>>> w3lib.http.basic_auth_header('someuser', 'somepass')
113-
'Basic c29tZXVzZXI6c29tZXBhc3M='
113+
b'Basic c29tZXVzZXI6c29tZXBhc3M='
114114
115115
.. _HTTP Basic Access Authentication (RFC 2617): http://www.ietf.org/rfc/rfc2617.txt
116116

0 commit comments

Comments
 (0)