prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  Drop support for Python 3.7, NumPy 1.20, and SciPy 1.6 on document and setup.py
  #7405 has some CI issues, so we update the documentation and setup.py first for the next release.
  
  --- 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 import glob
  4 import os
  5 from setuptools import setup, find_packages
  6 import sys
  7 
  8 source_root = os.path.abspath(os.path.dirname(__file__))
  9 sys.path.append(os.path.join(source_root, 'install'))
  10 
  11 import cupy_builder  # NOQA
  12 from cupy_builder import cupy_setup_build  # NOQA
  13 
  14 ctx = cupy_builder.Context(source_root)
  15 cupy_builder.initialize(ctx)
  16 if not cupy_builder.preflight_check(ctx):
  17     sys.exit(1)
  18 
  19 
  20 # TODO(kmaehashi): migrate to pyproject.toml (see #4727, #4619)
  21 setup_requires = [
  22     'Cython>=0.29.22,<3',
  23     'fastrlock>=0.5',
  24 ]
  25 install_requires = [
  26     'numpy>=1.20,<1.27',  # see #4773
  27     'fastrlock>=0.5',
  28 ]
  29 extras_require = {
  30     'all': [
  31         'scipy>=1.6,<1.12',  # see #4773
  32         'Cython>=0.29.22,<3',
  33         'optuna>=2.0',
  34     ],
  35     # TODO(kmaehashi): remove stylecheck and update the contribution guide
  36     'stylecheck': [
  37         'autopep8==1.5.5',
  38         'flake8==3.8.4',
  39         'pbr==5.5.1',
  40         'pycodestyle==2.6.0',
  41 
  42         'mypy==0.950',
  43         'types-setuptools==57.4.14',
  44     ],
  45     'test': [
  46         # 4.2 <= pytest < 6.2 is slow collecting tests and times out on CI.
  47         # pytest < 7.2 has some different behavior that makes our CI fail
  48         'pytest>=7.2',
  49         'hypothesis>=6.37.2,<6.55.0',
  50     ],
  51 }
  52 tests_require = extras_require['test']
  53 
  54 
  55 # List of files that needs to be in the distribution (sdist/wheel).
  56 # Notes:
  57 # - Files only needed in sdist should be added to `MANIFEST.in`.
  58 # - The following glob (`**`) ignores items starting with `.`.
  59 cupy_package_data = [
  60     'cupy/cuda/cupy_thrust.cu',
  61     'cupy/cuda/cupy_cub.cu',
  62     'cupy/cuda/cupy_cufftXt.cu',  # for cuFFT callback
  63     'cupy/cuda/cupy_cufftXt.h',  # for cuFFT callback
  64     'cupy/cuda/cupy_cufft.h',  # for cuFFT callback
  65     'cupy/cuda/cufft.pxd',  # for cuFFT callback
  66     'cupy/cuda/cufft.pyx',  # for cuFFT callback
  67     'cupy/random/cupy_distributions.cu',
  68     'cupy/random/cupy_distributions.cuh',
  69 ] + [
  70     x for x in glob.glob('cupy/_core/include/cupy/**', recursive=True)
  71     if os.path.isfile(x)
  72 ]
  73 
  74 package_data = {
  75     'cupy': [
  76         os.path.relpath(x, 'cupy') for x in cupy_package_data
  77     ],
  78 }
  79 
  80 package_data['cupy'] += cupy_setup_build.prepare_wheel_libs(ctx)
  81 
  82 
  83 if len(sys.argv) < 2 or sys.argv[1] == 'egg_info':
  84     # Extensions are unnecessary for egg_info generation as all sources files
  85     # can be enumerated via MANIFEST.in.
  86     ext_modules = []
  87 else:
  88     ext_modules = cupy_setup_build.get_ext_modules(True, ctx)
  89 
  90 
  91 # Get __version__ variable
  92 with open(os.path.join(source_root, 'cupy', '_version.py')) as f:
  93     exec(f.read())
  94 
  95 long_description = None
  96 if ctx.long_description_path is not None:
  97     with open(ctx.long_description_path) as f:
  98         long_description = f.read()
  99 
  100 
  101 CLASSIFIERS = """\
  102 Development Status :: 5 - Production/Stable
  103 Intended Audience :: Science/Research
  104 Intended Audience :: Developers
  105 License :: OSI Approved :: MIT License
  106 Programming Language :: Python
  107 Programming Language :: Python :: 3
  108 Programming Language :: Python :: 3.7
  109 Programming Language :: Python :: 3.8
  110 Programming Language :: Python :: 3.9
  111 Programming Language :: Python :: 3.10
  112 Programming Language :: Python :: 3.11
  113 Programming Language :: Python :: 3 :: Only
  114 Programming Language :: Cython
  115 Topic :: Software Development
  116 Topic :: Scientific/Engineering
  117 Operating System :: POSIX
  118 Operating System :: Microsoft :: Windows
  119 """
  120 
  121 
  122 setup(
  123     name=ctx.package_name,
  124     version=__version__,  # NOQA
  125     description='CuPy: NumPy & SciPy for GPU',
  126     long_description=long_description,
  127     author='Seiya Tokui',
  128     author_email='tokui@preferred.jp',
  129     maintainer='CuPy Developers',
  130     url='https://cupy.dev/',
  131     license='MIT License',
  132     project_urls={
  133         "Bug Tracker": "https://github.com/cupy/cupy/issues",
  134         "Documentation": "https://docs.cupy.dev/",
  135         "Source Code": "https://github.com/cupy/cupy",
  136     },
  137     classifiers=[_f for _f in CLASSIFIERS.split('\n') if _f],
  138     packages=find_packages(exclude=['install', 'tests']),
  139     package_data=package_data,
  140     zip_safe=False,
  141     python_requires='>=3.7',
  142     setup_requires=setup_requires,
  143     install_requires=install_requires,
  144     tests_require=tests_require,
  145     extras_require=extras_require,
  146     ext_modules=ext_modules,
  147     cmdclass={'build_ext': cupy_builder._command.custom_build_ext},
  148 )
  149
  ```
  --- 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()
  
  ```
  
