We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Add setuptools as a dependency on Python 3.12?
Mypyc needs `distutils` or `setuptools` to run, but Python 3.12 no longer bundles `distutils` ([PEP 632](https://peps.python.org/pep-0632/)). This seems to imply that we need to include `setuptools` as a dependency of mypy (at least on Python 3.12 or later), or unbundle mypyc into a separate distribution on PyPI. Thoughts?

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `setup.py`
Content:
```
1 #!/usr/bin/env python
2 
3 from __future__ import annotations
4 
5 import glob
6 import os
7 import os.path
8 import sys
9 from typing import TYPE_CHECKING, Any
10 
11 if sys.version_info < (3, 8, 0):  # noqa: UP036
12     sys.stderr.write("ERROR: You need Python 3.8 or later to use mypy.\n")
13     exit(1)
14 
15 # we'll import stuff from the source tree, let's ensure is on the sys path
16 sys.path.insert(0, os.path.dirname(os.path.realpath(__file__)))
17 
18 # This requires setuptools when building; setuptools is not needed
19 # when installing from a wheel file (though it is still needed for
20 # alternative forms of installing, as suggested by README.md).
21 from setuptools import Extension, find_packages, setup
22 from setuptools.command.build_py import build_py
23 
24 from mypy.version import __version__ as version
25 
26 if TYPE_CHECKING:
27     from typing_extensions import TypeGuard
28 
29 description = "Optional static typing for Python"
30 long_description = """
31 Mypy -- Optional Static Typing for Python
32 =========================================
33 
34 Add type annotations to your Python programs, and use mypy to type
35 check them.  Mypy is essentially a Python linter on steroids, and it
36 can catch many programming errors by analyzing your program, without
37 actually having to run it.  Mypy has a powerful type system with
38 features such as type inference, gradual typing, generics and union
39 types.
40 """.lstrip()
41 
42 
43 def is_list_of_setuptools_extension(items: list[Any]) -> TypeGuard[list[Extension]]:
44     return all(isinstance(item, Extension) for item in items)
45 
46 
47 def find_package_data(base, globs, root="mypy"):
48     """Find all interesting data files, for setup(package_data=)
49 
50     Arguments:
51       root:  The directory to search in.
52       globs: A list of glob patterns to accept files.
53     """
54 
55     rv_dirs = [root for root, dirs, files in os.walk(base)]
56     rv = []
57     for rv_dir in rv_dirs:
58         files = []
59         for pat in globs:
60             files += glob.glob(os.path.join(rv_dir, pat))
61         if not files:
62             continue
63         rv.extend([os.path.relpath(f, root) for f in files])
64     return rv
65 
66 
67 class CustomPythonBuild(build_py):
68     def pin_version(self):
69         path = os.path.join(self.build_lib, "mypy")
70         self.mkpath(path)
71         with open(os.path.join(path, "version.py"), "w") as stream:
72             stream.write(f'__version__ = "{version}"\n')
73 
74     def run(self):
75         self.execute(self.pin_version, ())
76         build_py.run(self)
77 
78 
79 cmdclass = {"build_py": CustomPythonBuild}
80 
81 package_data = ["py.typed"]
82 
83 package_data += find_package_data(os.path.join("mypy", "typeshed"), ["*.py", "*.pyi"])
84 package_data += [os.path.join("mypy", "typeshed", "stdlib", "VERSIONS")]
85 
86 package_data += find_package_data(os.path.join("mypy", "xml"), ["*.xsd", "*.xslt", "*.css"])
87 
88 USE_MYPYC = False
89 # To compile with mypyc, a mypyc checkout must be present on the PYTHONPATH
90 if len(sys.argv) > 1 and "--use-mypyc" in sys.argv:
91     sys.argv.remove("--use-mypyc")
92     USE_MYPYC = True
93 if os.getenv("MYPY_USE_MYPYC", None) == "1":
94     USE_MYPYC = True
95 
96 if USE_MYPYC:
97     MYPYC_BLACKLIST = tuple(
98         os.path.join("mypy", x)
99         for x in (
100             # Need to be runnable as scripts
101             "__main__.py",
102             "pyinfo.py",
103             os.path.join("dmypy", "__main__.py"),
104             # Uses __getattr__/__setattr__
105             "split_namespace.py",
106             # Lies to mypy about code reachability
107             "bogus_type.py",
108             # We don't populate __file__ properly at the top level or something?
109             # Also I think there would be problems with how we generate version.py.
110             "version.py",
111             # Skip these to reduce the size of the build
112             "stubtest.py",
113             "stubgenc.py",
114             "stubdoc.py",
115             "stubutil.py",
116         )
117     ) + (
118         # Don't want to grab this accidentally
119         os.path.join("mypyc", "lib-rt", "setup.py"),
120         # Uses __file__ at top level https://github.com/mypyc/mypyc/issues/700
121         os.path.join("mypyc", "__main__.py"),
122     )
123 
124     everything = [os.path.join("mypy", x) for x in find_package_data("mypy", ["*.py"])] + [
125         os.path.join("mypyc", x) for x in find_package_data("mypyc", ["*.py"], root="mypyc")
126     ]
127     # Start with all the .py files
128     all_real_pys = [
129         x for x in everything if not x.startswith(os.path.join("mypy", "typeshed") + os.sep)
130     ]
131     # Strip out anything in our blacklist
132     mypyc_targets = [x for x in all_real_pys if x not in MYPYC_BLACKLIST]
133     # Strip out any test code
134     mypyc_targets = [
135         x
136         for x in mypyc_targets
137         if not x.startswith(
138             (
139                 os.path.join("mypy", "test") + os.sep,
140                 os.path.join("mypyc", "test") + os.sep,
141                 os.path.join("mypyc", "doc") + os.sep,
142                 os.path.join("mypyc", "test-data") + os.sep,
143             )
144         )
145     ]
146     # ... and add back in the one test module we need
147     mypyc_targets.append(os.path.join("mypy", "test", "visitors.py"))
148 
149     # The targets come out of file system apis in an unspecified
150     # order. Sort them so that the mypyc output is deterministic.
151     mypyc_targets.sort()
152 
153     use_other_mypyc = os.getenv("ALTERNATE_MYPYC_PATH", None)
154     if use_other_mypyc:
155         # This bit is super unfortunate: we want to use a different
156         # mypy/mypyc version, but we've already imported parts, so we
157         # remove the modules that we've imported already, which will
158         # let the right versions be imported by mypyc.
159         del sys.modules["mypy"]
160         del sys.modules["mypy.version"]
161         del sys.modules["mypy.git"]
162         sys.path.insert(0, use_other_mypyc)
163 
164     from mypyc.build import mypycify
165 
166     opt_level = os.getenv("MYPYC_OPT_LEVEL", "3")
167     debug_level = os.getenv("MYPYC_DEBUG_LEVEL", "1")
168     force_multifile = os.getenv("MYPYC_MULTI_FILE", "") == "1"
169     ext_modules = mypycify(
170         mypyc_targets + ["--config-file=mypy_bootstrap.ini"],
171         opt_level=opt_level,
172         debug_level=debug_level,
173         # Use multi-file compilation mode on windows because without it
174         # our Appveyor builds run out of memory sometimes.
175         multi_file=sys.platform == "win32" or force_multifile,
176     )
177     assert is_list_of_setuptools_extension(ext_modules), "Expected mypycify to use setuptools"
178 
179 else:
180     ext_modules = []
181 
182 
183 classifiers = [
184     "Development Status :: 5 - Production/Stable",
185     "Environment :: Console",
186     "Intended Audience :: Developers",
187     "License :: OSI Approved :: MIT License",
188     "Programming Language :: Python :: 3",
189     "Programming Language :: Python :: 3.8",
190     "Programming Language :: Python :: 3.9",
191     "Programming Language :: Python :: 3.10",
192     "Programming Language :: Python :: 3.11",
193     "Topic :: Software Development",
194     "Typing :: Typed",
195 ]
196 
197 setup(
198     name="mypy",
199     version=version,
200     description=description,
201     long_description=long_description,
202     author="Jukka Lehtosalo",
203     author_email="jukka.lehtosalo@iki.fi",
204     url="https://www.mypy-lang.org/",
205     license="MIT License",
206     py_modules=[],
207     ext_modules=ext_modules,
208     packages=find_packages(),
209     package_data={"mypy": package_data},
210     entry_points={
211         "console_scripts": [
212             "mypy=mypy.__main__:console_entry",
213             "stubgen=mypy.stubgen:main",
214             "stubtest=mypy.stubtest:main",
215             "dmypy=mypy.dmypy.client:console_entry",
216             "mypyc=mypyc.__main__:main",
217         ]
218     },
219     classifiers=classifiers,
220     cmdclass=cmdclass,
221     # When changing this, also update mypy-requirements.txt.
222     install_requires=[
223         "typing_extensions>=4.1.0",
224         "mypy_extensions >= 1.0.0",
225         "tomli>=1.1.0; python_version<'3.11'",
226     ],
227     # Same here.
228     extras_require={
229         "dmypy": "psutil >= 4.0",
230         "python2": "",
231         "reports": "lxml",
232         "install-types": "pip",
233     },
234     python_requires=">=3.8",
235     include_package_data=True,
236     project_urls={
237         "News": "https://mypy-lang.org/news.html",
238         "Documentation": "https://mypy.readthedocs.io/en/stable/index.html",
239         "Repository": "https://github.com/python/mypy",
240     },
241 )
242
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -227,6 +227,7 @@
     # Same here.
     extras_require={
         "dmypy": "psutil >= 4.0",
+        "mypyc": "setuptools >= 50",
         "python2": "",
         "reports": "lxml",
         "install-types": "pip",

{"golden_diff": "diff --git a/setup.py b/setup.py\n--- a/setup.py\n+++ b/setup.py\n@@ -227,6 +227,7 @@\n     # Same here.\n     extras_require={\n         \"dmypy\": \"psutil >= 4.0\",\n+        \"mypyc\": \"setuptools >= 50\",\n         \"python2\": \"\",\n         \"reports\": \"lxml\",\n         \"install-types\": \"pip\",\n", "issue": "Add setuptools as a dependency on Python 3.12?\nMypyc needs `distutils` or `setuptools` to run, but Python 3.12 no longer bundles `distutils` ([PEP 632](https://peps.python.org/pep-0632/)). This seems to imply that we need to include `setuptools` as a dependency of mypy (at least on Python 3.12 or later), or unbundle mypyc into a separate distribution on PyPI. Thoughts?\n", "before_files": [{"content": "#!/usr/bin/env python\n\nfrom __future__ import annotations\n\nimport glob\nimport os\nimport os.path\nimport sys\nfrom typing import TYPE_CHECKING, Any\n\nif sys.version_info < (3, 8, 0):  # noqa: UP036\n    sys.stderr.write(\"ERROR: You need Python 3.8 or later to use mypy.\\n\")\n    exit(1)\n\n# we'll import stuff from the source tree, let's ensure is on the sys path\nsys.path.insert(0, os.path.dirname(os.path.realpath(__file__)))\n\n# This requires setuptools when building; setuptools is not needed\n# when installing from a wheel file (though it is still needed for\n# alternative forms of installing, as suggested by README.md).\nfrom setuptools import Extension, find_packages, setup\nfrom setuptools.command.build_py import build_py\n\nfrom mypy.version import __version__ as version\n\nif TYPE_CHECKING:\n    from typing_extensions import TypeGuard\n\ndescription = \"Optional static typing for Python\"\nlong_description = \"\"\"\nMypy -- Optional Static Typing for Python\n=========================================\n\nAdd type annotations to your Python programs, and use mypy to type\ncheck them.  Mypy is essentially a Python linter on steroids, and it\ncan catch many programming errors by analyzing your program, without\nactually having to run it.  Mypy has a powerful type system with\nfeatures such as type inference, gradual typing, generics and union\ntypes.\n\"\"\".lstrip()\n\n\ndef is_list_of_setuptools_extension(items: list[Any]) -> TypeGuard[list[Extension]]:\n    return all(isinstance(item, Extension) for item in items)\n\n\ndef find_package_data(base, globs, root=\"mypy\"):\n    \"\"\"Find all interesting data files, for setup(package_data=)\n\n    Arguments:\n      root:  The directory to search in.\n      globs: A list of glob patterns to accept files.\n    \"\"\"\n\n    rv_dirs = [root for root, dirs, files in os.walk(base)]\n    rv = []\n    for rv_dir in rv_dirs:\n        files = []\n        for pat in globs:\n            files += glob.glob(os.path.join(rv_dir, pat))\n        if not files:\n            continue\n        rv.extend([os.path.relpath(f, root) for f in files])\n    return rv\n\n\nclass CustomPythonBuild(build_py):\n    def pin_version(self):\n        path = os.path.join(self.build_lib, \"mypy\")\n        self.mkpath(path)\n        with open(os.path.join(path, \"version.py\"), \"w\") as stream:\n            stream.write(f'__version__ = \"{version}\"\\n')\n\n    def run(self):\n        self.execute(self.pin_version, ())\n        build_py.run(self)\n\n\ncmdclass = {\"build_py\": CustomPythonBuild}\n\npackage_data = [\"py.typed\"]\n\npackage_data += find_package_data(os.path.join(\"mypy\", \"typeshed\"), [\"*.py\", \"*.pyi\"])\npackage_data += [os.path.join(\"mypy\", \"typeshed\", \"stdlib\", \"VERSIONS\")]\n\npackage_data += find_package_data(os.path.join(\"mypy\", \"xml\"), [\"*.xsd\", \"*.xslt\", \"*.css\"])\n\nUSE_MYPYC = False\n# To compile with mypyc, a mypyc checkout must be present on the PYTHONPATH\nif len(sys.argv) > 1 and \"--use-mypyc\" in sys.argv:\n    sys.argv.remove(\"--use-mypyc\")\n    USE_MYPYC = True\nif os.getenv(\"MYPY_USE_MYPYC\", None) == \"1\":\n    USE_MYPYC = True\n\nif USE_MYPYC:\n    MYPYC_BLACKLIST = tuple(\n        os.path.join(\"mypy\", x)\n        for x in (\n            # Need to be runnable as scripts\n            \"__main__.py\",\n            \"pyinfo.py\",\n            os.path.join(\"dmypy\", \"__main__.py\"),\n            # Uses __getattr__/__setattr__\n            \"split_namespace.py\",\n            # Lies to mypy about code reachability\n            \"bogus_type.py\",\n            # We don't populate __file__ properly at the top level or something?\n            # Also I think there would be problems with how we generate version.py.\n            \"version.py\",\n            # Skip these to reduce the size of the build\n            \"stubtest.py\",\n            \"stubgenc.py\",\n            \"stubdoc.py\",\n            \"stubutil.py\",\n        )\n    ) + (\n        # Don't want to grab this accidentally\n        os.path.join(\"mypyc\", \"lib-rt\", \"setup.py\"),\n        # Uses __file__ at top level https://github.com/mypyc/mypyc/issues/700\n        os.path.join(\"mypyc\", \"__main__.py\"),\n    )\n\n    everything = [os.path.join(\"mypy\", x) for x in find_package_data(\"mypy\", [\"*.py\"])] + [\n        os.path.join(\"mypyc\", x) for x in find_package_data(\"mypyc\", [\"*.py\"], root=\"mypyc\")\n    ]\n    # Start with all the .py files\n    all_real_pys = [\n        x for x in everything if not x.startswith(os.path.join(\"mypy\", \"typeshed\") + os.sep)\n    ]\n    # Strip out anything in our blacklist\n    mypyc_targets = [x for x in all_real_pys if x not in MYPYC_BLACKLIST]\n    # Strip out any test code\n    mypyc_targets = [\n        x\n        for x in mypyc_targets\n        if not x.startswith(\n            (\n                os.path.join(\"mypy\", \"test\") + os.sep,\n                os.path.join(\"mypyc\", \"test\") + os.sep,\n                os.path.join(\"mypyc\", \"doc\") + os.sep,\n                os.path.join(\"mypyc\", \"test-data\") + os.sep,\n            )\n        )\n    ]\n    # ... and add back in the one test module we need\n    mypyc_targets.append(os.path.join(\"mypy\", \"test\", \"visitors.py\"))\n\n    # The targets come out of file system apis in an unspecified\n    # order. Sort them so that the mypyc output is deterministic.\n    mypyc_targets.sort()\n\n    use_other_mypyc = os.getenv(\"ALTERNATE_MYPYC_PATH\", None)\n    if use_other_mypyc:\n        # This bit is super unfortunate: we want to use a different\n        # mypy/mypyc version, but we've already imported parts, so we\n        # remove the modules that we've imported already, which will\n        # let the right versions be imported by mypyc.\n        del sys.modules[\"mypy\"]\n        del sys.modules[\"mypy.version\"]\n        del sys.modules[\"mypy.git\"]\n        sys.path.insert(0, use_other_mypyc)\n\n    from mypyc.build import mypycify\n\n    opt_level = os.getenv(\"MYPYC_OPT_LEVEL\", \"3\")\n    debug_level = os.getenv(\"MYPYC_DEBUG_LEVEL\", \"1\")\n    force_multifile = os.getenv(\"MYPYC_MULTI_FILE\", \"\") == \"1\"\n    ext_modules = mypycify(\n        mypyc_targets + [\"--config-file=mypy_bootstrap.ini\"],\n        opt_level=opt_level,\n        debug_level=debug_level,\n        # Use multi-file compilation mode on windows because without it\n        # our Appveyor builds run out of memory sometimes.\n        multi_file=sys.platform == \"win32\" or force_multifile,\n    )\n    assert is_list_of_setuptools_extension(ext_modules), \"Expected mypycify to use setuptools\"\n\nelse:\n    ext_modules = []\n\n\nclassifiers = [\n    \"Development Status :: 5 - Production/Stable\",\n    \"Environment :: Console\",\n    \"Intended Audience :: Developers\",\n    \"License :: OSI Approved :: MIT License\",\n    \"Programming Language :: Python :: 3\",\n    \"Programming Language :: Python :: 3.8\",\n    \"Programming Language :: Python :: 3.9\",\n    \"Programming Language :: Python :: 3.10\",\n    \"Programming Language :: Python :: 3.11\",\n    \"Topic :: Software Development\",\n    \"Typing :: Typed\",\n]\n\nsetup(\n    name=\"mypy\",\n    version=version,\n    description=description,\n    long_description=long_description,\n    author=\"Jukka Lehtosalo\",\n    author_email=\"jukka.lehtosalo@iki.fi\",\n    url=\"https://www.mypy-lang.org/\",\n    license=\"MIT License\",\n    py_modules=[],\n    ext_modules=ext_modules,\n    packages=find_packages(),\n    package_data={\"mypy\": package_data},\n    entry_points={\n        \"console_scripts\": [\n            \"mypy=mypy.__main__:console_entry\",\n            \"stubgen=mypy.stubgen:main\",\n            \"stubtest=mypy.stubtest:main\",\n            \"dmypy=mypy.dmypy.client:console_entry\",\n            \"mypyc=mypyc.__main__:main\",\n        ]\n    },\n    classifiers=classifiers,\n    cmdclass=cmdclass,\n    # When changing this, also update mypy-requirements.txt.\n    install_requires=[\n        \"typing_extensions>=4.1.0\",\n        \"mypy_extensions >= 1.0.0\",\n        \"tomli>=1.1.0; python_version<'3.11'\",\n    ],\n    # Same here.\n    extras_require={\n        \"dmypy\": \"psutil >= 4.0\",\n        \"python2\": \"\",\n        \"reports\": \"lxml\",\n        \"install-types\": \"pip\",\n    },\n    python_requires=\">=3.8\",\n    include_package_data=True,\n    project_urls={\n        \"News\": \"https://mypy-lang.org/news.html\",\n        \"Documentation\": \"https://mypy.readthedocs.io/en/stable/index.html\",\n        \"Repository\": \"https://github.com/python/mypy\",\n    },\n)\n", "path": "setup.py"}], "after_files": [{"content": "#!/usr/bin/env python\n\nfrom __future__ import annotations\n\nimport glob\nimport os\nimport os.path\nimport sys\nfrom typing import TYPE_CHECKING, Any\n\nif sys.version_info < (3, 8, 0):\n    sys.stderr.write(\"ERROR: You need Python 3.8 or later to use mypy.\\n\")\n    exit(1)\n\n# we'll import stuff from the source tree, let's ensure is on the sys path\nsys.path.insert(0, os.path.dirname(os.path.realpath(__file__)))\n\n# This requires setuptools when building; setuptools is not needed\n# when installing from a wheel file (though it is still needed for\n# alternative forms of installing, as suggested by README.md).\nfrom setuptools import Extension, find_packages, setup\nfrom setuptools.command.build_py import build_py\n\nfrom mypy.version import __version__ as version\n\nif TYPE_CHECKING:\n    from typing_extensions import TypeGuard\n\ndescription = \"Optional static typing for Python\"\nlong_description = \"\"\"\nMypy -- Optional Static Typing for Python\n=========================================\n\nAdd type annotations to your Python programs, and use mypy to type\ncheck them.  Mypy is essentially a Python linter on steroids, and it\ncan catch many programming errors by analyzing your program, without\nactually having to run it.  Mypy has a powerful type system with\nfeatures such as type inference, gradual typing, generics and union\ntypes.\n\"\"\".lstrip()\n\n\ndef is_list_of_setuptools_extension(items: list[Any]) -> TypeGuard[list[Extension]]:\n    return all(isinstance(item, Extension) for item in items)\n\n\ndef find_package_data(base, globs, root=\"mypy\"):\n    \"\"\"Find all interesting data files, for setup(package_data=)\n\n    Arguments:\n      root:  The directory to search in.\n      globs: A list of glob patterns to accept files.\n    \"\"\"\n\n    rv_dirs = [root for root, dirs, files in os.walk(base)]\n    rv = []\n    for rv_dir in rv_dirs:\n        files = []\n        for pat in globs:\n            files += glob.glob(os.path.join(rv_dir, pat))\n        if not files:\n            continue\n        rv.extend([os.path.relpath(f, root) for f in files])\n    return rv\n\n\nclass CustomPythonBuild(build_py):\n    def pin_version(self):\n        path = os.path.join(self.build_lib, \"mypy\")\n        self.mkpath(path)\n        with open(os.path.join(path, \"version.py\"), \"w\") as stream:\n            stream.write(f'__version__ = \"{version}\"\\n')\n\n    def run(self):\n        self.execute(self.pin_version, ())\n        build_py.run(self)\n\n\ncmdclass = {\"build_py\": CustomPythonBuild}\n\npackage_data = [\"py.typed\"]\n\npackage_data += find_package_data(os.path.join(\"mypy\", \"typeshed\"), [\"*.py\", \"*.pyi\"])\npackage_data += [os.path.join(\"mypy\", \"typeshed\", \"stdlib\", \"VERSIONS\")]\n\npackage_data += find_package_data(os.path.join(\"mypy\", \"xml\"), [\"*.xsd\", \"*.xslt\", \"*.css\"])\n\nUSE_MYPYC = False\n# To compile with mypyc, a mypyc checkout must be present on the PYTHONPATH\nif len(sys.argv) > 1 and \"--use-mypyc\" in sys.argv:\n    sys.argv.remove(\"--use-mypyc\")\n    USE_MYPYC = True\nif os.getenv(\"MYPY_USE_MYPYC\", None) == \"1\":\n    USE_MYPYC = True\n\nif USE_MYPYC:\n    MYPYC_BLACKLIST = tuple(\n        os.path.join(\"mypy\", x)\n        for x in (\n            # Need to be runnable as scripts\n            \"__main__.py\",\n            \"pyinfo.py\",\n            os.path.join(\"dmypy\", \"__main__.py\"),\n            # Uses __getattr__/__setattr__\n            \"split_namespace.py\",\n            # Lies to mypy about code reachability\n            \"bogus_type.py\",\n            # We don't populate __file__ properly at the top level or something?\n            # Also I think there would be problems with how we generate version.py.\n            \"version.py\",\n            # Skip these to reduce the size of the build\n            \"stubtest.py\",\n            \"stubgenc.py\",\n            \"stubdoc.py\",\n            \"stubutil.py\",\n        )\n    ) + (\n        # Don't want to grab this accidentally\n        os.path.join(\"mypyc\", \"lib-rt\", \"setup.py\"),\n        # Uses __file__ at top level https://github.com/mypyc/mypyc/issues/700\n        os.path.join(\"mypyc\", \"__main__.py\"),\n    )\n\n    everything = [os.path.join(\"mypy\", x) for x in find_package_data(\"mypy\", [\"*.py\"])] + [\n        os.path.join(\"mypyc\", x) for x in find_package_data(\"mypyc\", [\"*.py\"], root=\"mypyc\")\n    ]\n    # Start with all the .py files\n    all_real_pys = [\n        x for x in everything if not x.startswith(os.path.join(\"mypy\", \"typeshed\") + os.sep)\n    ]\n    # Strip out anything in our blacklist\n    mypyc_targets = [x for x in all_real_pys if x not in MYPYC_BLACKLIST]\n    # Strip out any test code\n    mypyc_targets = [\n        x\n        for x in mypyc_targets\n        if not x.startswith(\n            (\n                os.path.join(\"mypy\", \"test\") + os.sep,\n                os.path.join(\"mypyc\", \"test\") + os.sep,\n                os.path.join(\"mypyc\", \"doc\") + os.sep,\n                os.path.join(\"mypyc\", \"test-data\") + os.sep,\n            )\n        )\n    ]\n    # ... and add back in the one test module we need\n    mypyc_targets.append(os.path.join(\"mypy\", \"test\", \"visitors.py\"))\n\n    # The targets come out of file system apis in an unspecified\n    # order. Sort them so that the mypyc output is deterministic.\n    mypyc_targets.sort()\n\n    use_other_mypyc = os.getenv(\"ALTERNATE_MYPYC_PATH\", None)\n    if use_other_mypyc:\n        # This bit is super unfortunate: we want to use a different\n        # mypy/mypyc version, but we've already imported parts, so we\n        # remove the modules that we've imported already, which will\n        # let the right versions be imported by mypyc.\n        del sys.modules[\"mypy\"]\n        del sys.modules[\"mypy.version\"]\n        del sys.modules[\"mypy.git\"]\n        sys.path.insert(0, use_other_mypyc)\n\n    from mypyc.build import mypycify\n\n    opt_level = os.getenv(\"MYPYC_OPT_LEVEL\", \"3\")\n    debug_level = os.getenv(\"MYPYC_DEBUG_LEVEL\", \"1\")\n    force_multifile = os.getenv(\"MYPYC_MULTI_FILE\", \"\") == \"1\"\n    ext_modules = mypycify(\n        mypyc_targets + [\"--config-file=mypy_bootstrap.ini\"],\n        opt_level=opt_level,\n        debug_level=debug_level,\n        # Use multi-file compilation mode on windows because without it\n        # our Appveyor builds run out of memory sometimes.\n        multi_file=sys.platform == \"win32\" or force_multifile,\n    )\n    assert is_list_of_setuptools_extension(ext_modules), \"Expected mypycify to use setuptools\"\n\nelse:\n    ext_modules = []\n\n\nclassifiers = [\n    \"Development Status :: 5 - Production/Stable\",\n    \"Environment :: Console\",\n    \"Intended Audience :: Developers\",\n    \"License :: OSI Approved :: MIT License\",\n    \"Programming Language :: Python :: 3\",\n    \"Programming Language :: Python :: 3.8\",\n    \"Programming Language :: Python :: 3.9\",\n    \"Programming Language :: Python :: 3.10\",\n    \"Programming Language :: Python :: 3.11\",\n    \"Topic :: Software Development\",\n    \"Typing :: Typed\",\n]\n\nsetup(\n    name=\"mypy\",\n    version=version,\n    description=description,\n    long_description=long_description,\n    author=\"Jukka Lehtosalo\",\n    author_email=\"jukka.lehtosalo@iki.fi\",\n    url=\"https://www.mypy-lang.org/\",\n    license=\"MIT License\",\n    py_modules=[],\n    ext_modules=ext_modules,\n    packages=find_packages(),\n    package_data={\"mypy\": package_data},\n    entry_points={\n        \"console_scripts\": [\n            \"mypy=mypy.__main__:console_entry\",\n            \"stubgen=mypy.stubgen:main\",\n            \"stubtest=mypy.stubtest:main\",\n            \"dmypy=mypy.dmypy.client:console_entry\",\n            \"mypyc=mypyc.__main__:main\",\n        ]\n    },\n    classifiers=classifiers,\n    cmdclass=cmdclass,\n    # When changing this, also update mypy-requirements.txt.\n    install_requires=[\n        \"typing_extensions>=4.1.0\",\n        \"mypy_extensions >= 1.0.0\",\n        \"tomli>=1.1.0; python_version<'3.11'\",\n    ],\n    # Same here.\n    extras_require={\n        \"dmypy\": \"psutil >= 4.0\",\n        \"mypyc\": \"setuptools >= 50\",\n        \"python2\": \"\",\n        \"reports\": \"lxml\",\n        \"install-types\": \"pip\",\n    },\n    python_requires=\">=3.8\",\n    include_package_data=True,\n    project_urls={\n        \"News\": \"https://mypy-lang.org/news.html\",\n        \"Documentation\": \"https://mypy.readthedocs.io/en/stable/index.html\",\n        \"Repository\": \"https://github.com/python/mypy\",\n    },\n)\n", "path": "setup.py"}]}