We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
[info] NumPy/SciPy new version pinning recommendation
See:
- https://github.com/numpy/numpy/pull/18505
- scipy/scipy#12862

The most important takeaway is that NumPy/SciPy now recommend downstream distributions to pin the upper bound version if NumPy/Scipy are runtime dependencies. (The example is if the latest NumPy out there is 1.20, one should pin to `<1.23`; the notation used in the docs `<1.xx+3.0` is a bit confusing, see the clarification in https://github.com/scipy/scipy/pull/12862#discussion_r575790007.) There are other suggestions too, but I think this is potentially the most impactful one.

--- 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 import cupy_setup_build
9 
10 
11 for submodule in ('cupy/_core/include/cupy/cub/',
12                   'cupy/_core/include/cupy/jitify'):
13     if len(os.listdir(submodule)) == 0:
14         msg = '''
15         The folder %s is a git submodule but is
16         currently empty. Please use the command
17 
18             git submodule update --init
19 
20         to populate the folder before building from source.
21         ''' % submodule
22         print(msg, file=sys.stderr)
23         sys.exit(1)
24 
25 
26 requirements = {
27     # TODO(kmaehashi): migrate to pyproject.toml (see #4727, #4619)
28     'setup': [
29         'Cython>=0.29.22',
30         'fastrlock>=0.5',
31     ],
32 
33     'install': [
34         'numpy>=1.17',
35         'fastrlock>=0.5',
36     ],
37     'all': [
38         'scipy>=1.4',
39         'optuna>=2.0',
40     ],
41 
42     'stylecheck': [
43         'autopep8==1.5.5',
44         'flake8==3.8.4',
45         'pbr==5.5.1',
46         'pycodestyle==2.6.0',
47     ],
48     'test': [
49         # 4.2 <= pytest < 6.2 is slow collecting tests and times out on CI.
50         'pytest>=6.2',
51     ],
52     'jenkins': [
53         '-r test',
54         'pytest-timeout',
55         'pytest-cov',
56         'coveralls',
57         'codecov',
58         'coverage<5',  # Otherwise, Python must be built with sqlite
59     ],
60 }
61 
62 
63 def reduce_requirements(key):
64     # Resolve recursive requirements notation (-r)
65     reqs = requirements[key]
66     resolved_reqs = []
67     for req in reqs:
68         if req.startswith('-r'):
69             depend_key = req[2:].lstrip()
70             reduce_requirements(depend_key)
71             resolved_reqs += requirements[depend_key]
72         else:
73             resolved_reqs.append(req)
74     requirements[key] = resolved_reqs
75 
76 
77 for k in requirements.keys():
78     reduce_requirements(k)
79 
80 
81 extras_require = {k: v for k, v in requirements.items() if k != 'install'}
82 
83 
84 setup_requires = requirements['setup']
85 install_requires = requirements['install']
86 tests_require = requirements['test']
87 
88 # List of files that needs to be in the distribution (sdist/wheel).
89 # Notes:
90 # - Files only needed in sdist should be added to `MANIFEST.in`.
91 # - The following glob (`**`) ignores items starting with `.`.
92 cupy_package_data = [
93     'cupy/cuda/cupy_thrust.cu',
94     'cupy/cuda/cupy_cub.cu',
95     'cupy/cuda/cupy_cufftXt.cu',  # for cuFFT callback
96     'cupy/cuda/cupy_cufftXt.h',  # for cuFFT callback
97     'cupy/cuda/cupy_cufft.h',  # for cuFFT callback
98     'cupy/cuda/cufft.pxd',  # for cuFFT callback
99     'cupy/cuda/cufft.pyx',  # for cuFFT callback
100     'cupy/random/cupy_distributions.cu',
101     'cupy/random/cupy_distributions.cuh',
102 ] + [
103     x for x in glob.glob('cupy/_core/include/cupy/**', recursive=True)
104     if os.path.isfile(x)
105 ]
106 
107 package_data = {
108     'cupy': [
109         os.path.relpath(x, 'cupy') for x in cupy_package_data
110     ],
111 }
112 
113 package_data['cupy'] += cupy_setup_build.prepare_wheel_libs()
114 
115 package_name = cupy_setup_build.get_package_name()
116 long_description = cupy_setup_build.get_long_description()
117 ext_modules = cupy_setup_build.get_ext_modules()
118 build_ext = cupy_setup_build.custom_build_ext
119 
120 here = os.path.abspath(os.path.dirname(__file__))
121 # Get __version__ variable
122 with open(os.path.join(here, 'cupy', '_version.py')) as f:
123     exec(f.read())
124 
125 CLASSIFIERS = """\
126 Development Status :: 5 - Production/Stable
127 Intended Audience :: Science/Research
128 Intended Audience :: Developers
129 License :: OSI Approved :: MIT License
130 Programming Language :: Python
131 Programming Language :: Python :: 3
132 Programming Language :: Python :: 3.6
133 Programming Language :: Python :: 3.7
134 Programming Language :: Python :: 3.8
135 Programming Language :: Python :: 3.9
136 Programming Language :: Python :: 3 :: Only
137 Programming Language :: Cython
138 Topic :: Software Development
139 Topic :: Scientific/Engineering
140 Operating System :: POSIX
141 Operating System :: Microsoft :: Windows
142 """
143 
144 
145 setup(
146     name=package_name,
147     version=__version__,  # NOQA
148     description='CuPy: A NumPy-compatible array library accelerated by CUDA',
149     long_description=long_description,
150     author='Seiya Tokui',
151     author_email='tokui@preferred.jp',
152     url='https://cupy.dev/',
153     license='MIT License',
154     project_urls={
155         "Bug Tracker": "https://github.com/cupy/cupy/issues",
156         "Documentation": "https://docs.cupy.dev/",
157         "Source Code": "https://github.com/cupy/cupy",
158     },
159     classifiers=[_f for _f in CLASSIFIERS.split('\n') if _f],
160     packages=find_packages(exclude=['install', 'tests']),
161     package_data=package_data,
162     zip_safe=False,
163     python_requires='>=3.6.0',
164     setup_requires=setup_requires,
165     install_requires=install_requires,
166     tests_require=tests_require,
167     extras_require=extras_require,
168     ext_modules=ext_modules,
169     cmdclass={'build_ext': build_ext},
170 )
171
```
--- 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
@@ -31,11 +31,11 @@
     ],
 
     'install': [
-        'numpy>=1.17',
+        'numpy>=1.17,<1.23',  # see #4773
         'fastrlock>=0.5',
     ],
     'all': [
-        'scipy>=1.4',
+        'scipy>=1.4,<1.9',  # see #4773
         'optuna>=2.0',
     ],

{"golden_diff": "diff --git a/setup.py b/setup.py\n--- a/setup.py\n+++ b/setup.py\n@@ -31,11 +31,11 @@\n     ],\n \n     'install': [\n-        'numpy>=1.17',\n+        'numpy>=1.17,<1.23',  # see #4773\n         'fastrlock>=0.5',\n     ],\n     'all': [\n-        'scipy>=1.4',\n+        'scipy>=1.4,<1.9',  # see #4773\n         'optuna>=2.0',\n     ],\n", "issue": "[info] NumPy/SciPy new version pinning recommendation\nSee:\r\n- https://github.com/numpy/numpy/pull/18505\r\n- scipy/scipy#12862\r\n\r\nThe most important takeaway is that NumPy/SciPy now recommend downstream distributions to pin the upper bound version if NumPy/Scipy are runtime dependencies. (The example is if the latest NumPy out there is 1.20, one should pin to `<1.23`; the notation used in the docs `<1.xx+3.0` is a bit confusing, see the clarification in https://github.com/scipy/scipy/pull/12862#discussion_r575790007.) There are other suggestions too, but I think this is potentially the most impactful one.\n", "before_files": [{"content": "#!/usr/bin/env python\n\nimport glob\nimport os\nfrom setuptools import setup, find_packages\nimport sys\n\nimport cupy_setup_build\n\n\nfor submodule in ('cupy/_core/include/cupy/cub/',\n                  'cupy/_core/include/cupy/jitify'):\n    if len(os.listdir(submodule)) == 0:\n        msg = '''\n        The folder %s is a git submodule but is\n        currently empty. Please use the command\n\n            git submodule update --init\n\n        to populate the folder before building from source.\n        ''' % submodule\n        print(msg, file=sys.stderr)\n        sys.exit(1)\n\n\nrequirements = {\n    # TODO(kmaehashi): migrate to pyproject.toml (see #4727, #4619)\n    'setup': [\n        'Cython>=0.29.22',\n        'fastrlock>=0.5',\n    ],\n\n    'install': [\n        'numpy>=1.17',\n        'fastrlock>=0.5',\n    ],\n    'all': [\n        'scipy>=1.4',\n        'optuna>=2.0',\n    ],\n\n    'stylecheck': [\n        'autopep8==1.5.5',\n        'flake8==3.8.4',\n        'pbr==5.5.1',\n        'pycodestyle==2.6.0',\n    ],\n    'test': [\n        # 4.2 <= pytest < 6.2 is slow collecting tests and times out on CI.\n        'pytest>=6.2',\n    ],\n    'jenkins': [\n        '-r test',\n        'pytest-timeout',\n        'pytest-cov',\n        'coveralls',\n        'codecov',\n        'coverage<5',  # Otherwise, Python must be built with sqlite\n    ],\n}\n\n\ndef reduce_requirements(key):\n    # Resolve recursive requirements notation (-r)\n    reqs = requirements[key]\n    resolved_reqs = []\n    for req in reqs:\n        if req.startswith('-r'):\n            depend_key = req[2:].lstrip()\n            reduce_requirements(depend_key)\n            resolved_reqs += requirements[depend_key]\n        else:\n            resolved_reqs.append(req)\n    requirements[key] = resolved_reqs\n\n\nfor k in requirements.keys():\n    reduce_requirements(k)\n\n\nextras_require = {k: v for k, v in requirements.items() if k != 'install'}\n\n\nsetup_requires = requirements['setup']\ninstall_requires = requirements['install']\ntests_require = requirements['test']\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()\n\npackage_name = cupy_setup_build.get_package_name()\nlong_description = cupy_setup_build.get_long_description()\next_modules = cupy_setup_build.get_ext_modules()\nbuild_ext = cupy_setup_build.custom_build_ext\n\nhere = os.path.abspath(os.path.dirname(__file__))\n# Get __version__ variable\nwith open(os.path.join(here, 'cupy', '_version.py')) as f:\n    exec(f.read())\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.6\nProgramming Language :: Python :: 3.7\nProgramming Language :: Python :: 3.8\nProgramming Language :: Python :: 3.9\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=package_name,\n    version=__version__,  # NOQA\n    description='CuPy: A NumPy-compatible array library accelerated by CUDA',\n    long_description=long_description,\n    author='Seiya Tokui',\n    author_email='tokui@preferred.jp',\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.6.0',\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': 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\nimport cupy_setup_build\n\n\nfor submodule in ('cupy/_core/include/cupy/cub/',\n                  'cupy/_core/include/cupy/jitify'):\n    if len(os.listdir(submodule)) == 0:\n        msg = '''\n        The folder %s is a git submodule but is\n        currently empty. Please use the command\n\n            git submodule update --init\n\n        to populate the folder before building from source.\n        ''' % submodule\n        print(msg, file=sys.stderr)\n        sys.exit(1)\n\n\nrequirements = {\n    # TODO(kmaehashi): migrate to pyproject.toml (see #4727, #4619)\n    'setup': [\n        'Cython>=0.29.22',\n        'fastrlock>=0.5',\n    ],\n\n    'install': [\n        'numpy>=1.17,<1.23',  # see #4773\n        'fastrlock>=0.5',\n    ],\n    'all': [\n        'scipy>=1.4,<1.9',  # see #4773\n        'optuna>=2.0',\n    ],\n\n    'stylecheck': [\n        'autopep8==1.5.5',\n        'flake8==3.8.4',\n        'pbr==5.5.1',\n        'pycodestyle==2.6.0',\n    ],\n    'test': [\n        # 4.2 <= pytest < 6.2 is slow collecting tests and times out on CI.\n        'pytest>=6.2',\n    ],\n    'jenkins': [\n        '-r test',\n        'pytest-timeout',\n        'pytest-cov',\n        'coveralls',\n        'codecov',\n        'coverage<5',  # Otherwise, Python must be built with sqlite\n    ],\n}\n\n\ndef reduce_requirements(key):\n    # Resolve recursive requirements notation (-r)\n    reqs = requirements[key]\n    resolved_reqs = []\n    for req in reqs:\n        if req.startswith('-r'):\n            depend_key = req[2:].lstrip()\n            reduce_requirements(depend_key)\n            resolved_reqs += requirements[depend_key]\n        else:\n            resolved_reqs.append(req)\n    requirements[key] = resolved_reqs\n\n\nfor k in requirements.keys():\n    reduce_requirements(k)\n\n\nextras_require = {k: v for k, v in requirements.items() if k != 'install'}\n\n\nsetup_requires = requirements['setup']\ninstall_requires = requirements['install']\ntests_require = requirements['test']\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()\n\npackage_name = cupy_setup_build.get_package_name()\nlong_description = cupy_setup_build.get_long_description()\next_modules = cupy_setup_build.get_ext_modules()\nbuild_ext = cupy_setup_build.custom_build_ext\n\nhere = os.path.abspath(os.path.dirname(__file__))\n# Get __version__ variable\nwith open(os.path.join(here, 'cupy', '_version.py')) as f:\n    exec(f.read())\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.6\nProgramming Language :: Python :: 3.7\nProgramming Language :: Python :: 3.8\nProgramming Language :: Python :: 3.9\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=package_name,\n    version=__version__,  # NOQA\n    description='CuPy: A NumPy-compatible array library accelerated by CUDA',\n    long_description=long_description,\n    author='Seiya Tokui',\n    author_email='tokui@preferred.jp',\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.6.0',\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': build_ext},\n)\n", "path": "setup.py"}]}