Skip to content

Commit

Permalink
ignore PLC0105 as well
Browse files Browse the repository at this point in the history
  • Loading branch information
bellini666 committed Jan 4, 2025
1 parent 819706c commit 28a6ecb
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,9 @@ ignore = [
"PLR0912",
"PLR0911",

# Do not force adding _co to covariant typevars
"PLC0105",

# Allow private access to attributes
"SLF001",

Expand Down
2 changes: 1 addition & 1 deletion strawberry/http/typevars.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from typing_extensions import TypeVar

Request = TypeVar("Request", contravariant=True) # noqa: PLC0105
Request = TypeVar("Request", contravariant=True)
Response = TypeVar("Response")
SubResponse = TypeVar("SubResponse")
WebSocketRequest = TypeVar("WebSocketRequest")
Expand Down
2 changes: 1 addition & 1 deletion strawberry/schema/schema_converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
from strawberry.types.scalar import ScalarDefinition


FieldType = TypeVar( # noqa: PLC0105
FieldType = TypeVar(
"FieldType",
bound=Union[GraphQLField, GraphQLInputField],
covariant=True,
Expand Down
6 changes: 3 additions & 3 deletions tests/experimental/pydantic/test_conversion.py
Original file line number Diff line number Diff line change
Expand Up @@ -1257,10 +1257,10 @@ class User:
assert user == User(work=[Work(name="developer"), Work(name="tester")])


SI_co = TypeVar("SI_co", covariant=True) # pragma: no mutate
SI = TypeVar("SI", covariant=True) # pragma: no mutate


class SpecialList(list[SI_co]):
class SpecialList(list[SI]):
pass


Expand All @@ -1269,7 +1269,7 @@ def test_can_convert_pydantic_type_to_strawberry_with_specialized_list():
class WorkModel(BaseModel):
name: str

class WorkList(SpecialList[SI_co]):
class WorkList(SpecialList[SI]):
min_items = 1

class UserModel(BaseModel):
Expand Down

0 comments on commit 28a6ecb

Please sign in to comment.