We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
test_init_docstring.py fail
```
C:\Path\To\chainer>py -3.7 -m pytest tests\chainer_tests\test_init_docstring.py
================================================= test session starts =================================================
platform win32 -- Python 3.7.3, pytest-4.1.1, py-1.8.0, pluggy-0.12.0
rootdir: C:\Development\gopath\src\github.com\chainer\chainer, inifile: setup.cfg
collected 1 item

tests\chainer_tests\test_init_docstring.py F                                                                     [100%]

====================================================== FAILURES =======================================================
_____________________________________ TestInitDocstring.test_init_docstring_empty _____________________________________

self = <chainer_tests.test_init_docstring.TestInitDocstring testMethod=test_init_docstring_empty>

    def test_init_docstring_empty(self):
        errors = []
        root = chainer.__path__
        for loader, modname, ispkg in pkgutil.walk_packages(root, 'chainer.'):
            # Skip modules generated by protobuf.
            if '_pb2' in modname:
                continue

            try:
>               mod = importlib.import_module(modname)

tests\chainer_tests\test_init_docstring.py:48:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
C:\Development\Python\Python37\lib\importlib\__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
<frozen importlib._bootstrap>:1006: in _gcd_import
    ???
<frozen importlib._bootstrap>:983: in _find_and_load
    ???
<frozen importlib._bootstrap>:967: in _find_and_load_unlocked
    ???
<frozen importlib._bootstrap>:677: in _load_unlocked
    ???
<frozen importlib._bootstrap_external>:728: in exec_module
    ???
<frozen importlib._bootstrap>:219: in _call_with_frames_removed
    ???
chainer\exporters\__init__.py:1: in <module>
    from chainer.exporters import caffe  # NOQA
chainer\exporters\caffe.py:11: in <module>
    from chainer.links.caffe.protobuf3 import caffe_pb2 as caffe_pb
chainer\links\caffe\__init__.py:1: in <module>
    from chainer.links.caffe.caffe_function import CaffeFunction  # NOQA
chainer\links\caffe\caffe_function.py:10: in <module>
    from chainer.links.caffe.protobuf3 import caffe_pb2 as caffe_pb
chainer\links\caffe\protobuf3\caffe_pb2.py:7: in <module>
    from google.protobuf import descriptor as _descriptor
C:\Development\Python\Python37\lib\site-packages\google\protobuf\descriptor.py:47: in <module>
    from google.protobuf.pyext import _message
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

name = 'MutableSequence'

    def __getattr__(name):
        # For backwards compatibility, continue to make the collections ABCs
        # through Python 3.6 available through the collections module.
        # Note, no new collections ABCs were added in Python 3.7
        if name in _collections_abc.__all__:
            obj = getattr(_collections_abc, name)
            import warnings
            warnings.warn("Using or importing the ABCs from 'collections' instead "
                          "of from 'collections.abc' is deprecated, "
                          "and in 3.8 it will stop working",
>                         DeprecationWarning, stacklevel=2)
E           DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated, and in 3.8 it will stop working

C:\Development\Python\Python37\lib\collections\__init__.py:52: DeprecationWarning
============================================== 1 failed in 0.45 seconds ===============================================
```

