We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
There is a desktop file missing in a Linux version
##### Orange version

3.3.1.dev0
##### Expected bahavior

/usr/share/applications directory is populated with a orange.desktop file providing a desktop icon on Linux machines.
##### Actual behavior

That doesn't happen - the /usr/share/applications/orange.desktop file is missing.
##### Steps to reproduce the behavior

Install Orange on a Linux machine.


--- 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 python3
2 
3 import os
4 import sys
5 import subprocess
6 from setuptools import find_packages, Command
7 
8 if sys.version_info < (3, 4):
9     sys.exit('Orange requires Python >= 3.4')
10 try:
11     from numpy.distutils.core import setup
12 except ImportError:
13     sys.exit('setup requires numpy; install numpy first')
14 
15 NAME = 'Orange'
16 
17 VERSION = '3.3.2'
18 ISRELEASED = False
19 
20 DESCRIPTION = 'Orange, a component-based data mining framework.'
21 README_FILE = os.path.join(os.path.dirname(__file__), 'README.md')
22 LONG_DESCRIPTION = open(README_FILE).read()
23 AUTHOR = 'Bioinformatics Laboratory, FRI UL'
24 AUTHOR_EMAIL = 'info@biolab.si'
25 URL = 'http://orange.biolab.si/'
26 LICENSE = 'GPLv3+'
27 
28 KEYWORDS = (
29     'data mining',
30     'machine learning',
31     'artificial intelligence',
32 )
33 
34 CLASSIFIERS = (
35     'Development Status :: 4 - Beta',
36     'Environment :: X11 Applications :: Qt',
37     'Environment :: Console',
38     'Environment :: Plugins',
39     'Programming Language :: Python',
40     'Framework :: Orange',
41     'License :: OSI Approved :: '
42     'GNU General Public License v3 or later (GPLv3+)',
43     'Operating System :: POSIX',
44     'Operating System :: Microsoft :: Windows',
45     'Topic :: Scientific/Engineering :: Artificial Intelligence',
46     'Topic :: Scientific/Engineering :: Visualization',
47     'Topic :: Software Development :: Libraries :: Python Modules',
48     'Intended Audience :: Education',
49     'Intended Audience :: Science/Research',
50     'Intended Audience :: Developers',
51 )
52 
53 requirements = ['requirements-core.txt', 'requirements-gui.txt']
54 
55 INSTALL_REQUIRES = sorted(set(
56     line.partition('#')[0].strip()
57     for file in (os.path.join(os.path.dirname(__file__), file)
58                  for file in requirements)
59     for line in open(file)
60 ) - {''})
61 
62 ENTRY_POINTS = {
63     "orange.canvas.help": (
64         "html-index = Orange.widgets:WIDGET_HELP_PATH",
65     ),
66     "gui_scripts": (
67         "orange-canvas = Orange.canvas.__main__:main",
68     ),
69 }
70 
71 
72 # Return the git revision as a string
73 def git_version():
74     """Return the git revision as a string.
75 
76     Copied from numpy setup.py
77     """
78     def _minimal_ext_cmd(cmd):
79         # construct minimal environment
80         env = {}
81         for k in ['SYSTEMROOT', 'PATH']:
82             v = os.environ.get(k)
83             if v is not None:
84                 env[k] = v
85         # LANGUAGE is used on win32
86         env['LANGUAGE'] = 'C'
87         env['LANG'] = 'C'
88         env['LC_ALL'] = 'C'
89         out = subprocess.Popen(cmd, stdout = subprocess.PIPE, env=env).communicate()[0]
90         return out
91 
92     try:
93         out = _minimal_ext_cmd(['git', 'rev-parse', 'HEAD'])
94         GIT_REVISION = out.strip().decode('ascii')
95     except OSError:
96         GIT_REVISION = "Unknown"
97     return GIT_REVISION
98 
99 
100 def write_version_py(filename='Orange/version.py'):
101     # Copied from numpy setup.py
102     cnt = """
103 # THIS FILE IS GENERATED FROM ORANGE SETUP.PY
104 short_version = '%(version)s'
105 version = '%(version)s'
106 full_version = '%(full_version)s'
107 git_revision = '%(git_revision)s'
108 release = %(isrelease)s
109 
110 if not release:
111     version = full_version
112     short_version += ".dev"
113 """
114     FULLVERSION = VERSION
115     if os.path.exists('.git'):
116         GIT_REVISION = git_version()
117     elif os.path.exists('Orange/version.py'):
118         # must be a source distribution, use existing version file
119         import imp
120         version = imp.load_source("Orange.version", "Orange/version.py")
121         GIT_REVISION = version.git_revision
122     else:
123         GIT_REVISION = "Unknown"
124 
125     if not ISRELEASED:
126         FULLVERSION += '.dev0+' + GIT_REVISION[:7]
127 
128     a = open(filename, 'w')
129     try:
130         a.write(cnt % {'version': VERSION,
131                        'full_version': FULLVERSION,
132                        'git_revision': GIT_REVISION,
133                        'isrelease': str(ISRELEASED)})
134     finally:
135         a.close()
136 
137 
138 def configuration(parent_package='', top_path=None):
139     if os.path.exists('MANIFEST'):
140         os.remove('MANIFEST')
141 
142     from numpy.distutils.misc_util import Configuration
143     config = Configuration(None, parent_package, top_path)
144 
145     # Avoid non-useful msg:
146     # "Ignoring attempt to set 'name' (from ... "
147     config.set_options(ignore_setup_xxx_py=True,
148                        assume_default_configuration=True,
149                        delegate_options_to_subpackages=True,
150                        quiet=True)
151 
152     config.add_subpackage('Orange')
153 
154     config.get_version('Orange/version.py')  # sets config.version
155 
156     return config
157 
158 
159 PACKAGES = find_packages()
160 
161 # Extra non .py, .{so,pyd} files that are installed within the package dir
162 # hierarchy
163 PACKAGE_DATA = {
164     "Orange": ["datasets/*.{}".format(ext)
165                for ext in ["tab", "csv", "basket", "info"]],
166     "Orange.canvas": ["icons/*.png", "icons/*.svg"],
167     "Orange.canvas.styles": ["*.qss", "orange/*.svg"],
168     "Orange.canvas.application.tutorials": ["*.ows"],
169     "Orange.canvas.report": ["icons/*.svg", "*.html"],
170     "Orange.widgets": ["icons/*.png", "icons/*.svg"],
171     "Orange.widgets.classify": ["icons/*.svg"],
172     "Orange.widgets.data": ["icons/*.svg",
173                             "icons/paintdata/*.png",
174                             "icons/paintdata/*.svg"],
175     "Orange.widgets.evaluate": ["icons/*.svg"],
176     "Orange.widgets.visualize": ["icons/*.svg"],
177     "Orange.widgets.regression": ["icons/*.svg"],
178     "Orange.widgets.unsupervised": ["icons/*.svg"],
179     "Orange.widgets.utils.plot": ["*.fs", "*.gs", "*.vs"],
180     "Orange.widgets.utils.plot.primitives": ["*.obj"],
181     "Orange.tests": ["xlsx_files/*.xlsx", "*.tab", "*.basket", "*.csv"]
182 }
183 
184 
185 class LintCommand(Command):
186     """A setup.py lint subcommand developers can run locally."""
187     description = "run code linter(s)"
188     user_options = []
189     initialize_options = finalize_options = lambda self: None
190 
191     def run(self):
192         """Lint current branch compared to a reasonable master branch"""
193         sys.exit(subprocess.call(r'''
194         set -eu
195         upstream="$(git remote -v |
196                     awk '/[@\/]github.com[:\/]biolab\/orange3[\. ]/{ print $1; exit }')"
197         git fetch -q $upstream master
198         best_ancestor=$(git merge-base HEAD refs/remotes/$upstream/master)
199         .travis/check_pylint_diff $best_ancestor
200         ''', shell=True, cwd=os.path.dirname(os.path.abspath(__file__))))
201 
202 class CoverageCommand(Command):
203     """A setup.py coverage subcommand developers can run locally."""
204     description = "run code coverage"
205     user_options = []
206     initialize_options = finalize_options = lambda self: None
207 
208     def run(self):
209         """Check coverage on current workdir"""
210         sys.exit(subprocess.call(r'''
211         coverage run --source=Orange -m unittest -v Orange.tests
212         echo; echo
213         coverage report
214         coverage html &&
215             { echo; echo "See also: file://$(pwd)/htmlcov/index.html"; echo; }
216         ''', shell=True, cwd=os.path.dirname(os.path.abspath(__file__))))
217 
218 
219 
220 
221 def setup_package():
222     write_version_py()
223     setup(
224         configuration=configuration,
225         name=NAME,
226         description=DESCRIPTION,
227         long_description=LONG_DESCRIPTION,
228         author=AUTHOR,
229         author_email=AUTHOR_EMAIL,
230         url=URL,
231         license=LICENSE,
232         keywords=KEYWORDS,
233         classifiers=CLASSIFIERS,
234         packages=PACKAGES,
235         package_data=PACKAGE_DATA,
236         install_requires=INSTALL_REQUIRES,
237         entry_points=ENTRY_POINTS,
238         zip_safe=False,
239         test_suite='Orange.tests.test_suite',
240         cmdclass={
241             'lint': LintCommand,
242             'coverage': CoverageCommand,
243         },
244     )
245 
246 if __name__ == '__main__':
247     setup_package()
248
```
--- 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
@@ -216,6 +216,38 @@
         ''', shell=True, cwd=os.path.dirname(os.path.abspath(__file__))))
 
 
+# Install desktop file and icon on GNU/Linux/BSD
+DATA_FILES = []
+if any(sys.platform.startswith(platform)
+       for platform in ('linux', 'freebsd')):
+    # Patch desktop file executable to work with virtualenv
+    try:
+        sys.real_prefix
+    except AttributeError:
+        pass  # Not in virtualenv
+    else:
+        with open(os.path.join(os.path.dirname(__file__),
+                               'distribute',
+                               'orange-canvas.desktop'), 'r+') as desktop:
+            spec = []
+            for line in desktop:
+                if line.startswith('Exec='):
+                    line = 'Exec="{}" -m Orange.canvas\n'.format(sys.executable)
+                spec.append(line)
+            desktop.seek(0)
+            desktop.truncate(0)
+            desktop.writelines(spec)
+
+    usr_share = os.path.join(sys.prefix, "share")
+    if not usr_share.startswith('/usr/') or not os.access(usr_share, os.W_OK):
+        usr_share = os.environ.get('XDG_DATA_HOME',
+                                   os.path.expanduser('~/.local/share'))
+    DATA_FILES += [
+        (os.path.join(usr_share, 'applications'),
+         ['distribute/orange-canvas.desktop']),
+        (os.path.join(usr_share, 'icons', 'hicolor', 'scalable', 'apps'),
+         ['distribute/orange-canvas.svg'])
+    ]
 
 
 def setup_package():
@@ -235,6 +267,7 @@
         package_data=PACKAGE_DATA,
         install_requires=INSTALL_REQUIRES,
         entry_points=ENTRY_POINTS,
+        data_files=DATA_FILES,
         zip_safe=False,
         test_suite='Orange.tests.test_suite',
         cmdclass={

{"golden_diff": "diff --git a/setup.py b/setup.py\n--- a/setup.py\n+++ b/setup.py\n@@ -216,6 +216,38 @@\n         ''', shell=True, cwd=os.path.dirname(os.path.abspath(__file__))))\n \n \n+# Install desktop file and icon on GNU/Linux/BSD\n+DATA_FILES = []\n+if any(sys.platform.startswith(platform)\n+       for platform in ('linux', 'freebsd')):\n+    # Patch desktop file executable to work with virtualenv\n+    try:\n+        sys.real_prefix\n+    except AttributeError:\n+        pass  # Not in virtualenv\n+    else:\n+        with open(os.path.join(os.path.dirname(__file__),\n+                               'distribute',\n+                               'orange-canvas.desktop'), 'r+') as desktop:\n+            spec = []\n+            for line in desktop:\n+                if line.startswith('Exec='):\n+                    line = 'Exec=\"{}\" -m Orange.canvas\\n'.format(sys.executable)\n+                spec.append(line)\n+            desktop.seek(0)\n+            desktop.truncate(0)\n+            desktop.writelines(spec)\n+\n+    usr_share = os.path.join(sys.prefix, \"share\")\n+    if not usr_share.startswith('/usr/') or not os.access(usr_share, os.W_OK):\n+        usr_share = os.environ.get('XDG_DATA_HOME',\n+                                   os.path.expanduser('~/.local/share'))\n+    DATA_FILES += [\n+        (os.path.join(usr_share, 'applications'),\n+         ['distribute/orange-canvas.desktop']),\n+        (os.path.join(usr_share, 'icons', 'hicolor', 'scalable', 'apps'),\n+         ['distribute/orange-canvas.svg'])\n+    ]\n \n \n def setup_package():\n@@ -235,6 +267,7 @@\n         package_data=PACKAGE_DATA,\n         install_requires=INSTALL_REQUIRES,\n         entry_points=ENTRY_POINTS,\n+        data_files=DATA_FILES,\n         zip_safe=False,\n         test_suite='Orange.tests.test_suite',\n         cmdclass={\n", "issue": "There is a desktop file missing in a Linux version\n##### Orange version\n\n3.3.1.dev0\n##### Expected bahavior\n\n/usr/share/applications directory is populated with a orange.desktop file providing a desktop icon on Linux machines.\n##### Actual behavior\n\nThat doesn't happen - the /usr/share/applications/orange.desktop file is missing.\n##### Steps to reproduce the behavior\n\nInstall Orange on a Linux machine.\n\n", "before_files": [{"content": "#! /usr/bin/env python3\n\nimport os\nimport sys\nimport subprocess\nfrom setuptools import find_packages, Command\n\nif sys.version_info < (3, 4):\n    sys.exit('Orange requires Python >= 3.4')\ntry:\n    from numpy.distutils.core import setup\nexcept ImportError:\n    sys.exit('setup requires numpy; install numpy first')\n\nNAME = 'Orange'\n\nVERSION = '3.3.2'\nISRELEASED = False\n\nDESCRIPTION = 'Orange, a component-based data mining framework.'\nREADME_FILE = os.path.join(os.path.dirname(__file__), 'README.md')\nLONG_DESCRIPTION = open(README_FILE).read()\nAUTHOR = 'Bioinformatics Laboratory, FRI UL'\nAUTHOR_EMAIL = 'info@biolab.si'\nURL = 'http://orange.biolab.si/'\nLICENSE = 'GPLv3+'\n\nKEYWORDS = (\n    'data mining',\n    'machine learning',\n    'artificial intelligence',\n)\n\nCLASSIFIERS = (\n    'Development Status :: 4 - Beta',\n    'Environment :: X11 Applications :: Qt',\n    'Environment :: Console',\n    'Environment :: Plugins',\n    'Programming Language :: Python',\n    'Framework :: Orange',\n    'License :: OSI Approved :: '\n    'GNU General Public License v3 or later (GPLv3+)',\n    'Operating System :: POSIX',\n    'Operating System :: Microsoft :: Windows',\n    'Topic :: Scientific/Engineering :: Artificial Intelligence',\n    'Topic :: Scientific/Engineering :: Visualization',\n    'Topic :: Software Development :: Libraries :: Python Modules',\n    'Intended Audience :: Education',\n    'Intended Audience :: Science/Research',\n    'Intended Audience :: Developers',\n)\n\nrequirements = ['requirements-core.txt', 'requirements-gui.txt']\n\nINSTALL_REQUIRES = sorted(set(\n    line.partition('#')[0].strip()\n    for file in (os.path.join(os.path.dirname(__file__), file)\n                 for file in requirements)\n    for line in open(file)\n) - {''})\n\nENTRY_POINTS = {\n    \"orange.canvas.help\": (\n        \"html-index = Orange.widgets:WIDGET_HELP_PATH\",\n    ),\n    \"gui_scripts\": (\n        \"orange-canvas = Orange.canvas.__main__:main\",\n    ),\n}\n\n\n# Return the git revision as a string\ndef git_version():\n    \"\"\"Return the git revision as a string.\n\n    Copied from numpy setup.py\n    \"\"\"\n    def _minimal_ext_cmd(cmd):\n        # construct minimal environment\n        env = {}\n        for k in ['SYSTEMROOT', 'PATH']:\n            v = os.environ.get(k)\n            if v is not None:\n                env[k] = v\n        # LANGUAGE is used on win32\n        env['LANGUAGE'] = 'C'\n        env['LANG'] = 'C'\n        env['LC_ALL'] = 'C'\n        out = subprocess.Popen(cmd, stdout = subprocess.PIPE, env=env).communicate()[0]\n        return out\n\n    try:\n        out = _minimal_ext_cmd(['git', 'rev-parse', 'HEAD'])\n        GIT_REVISION = out.strip().decode('ascii')\n    except OSError:\n        GIT_REVISION = \"Unknown\"\n    return GIT_REVISION\n\n\ndef write_version_py(filename='Orange/version.py'):\n    # Copied from numpy setup.py\n    cnt = \"\"\"\n# THIS FILE IS GENERATED FROM ORANGE SETUP.PY\nshort_version = '%(version)s'\nversion = '%(version)s'\nfull_version = '%(full_version)s'\ngit_revision = '%(git_revision)s'\nrelease = %(isrelease)s\n\nif not release:\n    version = full_version\n    short_version += \".dev\"\n\"\"\"\n    FULLVERSION = VERSION\n    if os.path.exists('.git'):\n        GIT_REVISION = git_version()\n    elif os.path.exists('Orange/version.py'):\n        # must be a source distribution, use existing version file\n        import imp\n        version = imp.load_source(\"Orange.version\", \"Orange/version.py\")\n        GIT_REVISION = version.git_revision\n    else:\n        GIT_REVISION = \"Unknown\"\n\n    if not ISRELEASED:\n        FULLVERSION += '.dev0+' + GIT_REVISION[:7]\n\n    a = open(filename, 'w')\n    try:\n        a.write(cnt % {'version': VERSION,\n                       'full_version': FULLVERSION,\n                       'git_revision': GIT_REVISION,\n                       'isrelease': str(ISRELEASED)})\n    finally:\n        a.close()\n\n\ndef configuration(parent_package='', top_path=None):\n    if os.path.exists('MANIFEST'):\n        os.remove('MANIFEST')\n\n    from numpy.distutils.misc_util import Configuration\n    config = Configuration(None, parent_package, top_path)\n\n    # Avoid non-useful msg:\n    # \"Ignoring attempt to set 'name' (from ... \"\n    config.set_options(ignore_setup_xxx_py=True,\n                       assume_default_configuration=True,\n                       delegate_options_to_subpackages=True,\n                       quiet=True)\n\n    config.add_subpackage('Orange')\n\n    config.get_version('Orange/version.py')  # sets config.version\n\n    return config\n\n\nPACKAGES = find_packages()\n\n# Extra non .py, .{so,pyd} files that are installed within the package dir\n# hierarchy\nPACKAGE_DATA = {\n    \"Orange\": [\"datasets/*.{}\".format(ext)\n               for ext in [\"tab\", \"csv\", \"basket\", \"info\"]],\n    \"Orange.canvas\": [\"icons/*.png\", \"icons/*.svg\"],\n    \"Orange.canvas.styles\": [\"*.qss\", \"orange/*.svg\"],\n    \"Orange.canvas.application.tutorials\": [\"*.ows\"],\n    \"Orange.canvas.report\": [\"icons/*.svg\", \"*.html\"],\n    \"Orange.widgets\": [\"icons/*.png\", \"icons/*.svg\"],\n    \"Orange.widgets.classify\": [\"icons/*.svg\"],\n    \"Orange.widgets.data\": [\"icons/*.svg\",\n                            \"icons/paintdata/*.png\",\n                            \"icons/paintdata/*.svg\"],\n    \"Orange.widgets.evaluate\": [\"icons/*.svg\"],\n    \"Orange.widgets.visualize\": [\"icons/*.svg\"],\n    \"Orange.widgets.regression\": [\"icons/*.svg\"],\n    \"Orange.widgets.unsupervised\": [\"icons/*.svg\"],\n    \"Orange.widgets.utils.plot\": [\"*.fs\", \"*.gs\", \"*.vs\"],\n    \"Orange.widgets.utils.plot.primitives\": [\"*.obj\"],\n    \"Orange.tests\": [\"xlsx_files/*.xlsx\", \"*.tab\", \"*.basket\", \"*.csv\"]\n}\n\n\nclass LintCommand(Command):\n    \"\"\"A setup.py lint subcommand developers can run locally.\"\"\"\n    description = \"run code linter(s)\"\n    user_options = []\n    initialize_options = finalize_options = lambda self: None\n\n    def run(self):\n        \"\"\"Lint current branch compared to a reasonable master branch\"\"\"\n        sys.exit(subprocess.call(r'''\n        set -eu\n        upstream=\"$(git remote -v |\n                    awk '/[@\\/]github.com[:\\/]biolab\\/orange3[\\. ]/{ print $1; exit }')\"\n        git fetch -q $upstream master\n        best_ancestor=$(git merge-base HEAD refs/remotes/$upstream/master)\n        .travis/check_pylint_diff $best_ancestor\n        ''', shell=True, cwd=os.path.dirname(os.path.abspath(__file__))))\n\nclass CoverageCommand(Command):\n    \"\"\"A setup.py coverage subcommand developers can run locally.\"\"\"\n    description = \"run code coverage\"\n    user_options = []\n    initialize_options = finalize_options = lambda self: None\n\n    def run(self):\n        \"\"\"Check coverage on current workdir\"\"\"\n        sys.exit(subprocess.call(r'''\n        coverage run --source=Orange -m unittest -v Orange.tests\n        echo; echo\n        coverage report\n        coverage html &&\n            { echo; echo \"See also: file://$(pwd)/htmlcov/index.html\"; echo; }\n        ''', shell=True, cwd=os.path.dirname(os.path.abspath(__file__))))\n\n\n\n\ndef setup_package():\n    write_version_py()\n    setup(\n        configuration=configuration,\n        name=NAME,\n        description=DESCRIPTION,\n        long_description=LONG_DESCRIPTION,\n        author=AUTHOR,\n        author_email=AUTHOR_EMAIL,\n        url=URL,\n        license=LICENSE,\n        keywords=KEYWORDS,\n        classifiers=CLASSIFIERS,\n        packages=PACKAGES,\n        package_data=PACKAGE_DATA,\n        install_requires=INSTALL_REQUIRES,\n        entry_points=ENTRY_POINTS,\n        zip_safe=False,\n        test_suite='Orange.tests.test_suite',\n        cmdclass={\n            'lint': LintCommand,\n            'coverage': CoverageCommand,\n        },\n    )\n\nif __name__ == '__main__':\n    setup_package()\n", "path": "setup.py"}], "after_files": [{"content": "#! /usr/bin/env python3\n\nimport os\nimport sys\nimport subprocess\nfrom setuptools import find_packages, Command\n\nif sys.version_info < (3, 4):\n    sys.exit('Orange requires Python >= 3.4')\ntry:\n    from numpy.distutils.core import setup\nexcept ImportError:\n    sys.exit('setup requires numpy; install numpy first')\n\nNAME = 'Orange'\n\nVERSION = '3.3.2'\nISRELEASED = False\n\nDESCRIPTION = 'Orange, a component-based data mining framework.'\nREADME_FILE = os.path.join(os.path.dirname(__file__), 'README.md')\nLONG_DESCRIPTION = open(README_FILE).read()\nAUTHOR = 'Bioinformatics Laboratory, FRI UL'\nAUTHOR_EMAIL = 'info@biolab.si'\nURL = 'http://orange.biolab.si/'\nLICENSE = 'GPLv3+'\n\nKEYWORDS = (\n    'data mining',\n    'machine learning',\n    'artificial intelligence',\n)\n\nCLASSIFIERS = (\n    'Development Status :: 4 - Beta',\n    'Environment :: X11 Applications :: Qt',\n    'Environment :: Console',\n    'Environment :: Plugins',\n    'Programming Language :: Python',\n    'Framework :: Orange',\n    'License :: OSI Approved :: '\n    'GNU General Public License v3 or later (GPLv3+)',\n    'Operating System :: POSIX',\n    'Operating System :: Microsoft :: Windows',\n    'Topic :: Scientific/Engineering :: Artificial Intelligence',\n    'Topic :: Scientific/Engineering :: Visualization',\n    'Topic :: Software Development :: Libraries :: Python Modules',\n    'Intended Audience :: Education',\n    'Intended Audience :: Science/Research',\n    'Intended Audience :: Developers',\n)\n\nrequirements = ['requirements-core.txt', 'requirements-gui.txt']\n\nINSTALL_REQUIRES = sorted(set(\n    line.partition('#')[0].strip()\n    for file in (os.path.join(os.path.dirname(__file__), file)\n                 for file in requirements)\n    for line in open(file)\n) - {''})\n\nENTRY_POINTS = {\n    \"orange.canvas.help\": (\n        \"html-index = Orange.widgets:WIDGET_HELP_PATH\",\n    ),\n    \"gui_scripts\": (\n        \"orange-canvas = Orange.canvas.__main__:main\",\n    ),\n}\n\n\n# Return the git revision as a string\ndef git_version():\n    \"\"\"Return the git revision as a string.\n\n    Copied from numpy setup.py\n    \"\"\"\n    def _minimal_ext_cmd(cmd):\n        # construct minimal environment\n        env = {}\n        for k in ['SYSTEMROOT', 'PATH']:\n            v = os.environ.get(k)\n            if v is not None:\n                env[k] = v\n        # LANGUAGE is used on win32\n        env['LANGUAGE'] = 'C'\n        env['LANG'] = 'C'\n        env['LC_ALL'] = 'C'\n        out = subprocess.Popen(cmd, stdout = subprocess.PIPE, env=env).communicate()[0]\n        return out\n\n    try:\n        out = _minimal_ext_cmd(['git', 'rev-parse', 'HEAD'])\n        GIT_REVISION = out.strip().decode('ascii')\n    except OSError:\n        GIT_REVISION = \"Unknown\"\n    return GIT_REVISION\n\n\ndef write_version_py(filename='Orange/version.py'):\n    # Copied from numpy setup.py\n    cnt = \"\"\"\n# THIS FILE IS GENERATED FROM ORANGE SETUP.PY\nshort_version = '%(version)s'\nversion = '%(version)s'\nfull_version = '%(full_version)s'\ngit_revision = '%(git_revision)s'\nrelease = %(isrelease)s\n\nif not release:\n    version = full_version\n    short_version += \".dev\"\n\"\"\"\n    FULLVERSION = VERSION\n    if os.path.exists('.git'):\n        GIT_REVISION = git_version()\n    elif os.path.exists('Orange/version.py'):\n        # must be a source distribution, use existing version file\n        import imp\n        version = imp.load_source(\"Orange.version\", \"Orange/version.py\")\n        GIT_REVISION = version.git_revision\n    else:\n        GIT_REVISION = \"Unknown\"\n\n    if not ISRELEASED:\n        FULLVERSION += '.dev0+' + GIT_REVISION[:7]\n\n    a = open(filename, 'w')\n    try:\n        a.write(cnt % {'version': VERSION,\n                       'full_version': FULLVERSION,\n                       'git_revision': GIT_REVISION,\n                       'isrelease': str(ISRELEASED)})\n    finally:\n        a.close()\n\n\ndef configuration(parent_package='', top_path=None):\n    if os.path.exists('MANIFEST'):\n        os.remove('MANIFEST')\n\n    from numpy.distutils.misc_util import Configuration\n    config = Configuration(None, parent_package, top_path)\n\n    # Avoid non-useful msg:\n    # \"Ignoring attempt to set 'name' (from ... \"\n    config.set_options(ignore_setup_xxx_py=True,\n                       assume_default_configuration=True,\n                       delegate_options_to_subpackages=True,\n                       quiet=True)\n\n    config.add_subpackage('Orange')\n\n    config.get_version('Orange/version.py')  # sets config.version\n\n    return config\n\n\nPACKAGES = find_packages()\n\n# Extra non .py, .{so,pyd} files that are installed within the package dir\n# hierarchy\nPACKAGE_DATA = {\n    \"Orange\": [\"datasets/*.{}\".format(ext)\n               for ext in [\"tab\", \"csv\", \"basket\", \"info\"]],\n    \"Orange.canvas\": [\"icons/*.png\", \"icons/*.svg\"],\n    \"Orange.canvas.styles\": [\"*.qss\", \"orange/*.svg\"],\n    \"Orange.canvas.application.tutorials\": [\"*.ows\"],\n    \"Orange.canvas.report\": [\"icons/*.svg\", \"*.html\"],\n    \"Orange.widgets\": [\"icons/*.png\", \"icons/*.svg\"],\n    \"Orange.widgets.classify\": [\"icons/*.svg\"],\n    \"Orange.widgets.data\": [\"icons/*.svg\",\n                            \"icons/paintdata/*.png\",\n                            \"icons/paintdata/*.svg\"],\n    \"Orange.widgets.evaluate\": [\"icons/*.svg\"],\n    \"Orange.widgets.visualize\": [\"icons/*.svg\"],\n    \"Orange.widgets.regression\": [\"icons/*.svg\"],\n    \"Orange.widgets.unsupervised\": [\"icons/*.svg\"],\n    \"Orange.widgets.utils.plot\": [\"*.fs\", \"*.gs\", \"*.vs\"],\n    \"Orange.widgets.utils.plot.primitives\": [\"*.obj\"],\n    \"Orange.tests\": [\"xlsx_files/*.xlsx\", \"*.tab\", \"*.basket\", \"*.csv\"]\n}\n\n\nclass LintCommand(Command):\n    \"\"\"A setup.py lint subcommand developers can run locally.\"\"\"\n    description = \"run code linter(s)\"\n    user_options = []\n    initialize_options = finalize_options = lambda self: None\n\n    def run(self):\n        \"\"\"Lint current branch compared to a reasonable master branch\"\"\"\n        sys.exit(subprocess.call(r'''\n        set -eu\n        upstream=\"$(git remote -v |\n                    awk '/[@\\/]github.com[:\\/]biolab\\/orange3[\\. ]/{ print $1; exit }')\"\n        git fetch -q $upstream master\n        best_ancestor=$(git merge-base HEAD refs/remotes/$upstream/master)\n        .travis/check_pylint_diff $best_ancestor\n        ''', shell=True, cwd=os.path.dirname(os.path.abspath(__file__))))\n\nclass CoverageCommand(Command):\n    \"\"\"A setup.py coverage subcommand developers can run locally.\"\"\"\n    description = \"run code coverage\"\n    user_options = []\n    initialize_options = finalize_options = lambda self: None\n\n    def run(self):\n        \"\"\"Check coverage on current workdir\"\"\"\n        sys.exit(subprocess.call(r'''\n        coverage run --source=Orange -m unittest -v Orange.tests\n        echo; echo\n        coverage report\n        coverage html &&\n            { echo; echo \"See also: file://$(pwd)/htmlcov/index.html\"; echo; }\n        ''', shell=True, cwd=os.path.dirname(os.path.abspath(__file__))))\n\n\n# Install desktop file and icon on GNU/Linux/BSD\nDATA_FILES = []\nif any(sys.platform.startswith(platform)\n       for platform in ('linux', 'freebsd')):\n    # Patch desktop file executable to work with virtualenv\n    try:\n        sys.real_prefix\n    except AttributeError:\n        pass  # Not in virtualenv\n    else:\n        with open(os.path.join(os.path.dirname(__file__),\n                               'distribute',\n                               'orange-canvas.desktop'), 'r+') as desktop:\n            spec = []\n            for line in desktop:\n                if line.startswith('Exec='):\n                    line = 'Exec=\"{}\" -m Orange.canvas\\n'.format(sys.executable)\n                spec.append(line)\n            desktop.seek(0)\n            desktop.truncate(0)\n            desktop.writelines(spec)\n\n    usr_share = os.path.join(sys.prefix, \"share\")\n    if not usr_share.startswith('/usr/') or not os.access(usr_share, os.W_OK):\n        usr_share = os.environ.get('XDG_DATA_HOME',\n                                   os.path.expanduser('~/.local/share'))\n    DATA_FILES += [\n        (os.path.join(usr_share, 'applications'),\n         ['distribute/orange-canvas.desktop']),\n        (os.path.join(usr_share, 'icons', 'hicolor', 'scalable', 'apps'),\n         ['distribute/orange-canvas.svg'])\n    ]\n\n\ndef setup_package():\n    write_version_py()\n    setup(\n        configuration=configuration,\n        name=NAME,\n        description=DESCRIPTION,\n        long_description=LONG_DESCRIPTION,\n        author=AUTHOR,\n        author_email=AUTHOR_EMAIL,\n        url=URL,\n        license=LICENSE,\n        keywords=KEYWORDS,\n        classifiers=CLASSIFIERS,\n        packages=PACKAGES,\n        package_data=PACKAGE_DATA,\n        install_requires=INSTALL_REQUIRES,\n        entry_points=ENTRY_POINTS,\n        data_files=DATA_FILES,\n        zip_safe=False,\n        test_suite='Orange.tests.test_suite',\n        cmdclass={\n            'lint': LintCommand,\n            'coverage': CoverageCommand,\n        },\n    )\n\nif __name__ == '__main__':\n    setup_package()\n", "path": "setup.py"}]}