import os
from typing import List

from setuptools import find_packages, setup


def find_stub_files(name: str) -> List[str]:
    result = []
    for root, _dirs, files in os.walk(name):
        for file in files:
            if file.endswith(".pyi"):
                if os.path.sep in root:
                    sub_root = root.split(os.path.sep, 1)[-1]
                    file = os.path.join(sub_root, file)
                result.append(file)
    return result


with open("README.md") as f:
    readme = f.read()

dependencies = [
    "mypy>=0.980",
    "django",
    "django-stubs-ext>=0.8.0",
    "tomli; python_version < '3.11'",
    # Types:
    "typing-extensions",
    "types-pytz",
    "types-PyYAML",
]

extras_require = {
    "compatible-mypy": ["mypy>=1.1.1,<1.2"],
}

setup(
    name="django-stubs",
    version="1.16.0",
    description="Mypy stubs for Django",
    long_description=readme,
    long_description_content_type="text/markdown",
    license="MIT",
    url="https://github.com/typeddjango/django-stubs",
    author="Maksim Kurnikov",
    author_email="maxim.kurnikov@gmail.com",
    maintainer="Marti Raudsepp",
    maintainer_email="marti@juffo.org",
    py_modules=[],
    python_requires=">=3.7",
    install_requires=dependencies,
    extras_require=extras_require,
    packages=["django-stubs", *find_packages(exclude=["scripts"])],
    package_data={
        "django-stubs": find_stub_files("django-stubs"),
        "mypy_django_plugin": ["py.typed"],
    },
    classifiers=[
        "License :: OSI Approved :: MIT License",
        "Operating System :: OS Independent",
        "Programming Language :: Python :: 3.7",
        "Programming Language :: Python :: 3.8",
        "Programming Language :: Python :: 3.9",
        "Programming Language :: Python :: 3.10",
        "Programming Language :: Python :: 3.11",
        "Typing :: Typed",
        "Framework :: Django",
        "Framework :: Django :: 2.2",
        "Framework :: Django :: 3.0",
        "Framework :: Django :: 3.1",
        "Framework :: Django :: 3.2",
        "Framework :: Django :: 4.0",
        "Framework :: Django :: 4.1",
    ],
    project_urls={
        "Release notes": "https://github.com/typeddjango/django-stubs/releases",
    },
)

setup.py
import os
from typing import List

from setuptools import find_packages, setup


def find_stub_files(name: str) -> List[str]:
    result = []
    for root, _dirs, files in os.walk(name):
        for file in files:
            if file.endswith(".pyi"):
                if os.path.sep in root:
                    sub_root = root.split(os.path.sep, 1)[-1]
                    file = os.path.join(sub_root, file)
                result.append(file)
    return result


with open("README.md") as f:
    readme = f.read()

dependencies = [
    "mypy>=0.980",
    "django",
    "django-stubs-ext>=0.8.0",
    "tomli; python_version < '3.11'",
    # Types:
    "typing-extensions",
    "types-pytz",
    "types-PyYAML",
]

extras_require = {
    "compatible-mypy": ["mypy>=1.2.0,<1.3"],
}

setup(
    name="django-stubs",
    version="1.16.0",
    description="Mypy stubs for Django",
    long_description=readme,
    long_description_content_type="text/markdown",
    license="MIT",
    url="https://github.com/typeddjango/django-stubs",
    author="Maksim Kurnikov",
    author_email="maxim.kurnikov@gmail.com",
    maintainer="Marti Raudsepp",
    maintainer_email="marti@juffo.org",
    py_modules=[],
    python_requires=">=3.7",
    install_requires=dependencies,
    extras_require=extras_require,
    packages=["django-stubs", *find_packages(exclude=["scripts"])],
    package_data={
        "django-stubs": find_stub_files("django-stubs"),
        "mypy_django_plugin": ["py.typed"],
    },
    classifiers=[
        "License :: OSI Approved :: MIT License",
        "Operating System :: OS Independent",
        "Programming Language :: Python :: 3.7",
        "Programming Language :: Python :: 3.8",
        "Programming Language :: Python :: 3.9",
        "Programming Language :: Python :: 3.10",
        "Programming Language :: Python :: 3.11",
        "Typing :: Typed",
        "Framework :: Django",
        "Framework :: Django :: 2.2",
        "Framework :: Django :: 3.0",
        "Framework :: Django :: 3.1",
        "Framework :: Django :: 3.2",
        "Framework :: Django :: 4.0",
        "Framework :: Django :: 4.1",
    ],
    project_urls={
        "Release notes": "https://github.com/typeddjango/django-stubs/releases",
    },
)

setup.py
diff --git a/django-stubs/db/models/fields/related.pyi b/django-stubs/db/models/fields/related.pyi
index d4e90e61b..4c245d7ad 100644
--- a/django-stubs/db/models/fields/related.pyi
+++ b/django-stubs/db/models/fields/related.pyi
@@ -144,7 +144,7 @@ class ForeignKey(ForeignObject[_ST, _GT]):
         error_messages: _ErrorMessagesT | None = ...,
     ) -> None: ...
     # class access
-    @overload  # type: ignore
+    @overload
     def __get__(self, instance: None, owner: Any) -> ForwardManyToOneDescriptor: ...
     # Model instance access
     @overload
@@ -193,7 +193,7 @@ class OneToOneField(ForeignKey[_ST, _GT]):
         error_messages: _ErrorMessagesT | None = ...,
     ) -> None: ...
     # class access