golden_diff: diff --git a/setup.py b/setup.py
  --- a/setup.py
  +++ b/setup.py
  @@ -105,7 +105,6 @@
   License :: OSI Approved :: MIT License
   Programming Language :: Python
   Programming Language :: Python :: 3
  -Programming Language :: Python :: 3.7
   Programming Language :: Python :: 3.8
   Programming Language :: Python :: 3.9
   Programming Language :: Python :: 3.10
  @@ -138,7 +137,7 @@
       packages=find_packages(exclude=['install', 'tests']),
       package_data=package_data,
       zip_safe=False,
  -    python_requires='>=3.7',
  +    python_requires='>=3.8',
       setup_requires=setup_requires,
       install_requires=install_requires,
       tests_require=tests_require,
  
verification_info: {"golden_diff": "diff --git a/setup.py b/setup.py\n--- a/setup.py\n+++ b/setup.py\n@@ -105,7 +105,6 @@\n License :: OSI Approved :: MIT License\n Programming Language :: Python\n Programming Language :: Python :: 3\n-Programming Language :: Python :: 3.7\n Programming Language :: Python :: 3.8\n Programming Language :: Python :: 3.9\n Programming Language :: Python :: 3.10\n@@ -138,7 +137,7 @@\n     packages=find_packages(exclude=['install', 'tests']),\n     package_data=package_data,\n     zip_safe=False,\n-    python_requires='>=3.7',\n+    python_requires='>=3.8',\n     setup_requires=setup_requires,\n     install_requires=install_requires,\n     tests_require=tests_require,\n", "issue": "Drop support for Python 3.7, NumPy 1.20, and SciPy 1.6 on document and setup.py\n#7405 has some CI issues, so we update the documentation and setup.py first for the next release.\n", "before_files": [{"content": "#!/usr/bin/env python\n\nimport glob\nimport os\nfrom setuptools import setup, find_packages\nimport sys\n\nsource_root = os.path.abspath(os.path.dirname(__file__))\nsys.path.append(os.path.join(source_root, 'install'))\n\nimport cupy_builder  # NOQA\nfrom cupy_builder import cupy_setup_build  # NOQA\n\nctx = cupy_builder.Context(source_root)\ncupy_builder.initialize(ctx)\nif not cupy_builder.preflight_check(ctx):\n    sys.exit(1)\n\n\n# TODO(kmaehashi): migrate to pyproject.toml (see #4727, #4619)\nsetup_requires = [\n    'Cython>=0.29.22,<3',\n    'fastrlock>=0.5',\n]\ninstall_requires = [\n    'numpy>=1.20,<1.27',  # see #4773\n    'fastrlock>=0.5',\n]\nextras_require = {\n    'all': [\n        'scipy>=1.6,<1.12',  # see #4773\n        'Cython>=0.29.22,<3',\n        'optuna>=2.0',\n    ],\n    # TODO(kmaehashi): remove stylecheck and update the contribution guide\n    'stylecheck': [\n        'autopep8==1.5.5',\n        'flake8==3.8.4',\n        'pbr==5.5.1',\n        'pycodestyle==2.6.0',\n\n        'mypy==0.950',\n        'types-setuptools==57.4.14',\n    ],\n    'test': [\n        # 4.2 <= pytest < 6.2 is slow collecting tests and times out on CI.\n        # pytest < 7.2 has some different behavior that makes our CI fail\n        'pytest>=7.2',\n        'hypothesis>=6.37.2,<6.55.0',\n    ],\n}\ntests_require = extras_require['test']\n\n\n# List of files that needs to be in the distribution (sdist/wheel).\n# Notes:\n# - Files only needed in sdist should be added to `MANIFEST.in`.\n# - The following glob (`**`) ignores items starting with `.`.\ncupy_package_data = [\n    'cupy/cuda/cupy_thrust.cu',\n    'cupy/cuda/cupy_cub.cu',\n    'cupy/cuda/cupy_cufftXt.cu',  # for cuFFT callback\n    'cupy/cuda/cupy_cufftXt.h',  # for cuFFT callback\n    'cupy/cuda/cupy_cufft.h',  # for cuFFT callback\n    'cupy/cuda/cufft.pxd',  # for cuFFT callback\n    'cupy/cuda/cufft.pyx',  # for cuFFT callback\n    'cupy/random/cupy_distributions.cu',\n    'cupy/random/cupy_distributions.cuh',\n] + [\n    x for x in glob.glob('cupy/_core/include/cupy/**', recursive=True)\n    if os.path.isfile(x)\n]\n\npackage_data = {\n    'cupy': [\n        os.path.relpath(x, 'cupy') for x in cupy_package_data\n    ],\n}\n\npackage_data['cupy'] += cupy_setup_build.prepare_wheel_libs(ctx)\n\n\nif len(sys.argv) < 2 or sys.argv[1] == 'egg_info':\n    # Extensions are unnecessary for egg_info generation as all sources files\n    # can be enumerated via MANIFEST.in.\n    ext_modules = []\nelse:\n    ext_modules = cupy_setup_build.get_ext_modules(True, ctx)\n\n\n# Get __version__ variable\nwith open(os.path.join(source_root, 'cupy', '_version.py')) as f:\n    exec(f.read())\n\nlong_description = None\nif ctx.long_description_path is not None:\n    with open(ctx.long_description_path) as f:\n        long_description = f.read()\n\n\nCLASSIFIERS = \"\"\"\\\nDevelopment Status :: 5 - Production/Stable\nIntended Audience :: Science/Research\nIntended Audience :: Developers\nLicense :: OSI Approved :: MIT License\nProgramming Language :: Python\nProgramming Language :: Python :: 3\nProgramming Language :: Python :: 3.7\nProgramming Language :: Python :: 3.8\nProgramming Language :: Python :: 3.9\nProgramming Language :: Python :: 3.10\nProgramming Language :: Python :: 3.11\nProgramming Language :: Python :: 3 :: Only\nProgramming Language :: Cython\nTopic :: Software Development\nTopic :: Scientific/Engineering\nOperating System :: POSIX\nOperating System :: Microsoft :: Windows\n\"\"\"\n\n\nsetup(\n    name=ctx.package_name,\n    version=__version__,  # NOQA\n    description='CuPy: NumPy & SciPy for GPU',\n    long_description=long_description,\n    author='Seiya Tokui',\n    author_email='tokui@preferred.jp',\n    maintainer='CuPy Developers',\n    url='https://cupy.dev/',\n    license='MIT License',\n    project_urls={\n        \"Bug Tracker\": \"https://github.com/cupy/cupy/issues\",\n        \"Documentation\": \"https://docs.cupy.dev/\",\n        \"Source Code\": \"https://github.com/cupy/cupy\",\n    },\n    classifiers=[_f for _f in CLASSIFIERS.split('\\n') if _f],\n    packages=find_packages(exclude=['install', 'tests']),\n    package_data=package_data,\n    zip_safe=False,\n    python_requires='>=3.7',\n    setup_requires=setup_requires,\n    install_requires=install_requires,\n    tests_require=tests_require,\n    extras_require=extras_require,\n    ext_modules=ext_modules,\n    cmdclass={'build_ext': cupy_builder._command.custom_build_ext},\n)\n", "path": "setup.py"}], "after_files": [{"content": "#!/usr/bin/env python\n\nimport glob\nimport os\nfrom setuptools import setup, find_packages\nimport sys\n\nsource_root = os.path.abspath(os.path.dirname(__file__))\nsys.path.append(os.path.join(source_root, 'install'))\n\nimport cupy_builder  # NOQA\nfrom cupy_builder import cupy_setup_build  # NOQA\n\nctx = cupy_builder.Context(source_root)\ncupy_builder.initialize(ctx)\nif not cupy_builder.preflight_check(ctx):\n    sys.exit(1)\n\n\n# TODO(kmaehashi): migrate to pyproject.toml (see #4727, #4619)\nsetup_requires = [\n    'Cython>=0.29.22,<3',\n    'fastrlock>=0.5',\n]\ninstall_requires = [\n    'numpy>=1.20,<1.27',  # see #4773\n    'fastrlock>=0.5',\n]\nextras_require = {\n    'all': [\n        'scipy>=1.6,<1.12',  # see #4773\n        'Cython>=0.29.22,<3',\n        'optuna>=2.0',\n    ],\n    # TODO(kmaehashi): remove stylecheck and update the contribution guide\n    'stylecheck': [\n        'autopep8==1.5.5',\n        'flake8==3.8.4',\n        'pbr==5.5.1',\n        'pycodestyle==2.6.0',\n\n        'mypy==0.950',\n        'types-setuptools==57.4.14',\n    ],\n    'test': [\n        # 4.2 <= pytest < 6.2 is slow collecting tests and times out on CI.\n        # pytest < 7.2 has some different behavior that makes our CI fail\n        'pytest>=7.2',\n        'hypothesis>=6.37.2,<6.55.0',\n    ],\n}\ntests_require = extras_require['test']\n\n\n# List of files that needs to be in the distribution (sdist/wheel).\n# Notes:\n# - Files only needed in sdist should be added to `MANIFEST.in`.\n# - The following glob (`**`) ignores items starting with `.`.\ncupy_package_data = [\n    'cupy/cuda/cupy_thrust.cu',\n    'cupy/cuda/cupy_cub.cu',\n    'cupy/cuda/cupy_cufftXt.cu',  # for cuFFT callback\n    'cupy/cuda/cupy_cufftXt.h',  # for cuFFT callback\n    'cupy/cuda/cupy_cufft.h',  # for cuFFT callback\n    'cupy/cuda/cufft.pxd',  # for cuFFT callback\n    'cupy/cuda/cufft.pyx',  # for cuFFT callback\n    'cupy/random/cupy_distributions.cu',\n    'cupy/random/cupy_distributions.cuh',\n] + [\n    x for x in glob.glob('cupy/_core/include/cupy/**', recursive=True)\n    if os.path.isfile(x)\n]\n\npackage_data = {\n    'cupy': [\n        os.path.relpath(x, 'cupy') for x in cupy_package_data\n    ],\n}\n\npackage_data['cupy'] += cupy_setup_build.prepare_wheel_libs(ctx)\n\n\nif len(sys.argv) < 2 or sys.argv[1] == 'egg_info':\n    # Extensions are unnecessary for egg_info generation as all sources files\n    # can be enumerated via MANIFEST.in.\n    ext_modules = []\nelse:\n    ext_modules = cupy_setup_build.get_ext_modules(True, ctx)\n\n\n# Get __version__ variable\nwith open(os.path.join(source_root, 'cupy', '_version.py')) as f:\n    exec(f.read())\n\nlong_description = None\nif ctx.long_description_path is not None:\n    with open(ctx.long_description_path) as f:\n        long_description = f.read()\n\n\nCLASSIFIERS = \"\"\"\\\nDevelopment Status :: 5 - Production/Stable\nIntended Audience :: Science/Research\nIntended Audience :: Developers\nLicense :: OSI Approved :: MIT License\nProgramming Language :: Python\nProgramming Language :: Python :: 3\nProgramming Language :: Python :: 3.8\nProgramming Language :: Python :: 3.9\nProgramming Language :: Python :: 3.10\nProgramming Language :: Python :: 3.11\nProgramming Language :: Python :: 3 :: Only\nProgramming Language :: Cython\nTopic :: Software Development\nTopic :: Scientific/Engineering\nOperating System :: POSIX\nOperating System :: Microsoft :: Windows\n\"\"\"\n\n\nsetup(\n    name=ctx.package_name,\n    version=__version__,  # NOQA\n    description='CuPy: NumPy & SciPy for GPU',\n    long_description=long_description,\n    author='Seiya Tokui',\n    author_email='tokui@preferred.jp',\n    maintainer='CuPy Developers',\n    url='https://cupy.dev/',\n    license='MIT License',\n    project_urls={\n        \"Bug Tracker\": \"https://github.com/cupy/cupy/issues\",\n        \"Documentation\": \"https://docs.cupy.dev/\",\n        \"Source Code\": \"https://github.com/cupy/cupy\",\n    },\n    classifiers=[_f for _f in CLASSIFIERS.split('\\n') if _f],\n    packages=find_packages(exclude=['install', 'tests']),\n    package_data=package_data,\n    zip_safe=False,\n    python_requires='>=3.8',\n    setup_requires=setup_requires,\n    install_requires=install_requires,\n    tests_require=tests_require,\n    extras_require=extras_require,\n    ext_modules=ext_modules,\n    cmdclass={'build_ext': cupy_builder._command.custom_build_ext},\n)\n", "path": "setup.py"}]}