- Python 3.7
- Chainer version: master (https://github.com/chainer/chainer/commit/c7b9c037f3e7116aeb29db8273e025b90bed0a70)
- Depend modules: `pip install -e .[test]` on the commit id
- OS/Platform: windows10

--- 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 os
4 import pkg_resources
5 import sys
6 
7 from setuptools import setup
8 
9 import chainerx_build_helper
10 
11 
12 if sys.version_info[:3] == (3, 5, 0):
13     if not int(os.getenv('CHAINER_PYTHON_350_FORCE', '0')):
14         msg = """
15 Chainer does not work with Python 3.5.0.
16 
17 We strongly recommend to use another version of Python.
18 If you want to use Chainer with Python 3.5.0 at your own risk,
19 set CHAINER_PYTHON_350_FORCE environment variable to 1."""
20         print(msg)
21         sys.exit(1)
22 
23 
24 requirements = {
25     'install': [
26         'setuptools',
27         'typing',
28         'typing_extensions',
29         'filelock',
30         'numpy>=1.9.0',
31         # protobuf 3.8.0rc1 causes CI errors.
32         # TODO(niboshi): Probably we should always use pip in CIs for
33         # installing chainer. It avoids pre-release dependencies by default.
34         # See also: https://github.com/pypa/setuptools/issues/855
35         'protobuf>=3.0.0,<3.8.0rc1',
36         'six>=1.9.0',
37     ],
38     'stylecheck': [
39         'autopep8>=1.4.1,<1.5',
40         'flake8>=3.7,<3.8',
41         'pycodestyle>=2.5,<2.6',
42     ],
43     'test': [
44         'pytest<4.2.0',  # 4.2.0 is slow collecting tests and times out on CI.
45         'mock',
46     ],
47     'doctest': [
48         'sphinx==1.8.2',
49         'matplotlib',
50         'theano',
51     ],
52     'docs': [
53         'sphinx==1.8.2',
54         'sphinx_rtd_theme',
55     ],
56     'appveyor': [
57         '-r test',
58         # pytest-timeout>=1.3.0 requires pytest>=3.6.
59         # TODO(niboshi): Consider upgrading pytest to >=3.6
60         'pytest-timeout<1.3.0',
61     ],
62 }
63 
64 
65 if sys.version_info >= (3, 4):  # mypy requires Python 3.4 or later
66     requirements['stylecheck'].append('mypy')
67 
68 
69 def reduce_requirements(key):
70     # Resolve recursive requirements notation (-r)
71     reqs = requirements[key]
72     resolved_reqs = []
73     for req in reqs:
74         if req.startswith('-r'):
75             depend_key = req[2:].lstrip()
76             reduce_requirements(depend_key)
77             resolved_reqs += requirements[depend_key]
78         else:
79             resolved_reqs.append(req)
80     requirements[key] = resolved_reqs
81 
82 
83 for k in requirements.keys():
84     reduce_requirements(k)
85 
86 
87 extras_require = {k: v for k, v in requirements.items() if k != 'install'}
88 setup_requires = []
89 install_requires = requirements['install']
90 tests_require = requirements['test']
91 
92 
93 def find_any_distribution(pkgs):
94     for pkg in pkgs:
95         try:
96             return pkg_resources.get_distribution(pkg)
97         except pkg_resources.DistributionNotFound:
98             pass
99     return None
100 
101 
102 mn_pkg = find_any_distribution(['chainermn'])
103 if mn_pkg is not None:
104     msg = """
105 We detected that ChainerMN is installed in your environment.
106 ChainerMN has been integrated to Chainer and no separate installation
107 is necessary. Please uninstall the old ChainerMN in advance.
108 """
109     print(msg)
110     exit(1)
111 
112 here = os.path.abspath(os.path.dirname(__file__))
113 # Get __version__ variable
114 exec(open(os.path.join(here, 'chainer', '_version.py')).read())
115 
116 
117 setup_kwargs = dict(
118     name='chainer',
119     version=__version__,  # NOQA
120     description='A flexible framework of neural networks',
121     long_description=open('README.md').read(),
122     long_description_content_type='text/markdown',
123     author='Seiya Tokui',
124     author_email='tokui@preferred.jp',
125     url='https://chainer.org/',
126     license='MIT License',
127     packages=['chainer',
128               'chainer.backends',
129               'chainer.dataset',
130               'chainer.dataset.tabular',
131               'chainer.datasets',
132               'chainer.distributions',
133               'chainer.exporters',
134               'chainer.functions',
135               'chainer.functions.activation',
136               'chainer.functions.array',
137               'chainer.functions.connection',
138               'chainer.functions.evaluation',
139               'chainer.functions.loss',
140               'chainer.functions.math',
141               'chainer.functions.noise',
142               'chainer.functions.normalization',
143               'chainer.functions.pooling',
144               'chainer.functions.theano',
145               'chainer.functions.util',
146               'chainer.function_hooks',
147               'chainer.iterators',
148               'chainer.initializers',
149               'chainer.links',
150               'chainer.links.activation',
151               'chainer.links.caffe',
152               'chainer.links.caffe.protobuf3',
153               'chainer.links.connection',
154               'chainer.links.loss',
155               'chainer.links.model',
156               'chainer.links.model.vision',
157               'chainer.links.normalization',
158               'chainer.links.theano',
159               'chainer.link_hooks',
160               'chainer.graph_optimizations',
161               'chainer.optimizers',
162               'chainer.optimizer_hooks',
163               'chainer.serializers',
164               'chainer.testing',
165               'chainer.training',
166               'chainer.training.extensions',
167               'chainer.training.triggers',
168               'chainer.training.updaters',
169               'chainer.utils',
170               'chainermn',
171               'chainermn.communicators',
172               'chainermn.datasets',
173               'chainermn.extensions',
174               'chainermn.functions',
175               'chainermn.iterators',
176               'chainermn.links'],
177     package_data={
178         'chainer': ['py.typed'],
179     },
180     zip_safe=False,
181     setup_requires=setup_requires,
182     install_requires=install_requires,
183     tests_require=tests_require,
184     extras_require=extras_require,
185 )
186 
187 
188 build_chainerx = 0 != int(os.getenv('CHAINER_BUILD_CHAINERX', '0'))
189 if (os.getenv('READTHEDOCS', None) == 'True'
190         and os.getenv('READTHEDOCS_PROJECT', None) == 'chainer'):
191     os.environ['MAKEFLAGS'] = '-j2'
192     build_chainerx = True
193 
194 chainerx_build_helper.config_setup_kwargs(setup_kwargs, build_chainerx)
195 
196 
197 setup(**setup_kwargs)
198
```
--- 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
@@ -28,11 +28,7 @@
         'typing_extensions',
         'filelock',
         'numpy>=1.9.0',
-        # protobuf 3.8.0rc1 causes CI errors.
-        # TODO(niboshi): Probably we should always use pip in CIs for
-        # installing chainer. It avoids pre-release dependencies by default.
-        # See also: https://github.com/pypa/setuptools/issues/855
-        'protobuf>=3.0.0,<3.8.0rc1',
+        'protobuf>=3.0.0',
         'six>=1.9.0',
     ],
     'stylecheck': [

{"golden_diff": "diff --git a/setup.py b/setup.py\n--- a/setup.py\n+++ b/setup.py\n@@ -28,11 +28,7 @@\n         'typing_extensions',\n         'filelock',\n         'numpy>=1.9.0',\n-        # protobuf 3.8.0rc1 causes CI errors.\n-        # TODO(niboshi): Probably we should always use pip in CIs for\n-        # installing chainer. It avoids pre-release dependencies by default.\n-        # See also: https://github.com/pypa/setuptools/issues/855\n-        'protobuf>=3.0.0,<3.8.0rc1',\n+        'protobuf>=3.0.0',\n         'six>=1.9.0',\n     ],\n     'stylecheck': [\n", "issue": "test_init_docstring.py fail\n```\r\nC:\\Path\\To\\chainer>py -3.7 -m pytest tests\\chainer_tests\\test_init_docstring.py\r\n================================================= test session starts =================================================\r\nplatform win32 -- Python 3.7.3, pytest-4.1.1, py-1.8.0, pluggy-0.12.0\r\nrootdir: C:\\Development\\gopath\\src\\github.com\\chainer\\chainer, inifile: setup.cfg\r\ncollected 1 item\r\n\r\ntests\\chainer_tests\\test_init_docstring.py F                                                                     [100%]\r\n\r\n====================================================== FAILURES =======================================================\r\n_____________________________________ TestInitDocstring.test_init_docstring_empty _____________________________________\r\n\r\nself = <chainer_tests.test_init_docstring.TestInitDocstring testMethod=test_init_docstring_empty>\r\n\r\n    def test_init_docstring_empty(self):\r\n        errors = []\r\n        root = chainer.__path__\r\n        for loader, modname, ispkg in pkgutil.walk_packages(root, 'chainer.'):\r\n            # Skip modules generated by protobuf.\r\n            if '_pb2' in modname:\r\n                continue\r\n\r\n            try:\r\n>               mod = importlib.import_module(modname)\r\n\r\ntests\\chainer_tests\\test_init_docstring.py:48:\r\n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _\r\nC:\\Development\\Python\\Python37\\lib\\importlib\\__init__.py:127: in import_module\r\n    return _bootstrap._gcd_import(name[level:], package, level)\r\n<frozen importlib._bootstrap>:1006: in _gcd_import\r\n    ???\r\n<frozen importlib._bootstrap>:983: in _find_and_load\r\n    ???\r\n<frozen importlib._bootstrap>:967: in _find_and_load_unlocked\r\n    ???\r\n<frozen importlib._bootstrap>:677: in _load_unlocked\r\n    ???\r\n<frozen importlib._bootstrap_external>:728: in exec_module\r\n    ???\r\n<frozen importlib._bootstrap>:219: in _call_with_frames_removed\r\n    ???\r\nchainer\\exporters\\__init__.py:1: in <module>\r\n    from chainer.exporters import caffe  # NOQA\r\nchainer\\exporters\\caffe.py:11: in <module>\r\n    from chainer.links.caffe.protobuf3 import caffe_pb2 as caffe_pb\r\nchainer\\links\\caffe\\__init__.py:1: in <module>\r\n    from chainer.links.caffe.caffe_function import CaffeFunction  # NOQA\r\nchainer\\links\\caffe\\caffe_function.py:10: in <module>\r\n    from chainer.links.caffe.protobuf3 import caffe_pb2 as caffe_pb\r\nchainer\\links\\caffe\\protobuf3\\caffe_pb2.py:7: in <module>\r\n    from google.protobuf import descriptor as _descriptor\r\nC:\\Development\\Python\\Python37\\lib\\site-packages\\google\\protobuf\\descriptor.py:47: in <module>\r\n    from google.protobuf.pyext import _message\r\n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _\r\n\r\nname = 'MutableSequence'\r\n\r\n    def __getattr__(name):\r\n        # For backwards compatibility, continue to make the collections ABCs\r\n        # through Python 3.6 available through the collections module.\r\n        # Note, no new collections ABCs were added in Python 3.7\r\n        if name in _collections_abc.__all__:\r\n            obj = getattr(_collections_abc, name)\r\n            import warnings\r\n            warnings.warn(\"Using or importing the ABCs from 'collections' instead \"\r\n                          \"of from 'collections.abc' is deprecated, \"\r\n                          \"and in 3.8 it will stop working\",\r\n>                         DeprecationWarning, stacklevel=2)\r\nE           DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated, and in 3.8 it will stop working\r\n\r\nC:\\Development\\Python\\Python37\\lib\\collections\\__init__.py:52: DeprecationWarning\r\n============================================== 1 failed in 0.45 seconds ===============================================\r\n```\r\n\r\n- Python 3.7\r\n- Chainer version: master (https://github.com/chainer/chainer/commit/c7b9c037f3e7116aeb29db8273e025b90bed0a70)\r\n- Depend modules: `pip install -e .[test]` on the commit id\r\n- OS/Platform: windows10\n", "before_files": [{"content": "#!/usr/bin/env python\n\nimport os\nimport pkg_resources\nimport sys\n\nfrom setuptools import setup\n\nimport chainerx_build_helper\n\n\nif sys.version_info[:3] == (3, 5, 0):\n    if not int(os.getenv('CHAINER_PYTHON_350_FORCE', '0')):\n        msg = \"\"\"\nChainer does not work with Python 3.5.0.\n\nWe strongly recommend to use another version of Python.\nIf you want to use Chainer with Python 3.5.0 at your own risk,\nset CHAINER_PYTHON_350_FORCE environment variable to 1.\"\"\"\n        print(msg)\n        sys.exit(1)\n\n\nrequirements = {\n    'install': [\n        'setuptools',\n        'typing',\n        'typing_extensions',\n        'filelock',\n        'numpy>=1.9.0',\n        # protobuf 3.8.0rc1 causes CI errors.\n        # TODO(niboshi): Probably we should always use pip in CIs for\n        # installing chainer. It avoids pre-release dependencies by default.\n        # See also: https://github.com/pypa/setuptools/issues/855\n        'protobuf>=3.0.0,<3.8.0rc1',\n        'six>=1.9.0',\n    ],\n    'stylecheck': [\n        'autopep8>=1.4.1,<1.5',\n        'flake8>=3.7,<3.8',\n        'pycodestyle>=2.5,<2.6',\n    ],\n    'test': [\n        'pytest<4.2.0',  # 4.2.0 is slow collecting tests and times out on CI.\n        'mock',\n    ],\n    'doctest': [\n        'sphinx==1.8.2',\n        'matplotlib',\n        'theano',\n    ],\n    'docs': [\n        'sphinx==1.8.2',\n        'sphinx_rtd_theme',\n    ],\n    'appveyor': [\n        '-r test',\n        # pytest-timeout>=1.3.0 requires pytest>=3.6.\n        # TODO(niboshi): Consider upgrading pytest to >=3.6\n        'pytest-timeout<1.3.0',\n    ],\n}\n\n\nif sys.version_info >= (3, 4):  # mypy requires Python 3.4 or later\n    requirements['stylecheck'].append('mypy')\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'}\nsetup_requires = []\ninstall_requires = requirements['install']\ntests_require = requirements['test']\n\n\ndef find_any_distribution(pkgs):\n    for pkg in pkgs:\n        try:\n            return pkg_resources.get_distribution(pkg)\n        except pkg_resources.DistributionNotFound:\n            pass\n    return None\n\n\nmn_pkg = find_any_distribution(['chainermn'])\nif mn_pkg is not None:\n    msg = \"\"\"\nWe detected that ChainerMN is installed in your environment.\nChainerMN has been integrated to Chainer and no separate installation\nis necessary. Please uninstall the old ChainerMN in advance.\n\"\"\"\n    print(msg)\n    exit(1)\n\nhere = os.path.abspath(os.path.dirname(__file__))\n# Get __version__ variable\nexec(open(os.path.join(here, 'chainer', '_version.py')).read())\n\n\nsetup_kwargs = dict(\n    name='chainer',\n    version=__version__,  # NOQA\n    description='A flexible framework of neural networks',\n    long_description=open('README.md').read(),\n    long_description_content_type='text/markdown',\n    author='Seiya Tokui',\n    author_email='tokui@preferred.jp',\n    url='https://chainer.org/',\n    license='MIT License',\n    packages=['chainer',\n              'chainer.backends',\n              'chainer.dataset',\n              'chainer.dataset.tabular',\n              'chainer.datasets',\n              'chainer.distributions',\n              'chainer.exporters',\n              'chainer.functions',\n              'chainer.functions.activation',\n              'chainer.functions.array',\n              'chainer.functions.connection',\n              'chainer.functions.evaluation',\n              'chainer.functions.loss',\n              'chainer.functions.math',\n              'chainer.functions.noise',\n              'chainer.functions.normalization',\n              'chainer.functions.pooling',\n              'chainer.functions.theano',\n              'chainer.functions.util',\n              'chainer.function_hooks',\n              'chainer.iterators',\n              'chainer.initializers',\n              'chainer.links',\n              'chainer.links.activation',\n              'chainer.links.caffe',\n              'chainer.links.caffe.protobuf3',\n              'chainer.links.connection',\n              'chainer.links.loss',\n              'chainer.links.model',\n              'chainer.links.model.vision',\n              'chainer.links.normalization',\n              'chainer.links.theano',\n              'chainer.link_hooks',\n              'chainer.graph_optimizations',\n              'chainer.optimizers',\n              'chainer.optimizer_hooks',\n              'chainer.serializers',\n              'chainer.testing',\n              'chainer.training',\n              'chainer.training.extensions',\n              'chainer.training.triggers',\n              'chainer.training.updaters',\n              'chainer.utils',\n              'chainermn',\n              'chainermn.communicators',\n              'chainermn.datasets',\n              'chainermn.extensions',\n              'chainermn.functions',\n              'chainermn.iterators',\n              'chainermn.links'],\n    package_data={\n        'chainer': ['py.typed'],\n    },\n    zip_safe=False,\n    setup_requires=setup_requires,\n    install_requires=install_requires,\n    tests_require=tests_require,\n    extras_require=extras_require,\n)\n\n\nbuild_chainerx = 0 != int(os.getenv('CHAINER_BUILD_CHAINERX', '0'))\nif (os.getenv('READTHEDOCS', None) == 'True'\n        and os.getenv('READTHEDOCS_PROJECT', None) == 'chainer'):\n    os.environ['MAKEFLAGS'] = '-j2'\n    build_chainerx = True\n\nchainerx_build_helper.config_setup_kwargs(setup_kwargs, build_chainerx)\n\n\nsetup(**setup_kwargs)\n", "path": "setup.py"}], "after_files": [{"content": "#!/usr/bin/env python\n\nimport os\nimport pkg_resources\nimport sys\n\nfrom setuptools import setup\n\nimport chainerx_build_helper\n\n\nif sys.version_info[:3] == (3, 5, 0):\n    if not int(os.getenv('CHAINER_PYTHON_350_FORCE', '0')):\n        msg = \"\"\"\nChainer does not work with Python 3.5.0.\n\nWe strongly recommend to use another version of Python.\nIf you want to use Chainer with Python 3.5.0 at your own risk,\nset CHAINER_PYTHON_350_FORCE environment variable to 1.\"\"\"\n        print(msg)\n        sys.exit(1)\n\n\nrequirements = {\n    'install': [\n        'setuptools',\n        'typing',\n        'typing_extensions',\n        'filelock',\n        'numpy>=1.9.0',\n        'protobuf>=3.0.0',\n        'six>=1.9.0',\n    ],\n    'stylecheck': [\n        'autopep8>=1.4.1,<1.5',\n        'flake8>=3.7,<3.8',\n        'pycodestyle>=2.5,<2.6',\n    ],\n    'test': [\n        'pytest<4.2.0',  # 4.2.0 is slow collecting tests and times out on CI.\n        'mock',\n    ],\n    'doctest': [\n        'sphinx==1.8.2',\n        'matplotlib',\n        'theano',\n    ],\n    'docs': [\n        'sphinx==1.8.2',\n        'sphinx_rtd_theme',\n    ],\n    'appveyor': [\n        '-r test',\n        # pytest-timeout>=1.3.0 requires pytest>=3.6.\n        # TODO(niboshi): Consider upgrading pytest to >=3.6\n        'pytest-timeout<1.3.0',\n    ],\n}\n\n\nif sys.version_info >= (3, 4):  # mypy requires Python 3.4 or later\n    requirements['stylecheck'].append('mypy')\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'}\nsetup_requires = []\ninstall_requires = requirements['install']\ntests_require = requirements['test']\n\n\ndef find_any_distribution(pkgs):\n    for pkg in pkgs:\n        try:\n            return pkg_resources.get_distribution(pkg)\n        except pkg_resources.DistributionNotFound:\n            pass\n    return None\n\n\nmn_pkg = find_any_distribution(['chainermn'])\nif mn_pkg is not None:\n    msg = \"\"\"\nWe detected that ChainerMN is installed in your environment.\nChainerMN has been integrated to Chainer and no separate installation\nis necessary. Please uninstall the old ChainerMN in advance.\n\"\"\"\n    print(msg)\n    exit(1)\n\nhere = os.path.abspath(os.path.dirname(__file__))\n# Get __version__ variable\nexec(open(os.path.join(here, 'chainer', '_version.py')).read())\n\n\nsetup_kwargs = dict(\n    name='chainer',\n    version=__version__,  # NOQA\n    description='A flexible framework of neural networks',\n    long_description=open('README.md').read(),\n    long_description_content_type='text/markdown',\n    author='Seiya Tokui',\n    author_email='tokui@preferred.jp',\n    url='https://chainer.org/',\n    license='MIT License',\n    packages=['chainer',\n              'chainer.backends',\n              'chainer.dataset',\n              'chainer.dataset.tabular',\n              'chainer.datasets',\n              'chainer.distributions',\n              'chainer.exporters',\n              'chainer.functions',\n              'chainer.functions.activation',\n              'chainer.functions.array',\n              'chainer.functions.connection',\n              'chainer.functions.evaluation',\n              'chainer.functions.loss',\n              'chainer.functions.math',\n              'chainer.functions.noise',\n              'chainer.functions.normalization',\n              'chainer.functions.pooling',\n              'chainer.functions.theano',\n              'chainer.functions.util',\n              'chainer.function_hooks',\n              'chainer.iterators',\n              'chainer.initializers',\n              'chainer.links',\n              'chainer.links.activation',\n              'chainer.links.caffe',\n              'chainer.links.caffe.protobuf3',\n              'chainer.links.connection',\n              'chainer.links.loss',\n              'chainer.links.model',\n              'chainer.links.model.vision',\n              'chainer.links.normalization',\n              'chainer.links.theano',\n              'chainer.link_hooks',\n              'chainer.graph_optimizations',\n              'chainer.optimizers',\n              'chainer.optimizer_hooks',\n              'chainer.serializers',\n              'chainer.testing',\n              'chainer.training',\n              'chainer.training.extensions',\n              'chainer.training.triggers',\n              'chainer.training.updaters',\n              'chainer.utils',\n              'chainermn',\n              'chainermn.communicators',\n              'chainermn.datasets',\n              'chainermn.extensions',\n              'chainermn.functions',\n              'chainermn.iterators',\n              'chainermn.links'],\n    package_data={\n        'chainer': ['py.typed'],\n    },\n    zip_safe=False,\n    setup_requires=setup_requires,\n    install_requires=install_requires,\n    tests_require=tests_require,\n    extras_require=extras_require,\n)\n\n\nbuild_chainerx = 0 != int(os.getenv('CHAINER_BUILD_CHAINERX', '0'))\nif (os.getenv('READTHEDOCS', None) == 'True'\n        and os.getenv('READTHEDOCS_PROJECT', None) == 'chainer'):\n    os.environ['MAKEFLAGS'] = '-j2'\n    build_chainerx = True\n\nchainerx_build_helper.config_setup_kwargs(setup_kwargs, build_chainerx)\n\n\nsetup(**setup_kwargs)\n", "path": "setup.py"}]}