-    @overload  # type: ignore
+    @overload
     def __get__(self, instance: None, owner: Any) -> ForwardOneToOneDescriptor: ...
     # Model instance access
     @overload
@@ -253,7 +253,7 @@ class ManyToManyField(RelatedField[_ST, _GT]):
         error_messages: _ErrorMessagesT | None = ...,
     ) -> None: ...
     # class access
-    @overload  # type: ignore
+    @overload
     def __get__(self, instance: None, owner: Any) -> ManyToManyDescriptor: ...
     # Model instance access
     @overload
diff --git a/requirements.txt b/requirements.txt
index 2acc669d6..29e398de4 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -9,4 +9,4 @@ psycopg2-binary
 -e .[compatible-mypy]
 
 # Overrides:
-mypy==1.1.1
+mypy==1.2.0
diff --git a/setup.py b/setup.py
index 81a091b57..98afd9f92 100644
--- a/setup.py
+++ b/setup.py
@@ -31,7 +31,7 @@ def find_stub_files(name: str) -> List[str]:
 ]
 
 extras_require = {
-    "compatible-mypy": ["mypy>=1.1.1,<1.2"],
+    "compatible-mypy": ["mypy>=1.2.0,<1.3"],
 }
 
 setup(
diff --git a/tests/typecheck/test_request.yml b/tests/typecheck/test_request.yml
index 4d6b1da09..dd3a39d90 100644
--- a/tests/typecheck/test_request.yml
+++ b/tests/typecheck/test_request.yml
@@ -88,7 +88,6 @@
         req.GET.setdefault('foo', 'bar')  # E: This QueryDict is immutable.
         x = 1  # E: Statement is unreachable
 
-# Will work after merging https://github.com/python/mypy/pull/12572
 -   case: request_get_post_unreachable
     main: |
         from django.http.request import HttpRequest
@@ -106,4 +105,3 @@
         reveal_type(req.GET)  # N: Revealed type is "django.http.request._ImmutableQueryDict"
         req.GET['foo'] = 'bar'  # E: This QueryDict is immutable.
         x = 1  # E: Statement is unreachable
-    expect_fail: true

Bump mypy from 1.1.1 to 1.2.0
Bumps [mypy](https://github.com/python/mypy) from 1.1.1 to 1.2.0.
<details>
<summary>Commits</summary>
<ul>
<li><a href="https://github.com/python/mypy/commit/4f47dfb64dff920c237e7c8c58f8efba57cf57cf"><code>4f47dfb</code></a> Promote version to 1.2.0 and drop +dev from the version</li>
<li><a href="https://github.com/python/mypy/commit/06aa182b4973ea122c9f536855a31234d75b93b9"><code>06aa182</code></a> [dataclass_transform] support implicit default for &quot;init&quot; parameter in field ...</li>
<li><a href="https://github.com/python/mypy/commit/7beaec2e4a1c7891b044b45e538a472dbe86f240"><code>7beaec2</code></a> Support descriptors in dataclass transform (<a href="https://redirect.github.com/python/mypy/issues/15006">#15006</a>)</li>
<li><a href="https://github.com/python/mypy/commit/a7a995a0409b623b941a1e2f882792abed45fddf"><code>a7a995a</code></a> Multiple inheritance considers callable objects as subtypes of functions (<a href="https://redirect.github.com/python/mypy/issues/14">#14</a>...</li>
<li><a href="https://github.com/python/mypy/commit/7f2a5b5bf7dca35402390f2ff30c35c23b4085d4"><code>7f2a5b5</code></a> [dataclass_transform] fix deserialization for frozen_default</li>
<li><a href="https://github.com/python/mypy/commit/bfa9eacedb0554e1a6fe9245dbd5ccdbbc555fae"><code>bfa9eac</code></a> [mypyc] Be stricter about function prototypes (<a href="https://redirect.github.com/python/mypy/issues/14942">#14942</a>)</li>
<li><a href="https://github.com/python/mypy/commit/4e6d68322774d5f7c15d5067613fc851b4640d3e"><code>4e6d683</code></a> [mypyc] Document native floats and integers (<a href="https://redirect.github.com/python/mypy/issues/14927">#14927</a>)</li>
<li><a href="https://github.com/python/mypy/commit/aa2679b6b0bbbffcb454081a81346c0a82804e52"><code>aa2679b</code></a> [mypyc] Fixes to float to int conversion (<a href="https://redirect.github.com/python/mypy/issues/14936">#14936</a>)</li>
<li><a href="https://github.com/python/mypy/commit/9944d5fc6ae29a862bfab980a42a9bfae89ee5c0"><code>9944d5f</code></a> [mypyc] Support iterating over a TypedDict (<a href="https://redirect.github.com/python/mypy/issues/14747">#14747</a>)</li>
<li><a href="https://github.com/python/mypy/commit/1a8ea6187474fcc5896cf4b7f47074673e07ad42"><code>1a8ea61</code></a> [mypyc] Avoid boxing/unboxing when coercing between tuple types (<a href="https://redirect.github.com/python/mypy/issues/14899">#14899</a>)</li>
<li>Additional commits viewable in <a href="https://github.com/python/mypy/compare/v1.1.1...v1.2.0">compare view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=mypy&package-manager=pip&previous-version=1.1.1&new-version=1.2.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)


</details>
