Skip to content

Commit b0434cb

Browse files
committed
feat: Ensure we have real Python 3.9 to 3.13 compatibility
1 parent 0fe2aeb commit b0434cb

File tree

4 files changed

+22
-6
lines changed

4 files changed

+22
-6
lines changed

pyproject.toml

+14
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,20 @@ dev = [
2929
"tox>=4.23.2",
3030
]
3131

32+
[tool.ruff]
33+
line-length = 115
34+
target-version = "py39"
35+
output-format = "grouped"
36+
37+
[tool.ruff.lint]
38+
select = ["F","E","W","C","I","N","UP","ANN","S","B","A","COM","C4","T20","PT","ARG","TD","RUF"]
39+
ignore = ["A001","A002","A003","ANN401","C901","N8","B008","F405","F821"]
40+
41+
[tool.ruff.lint.per-file-ignores]
42+
"__init__.py" = ["F401"]
43+
"conftest.py" = ["S101","ANN","F401"]
44+
"test_*.py" = ["S101","ANN","F401"]
45+
3246
[build-system]
3347
requires = ["hatchling"]
3448
build-backend = "hatchling.build"

tests/test_generic_arguments.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,13 @@ def test_plain_generic():
3535
def test_plain_generic_raises_exception_if_not_typed():
3636
assert PlainGeneric.__typing_arguments__ == {}
3737
with pytest.raises(TypeError):
38-
PlainGeneric.t1
38+
PlainGeneric.t1 # noqa: B018
3939
with pytest.raises(TypeError):
40-
PlainGeneric.t2
40+
PlainGeneric.t2 # noqa: B018
4141
with pytest.raises(TypeError):
42-
PlainGeneric().t1
42+
PlainGeneric().t1 # noqa: B018
4343
with pytest.raises(TypeError):
44-
PlainGeneric().t2
44+
PlainGeneric().t2 # noqa: B018
4545

4646

4747
def test_plain_generic_raises_exception_if_base_class_is_not_generic():
@@ -83,7 +83,7 @@ class Something(Generic[T1]):
8383
t1 = typing_arg(T1)
8484

8585
with pytest.raises(TypeError):
86-
Something[str].t1
86+
Something[str].t1 # noqa: B018
8787

8888

8989
def test_plain_generic_child():

typing_arguments/__init__.py

+2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
from typing_arguments.generic_arguments import (
22
GenericArgumentsMixin as GenericArgumentsMixin,
3+
)
4+
from typing_arguments.generic_arguments import (
35
typing_arg as typing_arg,
46
)

typing_arguments/generic_arguments.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ def __init_subclass__(cls, *args: Any, **kwargs: Any) -> None:
208208
)
209209

210210

211-
class typing_arg: # noqa
211+
class typing_arg:
212212
__slots__ = ("type_argument",)
213213

214214
def __init__(self, type_argument: TypeVar, /) -> None:

0 commit comments

Comments
 (0)