We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Move to support only Rope 0.10.5+
That's because 0.10.5 is the first version to support Python 2 and 3 in the same package.

--- 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 # -*- coding: utf-8 -*-
2 #
3 # Copyright © Spyder Project Contributors
4 # Licensed under the terms of the MIT License
5 # (see spyder/__init__.py for details)
6 
7 """
8 Spyder
9 ======
10 
11 The Scientific PYthon Development EnviRonment
12 """
13 
14 from __future__ import print_function
15 
16 import os
17 import os.path as osp
18 import subprocess
19 import sys
20 import shutil
21 
22 from distutils.core import setup
23 from distutils.command.build import build
24 from distutils.command.install import install
25 from distutils.command.install_data import install_data
26 
27 
28 #==============================================================================
29 # Check for Python 3
30 #==============================================================================
31 PY3 = sys.version_info[0] == 3
32 
33 
34 #==============================================================================
35 # Minimal Python version sanity check
36 # Taken from the notebook setup.py -- Modified BSD License
37 #==============================================================================
38 v = sys.version_info
39 if v[:2] < (2,7) or (v[0] >= 3 and v[:2] < (3,3)):
40     error = "ERROR: Spyder requires Python version 2.7 or 3.3 or above."
41     print(error, file=sys.stderr)
42     sys.exit(1)
43 
44 
45 #==============================================================================
46 # Constants
47 #==============================================================================
48 NAME = 'spyder'
49 LIBNAME = 'spyder'
50 from spyder import __version__, __project_url__
51 
52 
53 #==============================================================================
54 # Auxiliary functions
55 #==============================================================================
56 def get_package_data(name, extlist):
57     """Return data files for package *name* with extensions in *extlist*"""
58     flist = []
59     # Workaround to replace os.path.relpath (not available until Python 2.6):
60     offset = len(name)+len(os.pathsep)
61     for dirpath, _dirnames, filenames in os.walk(name):
62         for fname in filenames:
63             if not fname.startswith('.') and osp.splitext(fname)[1] in extlist:
64                 flist.append(osp.join(dirpath, fname)[offset:])
65     return flist
66 
67 
68 def get_subpackages(name):
69     """Return subpackages of package *name*"""
70     splist = []
71     for dirpath, _dirnames, _filenames in os.walk(name):
72         if osp.isfile(osp.join(dirpath, '__init__.py')):
73             splist.append(".".join(dirpath.split(os.sep)))
74     return splist
75 
76 
77 def get_data_files():
78     """Return data_files in a platform dependent manner"""
79     if sys.platform.startswith('linux'):
80         if PY3:
81             data_files = [('share/applications', ['scripts/spyder3.desktop']),
82                           ('share/pixmaps', ['img_src/spyder3.png']),
83                           ('share/metainfo', ['scripts/spyder3.appdata.xml'])]
84         else:
85             data_files = [('share/applications', ['scripts/spyder.desktop']),
86                           ('share/pixmaps', ['img_src/spyder.png'])]
87     elif os.name == 'nt':
88         data_files = [('scripts', ['img_src/spyder.ico',
89                                    'img_src/spyder_reset.ico'])]
90     else:
91         data_files = []
92     return data_files
93 
94 
95 def get_packages():
96     """Return package list"""
97     packages = (
98         get_subpackages(LIBNAME)
99         + get_subpackages('spyder_breakpoints')
100         + get_subpackages('spyder_profiler')
101         + get_subpackages('spyder_pylint')
102         + get_subpackages('spyder_io_dcm')
103         + get_subpackages('spyder_io_hdf5')
104         )
105     return packages
106 
107 
108 #==============================================================================
109 # Make Linux detect Spyder desktop file
110 #==============================================================================
111 class MyInstallData(install_data):
112     def run(self):
113         install_data.run(self)
114         if sys.platform.startswith('linux'):
115             try:
116                 subprocess.call(['update-desktop-database'])
117             except:
118                 print("ERROR: unable to update desktop database",
119                       file=sys.stderr)
120 CMDCLASS = {'install_data': MyInstallData}
121 
122 
123 #==============================================================================
124 # Sphinx build (documentation)
125 #==============================================================================
126 def get_html_help_exe():
127     """Return HTML Help Workshop executable path (Windows only)"""
128     if os.name == 'nt':
129         hhc_base = r'C:\Program Files%s\HTML Help Workshop\hhc.exe'
130         for hhc_exe in (hhc_base % '', hhc_base % ' (x86)'):
131             if osp.isfile(hhc_exe):
132                 return hhc_exe
133         else:
134             return
135 
136 try:
137     from sphinx import setup_command
138 
139     class MyBuild(build):
140         user_options = [('no-doc', None, "Don't build Spyder documentation")] \
141                        + build.user_options
142         def __init__(self, *args, **kwargs):
143             build.__init__(self, *args, **kwargs)
144             self.no_doc = False
145         def with_doc(self):
146             setup_dir = os.path.dirname(os.path.abspath(__file__))
147             is_doc_dir = os.path.isdir(os.path.join(setup_dir, 'doc'))
148             install_obj = self.distribution.get_command_obj('install')
149             return (is_doc_dir and not self.no_doc and not install_obj.no_doc)
150         sub_commands = build.sub_commands + [('build_doc', with_doc)]
151     CMDCLASS['build'] = MyBuild
152 
153 
154     class MyInstall(install):
155         user_options = [('no-doc', None, "Don't build Spyder documentation")] \
156                        + install.user_options
157         def __init__(self, *args, **kwargs):
158             install.__init__(self, *args, **kwargs)
159             self.no_doc = False
160     CMDCLASS['install'] = MyInstall
161 
162 
163     class MyBuildDoc(setup_command.BuildDoc):
164         def run(self):
165             build = self.get_finalized_command('build')
166             sys.path.insert(0, os.path.abspath(build.build_lib))
167             dirname = self.distribution.get_command_obj('build').build_purelib
168             self.builder_target_dir = osp.join(dirname, 'spyder', 'doc')
169 
170             if not osp.exists(self.builder_target_dir):
171                 os.mkdir(self.builder_target_dir)
172 
173             hhc_exe = get_html_help_exe()
174             self.builder = "html" if hhc_exe is None else "htmlhelp"
175 
176             try:
177                 setup_command.BuildDoc.run(self)
178             except UnicodeDecodeError:
179                 print("ERROR: unable to build documentation because Sphinx "\
180                       "do not handle source path with non-ASCII characters. "\
181                       "Please try to move the source package to another "\
182                       "location (path with *only* ASCII characters).",
183                       file=sys.stderr)
184             sys.path.pop(0)
185 
186             # Building chm doc, if HTML Help Workshop is installed
187             if hhc_exe is not None:
188                 fname = osp.join(self.builder_target_dir, 'Spyderdoc.chm')
189                 subprocess.call('"%s" %s' % (hhc_exe, fname), shell=True)
190                 if osp.isfile(fname):
191                     dest = osp.join(dirname, 'spyder')
192                     try:
193                         shutil.move(fname, dest)
194                     except shutil.Error:
195                         print("Unable to replace %s" % dest)
196                     shutil.rmtree(self.builder_target_dir)
197 
198     CMDCLASS['build_doc'] = MyBuildDoc
199 except ImportError:
200     print('WARNING: unable to build documentation because Sphinx '\
201           'is not installed', file=sys.stderr)
202 
203 
204 #==============================================================================
205 # Main scripts
206 #==============================================================================
207 # NOTE: the '[...]_win_post_install.py' script is installed even on non-Windows
208 # platforms due to a bug in pip installation process (see Issue 1158)
209 SCRIPTS = ['%s_win_post_install.py' % NAME]
210 if PY3 and sys.platform.startswith('linux'):
211     SCRIPTS.append('spyder3')
212 else:
213     SCRIPTS.append('spyder')
214 
215 
216 #==============================================================================
217 # Files added to the package
218 #==============================================================================
219 EXTLIST = ['.mo', '.svg', '.png', '.css', '.html', '.js', '.chm', '.ini',
220            '.txt', '.rst', '.qss', '.ttf', '.json', '.c', '.cpp', '.java',
221            '.md', '.R', '.csv', '.pyx', '.ipynb']
222 if os.name == 'nt':
223     SCRIPTS += ['spyder.bat']
224     EXTLIST += ['.ico']
225 
226 
227 #==============================================================================
228 # Setup arguments
229 #==============================================================================
230 setup_args = dict(name=NAME,
231       version=__version__,
232       description='Scientific PYthon Development EnviRonment',
233       long_description=
234 """Spyder is an interactive Python development environment providing
235 MATLAB-like features in a simple and light-weighted software.
236 It also provides ready-to-use pure-Python widgets to your PyQt5 or
237 PyQt4 application: source code editor with syntax highlighting and
238 code introspection/analysis features, NumPy array editor, dictionary
239 editor, Python console, etc.""",
240       download_url='%s/files/%s-%s.zip' % (__project_url__, NAME, __version__),
241       author="The Spyder Project Contributors",
242       url=__project_url__,
243       license='MIT',
244       keywords='PyQt5 PyQt4 editor shell console widgets IDE',
245       platforms=['any'],
246       packages=get_packages(),
247       package_data={LIBNAME: get_package_data(LIBNAME, EXTLIST),
248                     'spyder_breakpoints': get_package_data('spyder_breakpoints', EXTLIST),
249                     'spyder_profiler': get_package_data('spyder_profiler', EXTLIST),
250                     'spyder_pylint': get_package_data('spyder_pylint', EXTLIST),
251                     'spyder_io_dcm': get_package_data('spyder_io_dcm', EXTLIST),
252                     'spyder_io_hdf5': get_package_data('spyder_io_hdf5', EXTLIST),
253                     },
254       scripts=[osp.join('scripts', fname) for fname in SCRIPTS],
255       data_files=get_data_files(),
256       classifiers=['License :: OSI Approved :: MIT License',
257                    'Operating System :: MacOS',
258                    'Operating System :: Microsoft :: Windows',
259                    'Operating System :: POSIX :: Linux',
260                    'Programming Language :: Python :: 2.7',
261                    'Programming Language :: Python :: 3',
262                    'Development Status :: 5 - Production/Stable',
263                    'Topic :: Scientific/Engineering',
264                    'Topic :: Software Development :: Widget Sets'],
265       cmdclass=CMDCLASS)
266 
267 
268 #==============================================================================
269 # Setuptools deps
270 #==============================================================================
271 if any(arg == 'bdist_wheel' for arg in sys.argv):
272     import setuptools     # analysis:ignore
273 
274 install_requires = [
275     'rope_py3k' if PY3 else 'rope>=0.9.4',
276     'jedi>=0.9.0',
277     'pyflakes',
278     'pygments>=2.0',
279     'qtconsole>=4.2.0',
280     'nbconvert',
281     'sphinx',
282     'pycodestyle',
283     'pylint',
284     'psutil',
285     'qtawesome>=0.4.1',
286     'qtpy>=1.1.0',
287     'pickleshare',
288     'pyzmq',
289     'chardet>=2.0.0',
290     'numpydoc',
291 ]
292 
293 extras_require = {
294     'test:python_version == "2.7"': ['mock'],
295     'test': ['pytest',
296              'pytest-qt',
297              'pytest-cov',
298              'pytest-xvfb',
299              'mock',
300              'flaky',
301              'pandas',
302              'scipy',
303              'sympy',
304              'pillow',
305              'matplotlib',
306              'cython'],
307 }
308 
309 if 'setuptools' in sys.modules:
310     setup_args['install_requires'] = install_requires
311     setup_args['extras_require'] = extras_require
312 
313     setup_args['entry_points'] = {
314         'gui_scripts': [
315             '{} = spyder.app.start:main'.format(
316                 'spyder3' if PY3 else 'spyder')
317         ]
318     }
319 
320     setup_args.pop('scripts', None)
321 
322 
323 #==============================================================================
324 # Main setup
325 #==============================================================================
326 setup(**setup_args)
327
```
--- 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
@@ -272,7 +272,7 @@
     import setuptools     # analysis:ignore
 
 install_requires = [
-    'rope_py3k' if PY3 else 'rope>=0.9.4',
+    'rope>=0.10.5',
     'jedi>=0.9.0',
     'pyflakes',
     'pygments>=2.0',

{"golden_diff": "diff --git a/setup.py b/setup.py\n--- a/setup.py\n+++ b/setup.py\n@@ -272,7 +272,7 @@\n     import setuptools     # analysis:ignore\n \n install_requires = [\n-    'rope_py3k' if PY3 else 'rope>=0.9.4',\n+    'rope>=0.10.5',\n     'jedi>=0.9.0',\n     'pyflakes',\n     'pygments>=2.0',\n", "issue": "Move to support only Rope 0.10.5+\nThat's because 0.10.5 is the first version to support Python 2 and 3 in the same package.\n", "before_files": [{"content": "# -*- coding: utf-8 -*-\n#\n# Copyright \u00a9 Spyder Project Contributors\n# Licensed under the terms of the MIT License\n# (see spyder/__init__.py for details)\n\n\"\"\"\nSpyder\n======\n\nThe Scientific PYthon Development EnviRonment\n\"\"\"\n\nfrom __future__ import print_function\n\nimport os\nimport os.path as osp\nimport subprocess\nimport sys\nimport shutil\n\nfrom distutils.core import setup\nfrom distutils.command.build import build\nfrom distutils.command.install import install\nfrom distutils.command.install_data import install_data\n\n\n#==============================================================================\n# Check for Python 3\n#==============================================================================\nPY3 = sys.version_info[0] == 3\n\n\n#==============================================================================\n# Minimal Python version sanity check\n# Taken from the notebook setup.py -- Modified BSD License\n#==============================================================================\nv = sys.version_info\nif v[:2] < (2,7) or (v[0] >= 3 and v[:2] < (3,3)):\n    error = \"ERROR: Spyder requires Python version 2.7 or 3.3 or above.\"\n    print(error, file=sys.stderr)\n    sys.exit(1)\n\n\n#==============================================================================\n# Constants\n#==============================================================================\nNAME = 'spyder'\nLIBNAME = 'spyder'\nfrom spyder import __version__, __project_url__\n\n\n#==============================================================================\n# Auxiliary functions\n#==============================================================================\ndef get_package_data(name, extlist):\n    \"\"\"Return data files for package *name* with extensions in *extlist*\"\"\"\n    flist = []\n    # Workaround to replace os.path.relpath (not available until Python 2.6):\n    offset = len(name)+len(os.pathsep)\n    for dirpath, _dirnames, filenames in os.walk(name):\n        for fname in filenames:\n            if not fname.startswith('.') and osp.splitext(fname)[1] in extlist:\n                flist.append(osp.join(dirpath, fname)[offset:])\n    return flist\n\n\ndef get_subpackages(name):\n    \"\"\"Return subpackages of package *name*\"\"\"\n    splist = []\n    for dirpath, _dirnames, _filenames in os.walk(name):\n        if osp.isfile(osp.join(dirpath, '__init__.py')):\n            splist.append(\".\".join(dirpath.split(os.sep)))\n    return splist\n\n\ndef get_data_files():\n    \"\"\"Return data_files in a platform dependent manner\"\"\"\n    if sys.platform.startswith('linux'):\n        if PY3:\n            data_files = [('share/applications', ['scripts/spyder3.desktop']),\n                          ('share/pixmaps', ['img_src/spyder3.png']),\n                          ('share/metainfo', ['scripts/spyder3.appdata.xml'])]\n        else:\n            data_files = [('share/applications', ['scripts/spyder.desktop']),\n                          ('share/pixmaps', ['img_src/spyder.png'])]\n    elif os.name == 'nt':\n        data_files = [('scripts', ['img_src/spyder.ico',\n                                   'img_src/spyder_reset.ico'])]\n    else:\n        data_files = []\n    return data_files\n\n\ndef get_packages():\n    \"\"\"Return package list\"\"\"\n    packages = (\n        get_subpackages(LIBNAME)\n        + get_subpackages('spyder_breakpoints')\n        + get_subpackages('spyder_profiler')\n        + get_subpackages('spyder_pylint')\n        + get_subpackages('spyder_io_dcm')\n        + get_subpackages('spyder_io_hdf5')\n        )\n    return packages\n\n\n#==============================================================================\n# Make Linux detect Spyder desktop file\n#==============================================================================\nclass MyInstallData(install_data):\n    def run(self):\n        install_data.run(self)\n        if sys.platform.startswith('linux'):\n            try:\n                subprocess.call(['update-desktop-database'])\n            except:\n                print(\"ERROR: unable to update desktop database\",\n                      file=sys.stderr)\nCMDCLASS = {'install_data': MyInstallData}\n\n\n#==============================================================================\n# Sphinx build (documentation)\n#==============================================================================\ndef get_html_help_exe():\n    \"\"\"Return HTML Help Workshop executable path (Windows only)\"\"\"\n    if os.name == 'nt':\n        hhc_base = r'C:\\Program Files%s\\HTML Help Workshop\\hhc.exe'\n        for hhc_exe in (hhc_base % '', hhc_base % ' (x86)'):\n            if osp.isfile(hhc_exe):\n                return hhc_exe\n        else:\n            return\n\ntry:\n    from sphinx import setup_command\n\n    class MyBuild(build):\n        user_options = [('no-doc', None, \"Don't build Spyder documentation\")] \\\n                       + build.user_options\n        def __init__(self, *args, **kwargs):\n            build.__init__(self, *args, **kwargs)\n            self.no_doc = False\n        def with_doc(self):\n            setup_dir = os.path.dirname(os.path.abspath(__file__))\n            is_doc_dir = os.path.isdir(os.path.join(setup_dir, 'doc'))\n            install_obj = self.distribution.get_command_obj('install')\n            return (is_doc_dir and not self.no_doc and not install_obj.no_doc)\n        sub_commands = build.sub_commands + [('build_doc', with_doc)]\n    CMDCLASS['build'] = MyBuild\n\n\n    class MyInstall(install):\n        user_options = [('no-doc', None, \"Don't build Spyder documentation\")] \\\n                       + install.user_options\n        def __init__(self, *args, **kwargs):\n            install.__init__(self, *args, **kwargs)\n            self.no_doc = False\n    CMDCLASS['install'] = MyInstall\n\n\n    class MyBuildDoc(setup_command.BuildDoc):\n        def run(self):\n            build = self.get_finalized_command('build')\n            sys.path.insert(0, os.path.abspath(build.build_lib))\n            dirname = self.distribution.get_command_obj('build').build_purelib\n            self.builder_target_dir = osp.join(dirname, 'spyder', 'doc')\n\n            if not osp.exists(self.builder_target_dir):\n                os.mkdir(self.builder_target_dir)\n\n            hhc_exe = get_html_help_exe()\n            self.builder = \"html\" if hhc_exe is None else \"htmlhelp\"\n\n            try:\n                setup_command.BuildDoc.run(self)\n            except UnicodeDecodeError:\n                print(\"ERROR: unable to build documentation because Sphinx \"\\\n                      \"do not handle source path with non-ASCII characters. \"\\\n                      \"Please try to move the source package to another \"\\\n                      \"location (path with *only* ASCII characters).\",\n                      file=sys.stderr)\n            sys.path.pop(0)\n\n            # Building chm doc, if HTML Help Workshop is installed\n            if hhc_exe is not None:\n                fname = osp.join(self.builder_target_dir, 'Spyderdoc.chm')\n                subprocess.call('\"%s\" %s' % (hhc_exe, fname), shell=True)\n                if osp.isfile(fname):\n                    dest = osp.join(dirname, 'spyder')\n                    try:\n                        shutil.move(fname, dest)\n                    except shutil.Error:\n                        print(\"Unable to replace %s\" % dest)\n                    shutil.rmtree(self.builder_target_dir)\n\n    CMDCLASS['build_doc'] = MyBuildDoc\nexcept ImportError:\n    print('WARNING: unable to build documentation because Sphinx '\\\n          'is not installed', file=sys.stderr)\n\n\n#==============================================================================\n# Main scripts\n#==============================================================================\n# NOTE: the '[...]_win_post_install.py' script is installed even on non-Windows\n# platforms due to a bug in pip installation process (see Issue 1158)\nSCRIPTS = ['%s_win_post_install.py' % NAME]\nif PY3 and sys.platform.startswith('linux'):\n    SCRIPTS.append('spyder3')\nelse:\n    SCRIPTS.append('spyder')\n\n\n#==============================================================================\n# Files added to the package\n#==============================================================================\nEXTLIST = ['.mo', '.svg', '.png', '.css', '.html', '.js', '.chm', '.ini',\n           '.txt', '.rst', '.qss', '.ttf', '.json', '.c', '.cpp', '.java',\n           '.md', '.R', '.csv', '.pyx', '.ipynb']\nif os.name == 'nt':\n    SCRIPTS += ['spyder.bat']\n    EXTLIST += ['.ico']\n\n\n#==============================================================================\n# Setup arguments\n#==============================================================================\nsetup_args = dict(name=NAME,\n      version=__version__,\n      description='Scientific PYthon Development EnviRonment',\n      long_description=\n\"\"\"Spyder is an interactive Python development environment providing\nMATLAB-like features in a simple and light-weighted software.\nIt also provides ready-to-use pure-Python widgets to your PyQt5 or\nPyQt4 application: source code editor with syntax highlighting and\ncode introspection/analysis features, NumPy array editor, dictionary\neditor, Python console, etc.\"\"\",\n      download_url='%s/files/%s-%s.zip' % (__project_url__, NAME, __version__),\n      author=\"The Spyder Project Contributors\",\n      url=__project_url__,\n      license='MIT',\n      keywords='PyQt5 PyQt4 editor shell console widgets IDE',\n      platforms=['any'],\n      packages=get_packages(),\n      package_data={LIBNAME: get_package_data(LIBNAME, EXTLIST),\n                    'spyder_breakpoints': get_package_data('spyder_breakpoints', EXTLIST),\n                    'spyder_profiler': get_package_data('spyder_profiler', EXTLIST),\n                    'spyder_pylint': get_package_data('spyder_pylint', EXTLIST),\n                    'spyder_io_dcm': get_package_data('spyder_io_dcm', EXTLIST),\n                    'spyder_io_hdf5': get_package_data('spyder_io_hdf5', EXTLIST),\n                    },\n      scripts=[osp.join('scripts', fname) for fname in SCRIPTS],\n      data_files=get_data_files(),\n      classifiers=['License :: OSI Approved :: MIT License',\n                   'Operating System :: MacOS',\n                   'Operating System :: Microsoft :: Windows',\n                   'Operating System :: POSIX :: Linux',\n                   'Programming Language :: Python :: 2.7',\n                   'Programming Language :: Python :: 3',\n                   'Development Status :: 5 - Production/Stable',\n                   'Topic :: Scientific/Engineering',\n                   'Topic :: Software Development :: Widget Sets'],\n      cmdclass=CMDCLASS)\n\n\n#==============================================================================\n# Setuptools deps\n#==============================================================================\nif any(arg == 'bdist_wheel' for arg in sys.argv):\n    import setuptools     # analysis:ignore\n\ninstall_requires = [\n    'rope_py3k' if PY3 else 'rope>=0.9.4',\n    'jedi>=0.9.0',\n    'pyflakes',\n    'pygments>=2.0',\n    'qtconsole>=4.2.0',\n    'nbconvert',\n    'sphinx',\n    'pycodestyle',\n    'pylint',\n    'psutil',\n    'qtawesome>=0.4.1',\n    'qtpy>=1.1.0',\n    'pickleshare',\n    'pyzmq',\n    'chardet>=2.0.0',\n    'numpydoc',\n]\n\nextras_require = {\n    'test:python_version == \"2.7\"': ['mock'],\n    'test': ['pytest',\n             'pytest-qt',\n             'pytest-cov',\n             'pytest-xvfb',\n             'mock',\n             'flaky',\n             'pandas',\n             'scipy',\n             'sympy',\n             'pillow',\n             'matplotlib',\n             'cython'],\n}\n\nif 'setuptools' in sys.modules:\n    setup_args['install_requires'] = install_requires\n    setup_args['extras_require'] = extras_require\n\n    setup_args['entry_points'] = {\n        'gui_scripts': [\n            '{} = spyder.app.start:main'.format(\n                'spyder3' if PY3 else 'spyder')\n        ]\n    }\n\n    setup_args.pop('scripts', None)\n\n\n#==============================================================================\n# Main setup\n#==============================================================================\nsetup(**setup_args)\n", "path": "setup.py"}], "after_files": [{"content": "# -*- coding: utf-8 -*-\n#\n# Copyright \u00a9 Spyder Project Contributors\n# Licensed under the terms of the MIT License\n# (see spyder/__init__.py for details)\n\n\"\"\"\nSpyder\n======\n\nThe Scientific PYthon Development EnviRonment\n\"\"\"\n\nfrom __future__ import print_function\n\nimport os\nimport os.path as osp\nimport subprocess\nimport sys\nimport shutil\n\nfrom distutils.core import setup\nfrom distutils.command.build import build\nfrom distutils.command.install import install\nfrom distutils.command.install_data import install_data\n\n\n#==============================================================================\n# Check for Python 3\n#==============================================================================\nPY3 = sys.version_info[0] == 3\n\n\n#==============================================================================\n# Minimal Python version sanity check\n# Taken from the notebook setup.py -- Modified BSD License\n#==============================================================================\nv = sys.version_info\nif v[:2] < (2,7) or (v[0] >= 3 and v[:2] < (3,3)):\n    error = \"ERROR: Spyder requires Python version 2.7 or 3.3 or above.\"\n    print(error, file=sys.stderr)\n    sys.exit(1)\n\n\n#==============================================================================\n# Constants\n#==============================================================================\nNAME = 'spyder'\nLIBNAME = 'spyder'\nfrom spyder import __version__, __project_url__\n\n\n#==============================================================================\n# Auxiliary functions\n#==============================================================================\ndef get_package_data(name, extlist):\n    \"\"\"Return data files for package *name* with extensions in *extlist*\"\"\"\n    flist = []\n    # Workaround to replace os.path.relpath (not available until Python 2.6):\n    offset = len(name)+len(os.pathsep)\n    for dirpath, _dirnames, filenames in os.walk(name):\n        for fname in filenames:\n            if not fname.startswith('.') and osp.splitext(fname)[1] in extlist:\n                flist.append(osp.join(dirpath, fname)[offset:])\n    return flist\n\n\ndef get_subpackages(name):\n    \"\"\"Return subpackages of package *name*\"\"\"\n    splist = []\n    for dirpath, _dirnames, _filenames in os.walk(name):\n        if osp.isfile(osp.join(dirpath, '__init__.py')):\n            splist.append(\".\".join(dirpath.split(os.sep)))\n    return splist\n\n\ndef get_data_files():\n    \"\"\"Return data_files in a platform dependent manner\"\"\"\n    if sys.platform.startswith('linux'):\n        if PY3:\n            data_files = [('share/applications', ['scripts/spyder3.desktop']),\n                          ('share/pixmaps', ['img_src/spyder3.png']),\n                          ('share/metainfo', ['scripts/spyder3.appdata.xml'])]\n        else:\n            data_files = [('share/applications', ['scripts/spyder.desktop']),\n                          ('share/pixmaps', ['img_src/spyder.png'])]\n    elif os.name == 'nt':\n        data_files = [('scripts', ['img_src/spyder.ico',\n                                   'img_src/spyder_reset.ico'])]\n    else:\n        data_files = []\n    return data_files\n\n\ndef get_packages():\n    \"\"\"Return package list\"\"\"\n    packages = (\n        get_subpackages(LIBNAME)\n        + get_subpackages('spyder_breakpoints')\n        + get_subpackages('spyder_profiler')\n        + get_subpackages('spyder_pylint')\n        + get_subpackages('spyder_io_dcm')\n        + get_subpackages('spyder_io_hdf5')\n        )\n    return packages\n\n\n#==============================================================================\n# Make Linux detect Spyder desktop file\n#==============================================================================\nclass MyInstallData(install_data):\n    def run(self):\n        install_data.run(self)\n        if sys.platform.startswith('linux'):\n            try:\n                subprocess.call(['update-desktop-database'])\n            except:\n                print(\"ERROR: unable to update desktop database\",\n                      file=sys.stderr)\nCMDCLASS = {'install_data': MyInstallData}\n\n\n#==============================================================================\n# Sphinx build (documentation)\n#==============================================================================\ndef get_html_help_exe():\n    \"\"\"Return HTML Help Workshop executable path (Windows only)\"\"\"\n    if os.name == 'nt':\n        hhc_base = r'C:\\Program Files%s\\HTML Help Workshop\\hhc.exe'\n        for hhc_exe in (hhc_base % '', hhc_base % ' (x86)'):\n            if osp.isfile(hhc_exe):\n                return hhc_exe\n        else:\n            return\n\ntry:\n    from sphinx import setup_command\n\n    class MyBuild(build):\n        user_options = [('no-doc', None, \"Don't build Spyder documentation\")] \\\n                       + build.user_options\n        def __init__(self, *args, **kwargs):\n            build.__init__(self, *args, **kwargs)\n            self.no_doc = False\n        def with_doc(self):\n            setup_dir = os.path.dirname(os.path.abspath(__file__))\n            is_doc_dir = os.path.isdir(os.path.join(setup_dir, 'doc'))\n            install_obj = self.distribution.get_command_obj('install')\n            return (is_doc_dir and not self.no_doc and not install_obj.no_doc)\n        sub_commands = build.sub_commands + [('build_doc', with_doc)]\n    CMDCLASS['build'] = MyBuild\n\n\n    class MyInstall(install):\n        user_options = [('no-doc', None, \"Don't build Spyder documentation\")] \\\n                       + install.user_options\n        def __init__(self, *args, **kwargs):\n            install.__init__(self, *args, **kwargs)\n            self.no_doc = False\n    CMDCLASS['install'] = MyInstall\n\n\n    class MyBuildDoc(setup_command.BuildDoc):\n        def run(self):\n            build = self.get_finalized_command('build')\n            sys.path.insert(0, os.path.abspath(build.build_lib))\n            dirname = self.distribution.get_command_obj('build').build_purelib\n            self.builder_target_dir = osp.join(dirname, 'spyder', 'doc')\n\n            if not osp.exists(self.builder_target_dir):\n                os.mkdir(self.builder_target_dir)\n\n            hhc_exe = get_html_help_exe()\n            self.builder = \"html\" if hhc_exe is None else \"htmlhelp\"\n\n            try:\n                setup_command.BuildDoc.run(self)\n            except UnicodeDecodeError:\n                print(\"ERROR: unable to build documentation because Sphinx \"\\\n                      \"do not handle source path with non-ASCII characters. \"\\\n                      \"Please try to move the source package to another \"\\\n                      \"location (path with *only* ASCII characters).\",\n                      file=sys.stderr)\n            sys.path.pop(0)\n\n            # Building chm doc, if HTML Help Workshop is installed\n            if hhc_exe is not None:\n                fname = osp.join(self.builder_target_dir, 'Spyderdoc.chm')\n                subprocess.call('\"%s\" %s' % (hhc_exe, fname), shell=True)\n                if osp.isfile(fname):\n                    dest = osp.join(dirname, 'spyder')\n                    try:\n                        shutil.move(fname, dest)\n                    except shutil.Error:\n                        print(\"Unable to replace %s\" % dest)\n                    shutil.rmtree(self.builder_target_dir)\n\n    CMDCLASS['build_doc'] = MyBuildDoc\nexcept ImportError:\n    print('WARNING: unable to build documentation because Sphinx '\\\n          'is not installed', file=sys.stderr)\n\n\n#==============================================================================\n# Main scripts\n#==============================================================================\n# NOTE: the '[...]_win_post_install.py' script is installed even on non-Windows\n# platforms due to a bug in pip installation process (see Issue 1158)\nSCRIPTS = ['%s_win_post_install.py' % NAME]\nif PY3 and sys.platform.startswith('linux'):\n    SCRIPTS.append('spyder3')\nelse:\n    SCRIPTS.append('spyder')\n\n\n#==============================================================================\n# Files added to the package\n#==============================================================================\nEXTLIST = ['.mo', '.svg', '.png', '.css', '.html', '.js', '.chm', '.ini',\n           '.txt', '.rst', '.qss', '.ttf', '.json', '.c', '.cpp', '.java',\n           '.md', '.R', '.csv', '.pyx', '.ipynb']\nif os.name == 'nt':\n    SCRIPTS += ['spyder.bat']\n    EXTLIST += ['.ico']\n\n\n#==============================================================================\n# Setup arguments\n#==============================================================================\nsetup_args = dict(name=NAME,\n      version=__version__,\n      description='Scientific PYthon Development EnviRonment',\n      long_description=\n\"\"\"Spyder is an interactive Python development environment providing\nMATLAB-like features in a simple and light-weighted software.\nIt also provides ready-to-use pure-Python widgets to your PyQt5 or\nPyQt4 application: source code editor with syntax highlighting and\ncode introspection/analysis features, NumPy array editor, dictionary\neditor, Python console, etc.\"\"\",\n      download_url='%s/files/%s-%s.zip' % (__project_url__, NAME, __version__),\n      author=\"The Spyder Project Contributors\",\n      url=__project_url__,\n      license='MIT',\n      keywords='PyQt5 PyQt4 editor shell console widgets IDE',\n      platforms=['any'],\n      packages=get_packages(),\n      package_data={LIBNAME: get_package_data(LIBNAME, EXTLIST),\n                    'spyder_breakpoints': get_package_data('spyder_breakpoints', EXTLIST),\n                    'spyder_profiler': get_package_data('spyder_profiler', EXTLIST),\n                    'spyder_pylint': get_package_data('spyder_pylint', EXTLIST),\n                    'spyder_io_dcm': get_package_data('spyder_io_dcm', EXTLIST),\n                    'spyder_io_hdf5': get_package_data('spyder_io_hdf5', EXTLIST),\n                    },\n      scripts=[osp.join('scripts', fname) for fname in SCRIPTS],\n      data_files=get_data_files(),\n      classifiers=['License :: OSI Approved :: MIT License',\n                   'Operating System :: MacOS',\n                   'Operating System :: Microsoft :: Windows',\n                   'Operating System :: POSIX :: Linux',\n                   'Programming Language :: Python :: 2.7',\n                   'Programming Language :: Python :: 3',\n                   'Development Status :: 5 - Production/Stable',\n                   'Topic :: Scientific/Engineering',\n                   'Topic :: Software Development :: Widget Sets'],\n      cmdclass=CMDCLASS)\n\n\n#==============================================================================\n# Setuptools deps\n#==============================================================================\nif any(arg == 'bdist_wheel' for arg in sys.argv):\n    import setuptools     # analysis:ignore\n\ninstall_requires = [\n    'rope>=0.10.5',\n    'jedi>=0.9.0',\n    'pyflakes',\n    'pygments>=2.0',\n    'qtconsole>=4.2.0',\n    'nbconvert',\n    'sphinx',\n    'pycodestyle',\n    'pylint',\n    'psutil',\n    'qtawesome>=0.4.1',\n    'qtpy>=1.1.0',\n    'pickleshare',\n    'pyzmq',\n    'chardet>=2.0.0',\n    'numpydoc',\n]\n\nextras_require = {\n    'test:python_version == \"2.7\"': ['mock'],\n    'test': ['pytest',\n             'pytest-qt',\n             'pytest-cov',\n             'pytest-xvfb',\n             'mock',\n             'flaky',\n             'pandas',\n             'scipy',\n             'sympy',\n             'pillow',\n             'matplotlib',\n             'cython'],\n}\n\nif 'setuptools' in sys.modules:\n    setup_args['install_requires'] = install_requires\n    setup_args['extras_require'] = extras_require\n\n    setup_args['entry_points'] = {\n        'gui_scripts': [\n            '{} = spyder.app.start:main'.format(\n                'spyder3' if PY3 else 'spyder')\n        ]\n    }\n\n    setup_args.pop('scripts', None)\n\n\n#==============================================================================\n# Main setup\n#==============================================================================\nsetup(**setup_args)\n", "path": "setup.py"}]}