diff --git a/doc/whatsnew/fragments/10703.false_positive b/doc/whatsnew/fragments/10703.false_positive new file mode 100644 index 0000000000..304947d06e --- /dev/null +++ b/doc/whatsnew/fragments/10703.false_positive @@ -0,0 +1,4 @@ +Fix a false positive for ``unexpected-keyword-arg`` for dataclasses +using generic type aliases (PEP 695). + +Closes #10703 diff --git a/doc/whatsnew/fragments/10788.false_positive b/doc/whatsnew/fragments/10788.false_positive new file mode 100644 index 0000000000..87e5ec3a4a --- /dev/null +++ b/doc/whatsnew/fragments/10788.false_positive @@ -0,0 +1,4 @@ +Fix a false positive for ``too-many-function-args`` for dataclasses +using generic type aliases (PEP 695). + +Closes #10788 diff --git a/pyproject.toml b/pyproject.toml index ba9ac58081..23052cb0b0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -37,10 +37,10 @@ dynamic = [ "version" ] # All the dependencies of the project will be configured here, once pip fully supports PEP735 # TODO: Remove all requirements.txt files and use this section instead once pip supports PEP735 dependencies = [ - # Also upgrade requirements_test_min.txt. + # Also upgrade test-min dependency group and requirements_test_min.txt. # Pinned to dev of second minor update to allow editable installs and fix primer issues, # see https://github.com/pylint-dev/astroid/issues/1341 - "astroid>=4.0.2,<=4.1.dev0", + "astroid>=4.0.3,<=4.1.dev0", "colorama>=0.4.5; sys_platform=='win32'", "dill>=0.2; python_version<'3.11'", "dill>=0.3.6; python_version>='3.11'", @@ -94,7 +94,7 @@ docs = [ # Configuration for the build system test-min = [ # Base test dependencies - "astroid==4.0.2", # Pinned to a specific version for tests + "astroid==4.0.3", # Pinned to a specific version for tests "py~=1.11.0", "pytest>=8.4,<10", "pytest-benchmark~=5.1", diff --git a/requirements_test_min.txt b/requirements_test_min.txt index cffbec4f37..ed3a11bd6e 100644 --- a/requirements_test_min.txt +++ b/requirements_test_min.txt @@ -1,6 +1,6 @@ .[testutils,spelling] # astroid dependency is also defined in pyproject.toml -astroid==4.0.2 # Pinned to a specific version for tests +astroid==4.0.3 # Pinned to a specific version for tests typing-extensions~=4.15 py~=1.11.0 pytest>=8.4,<10.0 diff --git a/tests/functional/d/dataclass/dataclass_py312.py b/tests/functional/d/dataclass/dataclass_py312.py new file mode 100644 index 0000000000..967871c62d --- /dev/null +++ b/tests/functional/d/dataclass/dataclass_py312.py @@ -0,0 +1,29 @@ +# pylint: disable=missing-class-docstring +"""Dataclasses using PEP 695 syntax.""" +import dataclasses + + +@dataclasses.dataclass +class B[X]: + x: X + + +@dataclasses.dataclass +class C(B[int]): + pass + + +C(x=0) + + +@dataclasses.dataclass +class One[T]: + one: T + + +@dataclasses.dataclass +class Two[T](One[T]): + two: T + +one = One(1) +two = Two(1, 2) diff --git a/tests/functional/d/dataclass/dataclass_py312.rc b/tests/functional/d/dataclass/dataclass_py312.rc new file mode 100644 index 0000000000..e9ecd19d69 --- /dev/null +++ b/tests/functional/d/dataclass/dataclass_py312.rc @@ -0,0 +1,2 @@ +[testoptions] +min_pyver = 3.12