We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Slow import
On my Windows workstation with >1200 of Python packages installed, `import vispy` takes about 3.4 seconds. 

98% of that time is spend at     
https://github.com/vispy/vispy/blob/ded293841c6438ab54af10c561f372155bb77edc/vispy/__init__.py#L26

On this system, more than half of `napari`'s import time is spent on determining the vispy version. 

Please consider not using `pkg_resources` during runtime.

Loosely related to https://github.com/napari/napari/pull/745

https://github.com/pypa/setuptools/issues/510

--- 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 # Copyright (c) Vispy Development Team. All Rights Reserved.
3 # Distributed under the (new) BSD License. See LICENSE.txt for more info.
4 """Vispy setup script.
5 
6 Steps to do a new release:
7 
8 Preparations:
9   * Test on Windows, Linux, Mac
10   * Make release notes
11   * Update API documentation and other docs that need updating.
12 
13 Define the version and release:
14   * tag the tip changeset as version x.x.x; `git tag -a 'vX.Y.Z' -m "Version X.Y.Z"`
15   * push tag to github
16   * verify that azure pipelines complete
17   * verify that `.tar.gz` sdist and binary wheels are available on PyPI
18 
19 Announcing:
20   * It can be worth waiting a day for eager users to report critical bugs
21   * Announce in scipy-user, vispy mailing list, twitter (@vispyproject)
22 
23 """
24 
25 import os
26 import sys
27 import platform
28 from os import path as op
29 from distutils import log
30 from setuptools import setup, find_packages, Command, Extension
31 from setuptools.command.sdist import sdist
32 from setuptools.command.build_py import build_py
33 from setuptools.command.egg_info import egg_info
34 from subprocess import check_call
35 
36 import numpy as np
37 from Cython.Build import cythonize
38 
39 log.set_verbosity(log.DEBUG)
40 log.info('setup.py entered')
41 log.info('$PATH=%s' % os.environ['PATH'])
42 
43 name = 'vispy'
44 description = 'Interactive visualization in Python'
45 
46 # Special commands for building jupyter notebook extension
47 here = os.path.dirname(os.path.abspath(__file__))
48 node_root = os.path.join(here, 'js')
49 is_repo = os.path.exists(os.path.join(here, '.git'))
50 
51 npm_path = os.pathsep.join([
52     os.path.join(node_root, 'node_modules', '.bin'),
53     os.environ.get('PATH', os.defpath),
54 ])
55 
56 
57 def set_builtin(name, value):
58     if isinstance(__builtins__, dict):
59         __builtins__[name] = value
60     else:
61         setattr(__builtins__, name, value)
62 
63 
64 def js_prerelease(command, strict=False):
65     """decorator for building minified js/css prior to another command"""
66     class DecoratedCommand(command):
67         def run(self):
68             jsdeps = self.distribution.get_command_obj('jsdeps')
69             if not is_repo and all(os.path.exists(t) for t in jsdeps.targets):
70                 # sdist, nothing to do
71                 command.run(self)
72                 return
73 
74             try:
75                 self.distribution.run_command('jsdeps')
76             except Exception as e:
77                 missing = [t for t in jsdeps.targets if not os.path.exists(t)]
78                 if strict or missing:
79                     log.warn('rebuilding js and css failed')
80                     if missing:
81                         log.error('missing files: %s' % missing)
82                     # HACK: Allow users who can't build the JS to still install vispy
83                     if not is_repo:
84                         raise e
85                     log.warn('WARNING: continuing installation WITHOUT nbextension javascript')
86                     # remove JS files from data_files so setuptools doesn't try to copy
87                     # non-existent files
88                     self.distribution.data_files = [x for x in self.distribution.data_files
89                                                     if 'jupyter' not in x[0]]
90                 else:
91                     log.warn('rebuilding js and css failed (not a problem)')
92                     log.warn(str(e))
93             command.run(self)
94             update_package_data(self.distribution)
95     return DecoratedCommand
96 
97 
98 def update_package_data(distribution):
99     """update package_data to catch changes during setup"""
100     build_py = distribution.get_command_obj('build_py')
101     # distribution.package_data = find_package_data()
102     # re-init build_py options which load package_data
103     build_py.finalize_options()
104 
105 
106 class NPM(Command):
107     description = 'install package.json dependencies using npm'
108 
109     user_options = []
110 
111     node_modules = os.path.join(node_root, 'node_modules')
112 
113     targets = [
114         os.path.join(here, 'vispy', 'static', 'extension.js'),
115         os.path.join(here, 'vispy', 'static', 'index.js')
116     ]
117 
118     def initialize_options(self):
119         pass
120 
121     def finalize_options(self):
122         pass
123 
124     def get_npm_name(self):
125         npmName = 'npm';
126         if platform.system() == 'Windows':
127             npmName = 'npm.cmd';
128 
129         return npmName;
130 
131     def has_npm(self):
132         npmName = self.get_npm_name();
133         try:
134             check_call([npmName, '--version'])
135             return True
136         except:
137             return False
138 
139     def should_run_npm_install(self):
140         package_json = os.path.join(node_root, 'package.json')
141         node_modules_exists = os.path.exists(self.node_modules)
142         return self.has_npm()
143 
144     def run(self):
145         has_npm = self.has_npm()
146         if not has_npm:
147             log.error("`npm` unavailable.  If you're running this command "
148                       "using sudo, make sure `npm` is available to sudo")
149 
150         env = os.environ.copy()
151         env['PATH'] = npm_path
152 
153         if self.should_run_npm_install():
154             log.info("Installing build dependencies with npm.  This may take "
155                      "a while...")
156             npmName = self.get_npm_name();
157             check_call([npmName, 'install', '--verbose'], cwd=node_root,
158                        stdout=sys.stdout, stderr=sys.stderr)
159             os.utime(self.node_modules, None)
160 
161         for t in self.targets:
162             if not os.path.exists(t):
163                 msg = 'Missing file: %s' % t
164                 if not has_npm:
165                     msg += '\nnpm is required to build a development ' \
166                            'version of a widget extension'
167                 raise ValueError(msg)
168 
169         # update package data in case this created new files
170         update_package_data(self.distribution)
171 
172 
173 extensions = [Extension('vispy.visuals.text._sdf_cpu',
174                         [op.join('vispy', 'visuals', 'text', '_sdf_cpu.pyx')],
175                         include_dirs=[np.get_include()]),
176               ]
177 
178 readme = open('README.rst', 'r').read()
179 setup(
180     name=name,
181     use_scm_version=True,
182     author='Vispy contributors',
183     author_email='vispy@googlegroups.com',
184     license='(new) BSD',
185     url='http://vispy.org',
186     download_url='https://pypi.python.org/pypi/vispy',
187     keywords=[
188         'visualization',
189         'OpenGl',
190         'ES',
191         'medical',
192         'imaging',
193         '3D',
194         'plotting',
195         'numpy',
196         'bigdata',
197         'ipython',
198         'jupyter',
199         'widgets',
200     ],
201     description=description,
202     long_description=readme,
203     platforms='any',
204     provides=['vispy'],
205     cmdclass={
206         'build_py': js_prerelease(build_py),
207         'egg_info': js_prerelease(egg_info),
208         'sdist': js_prerelease(sdist, strict=True),
209         'jsdeps': NPM,
210     },
211     python_requires='>=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*',
212     install_requires=['numpy', 'freetype-py', 'setuptools'],
213     setup_requires=['numpy', 'cython', 'setuptools_scm', 'setuptools_scm_git_archive'],
214     extras_require={
215         'ipython-static': ['ipython'],
216         'ipython-vnc': ['ipython>=7'],
217         'ipython-webgl': ['ipywidgets>=7.0', 'ipython>=7', 'tornado'],
218         'pyglet': ['pyglet>=1.2'],
219         'pyqt5': ['pyqt5'],
220         'pyside': ['PySide'],
221         'pyside2': ['PySide2'],
222         'sdl2': ['PySDL2'],
223         'wx': ['wxPython'],
224         'doc': ['sphinx_bootstrap_theme', 'numpydoc'],
225     },
226     packages=find_packages(),
227     ext_modules=cythonize(extensions),
228     package_dir={'vispy': 'vispy'},
229     data_files=[
230         ('share/jupyter/nbextensions/vispy', [
231             'vispy/static/extension.js',
232             'vispy/static/index.js',
233             'vispy/static/index.js.map',
234         ]),
235         ('etc/jupyter/nbconfig/notebook.d', ['vispy.json']),
236     ],
237     include_package_data=True,
238     package_data={
239         'vispy': [op.join('io', '_data', '*'),
240                   op.join('html', 'static', 'js', '*'),
241                   op.join('app', 'tests', 'qt-designer.ui'),
242                   op.join('util', 'fonts', 'data', '*.ttf'),
243                   ],
244 
245         'vispy.glsl': ['*.vert','*.frag', "*.glsl"],
246         'vispy.glsl.antialias': ['*.vert','*.frag', "*.glsl"],
247         'vispy.glsl.arrowheads': ['*.vert','*.frag', "*.glsl"],
248         'vispy.glsl.arrows': ['*.vert','*.frag', "*.glsl"],
249         'vispy.glsl.collections': ['*.vert','*.frag', "*.glsl"],
250         'vispy.glsl.colormaps': ['*.vert','*.frag', "*.glsl"],
251         'vispy.glsl.lines': ['*.vert','*.frag', "*.glsl"],
252         'vispy.glsl.markers': ['*.vert','*.frag', "*.glsl"],
253         'vispy.glsl.math': ['*.vert','*.frag', "*.glsl"],
254         'vispy.glsl.misc': ['*.vert','*.frag', "*.glsl"],
255         'vispy.glsl.transforms': ['*.vert','*.frag', "*.glsl"],
256 
257                   },
258     zip_safe=False,
259     classifiers=[
260         'Development Status :: 3 - Alpha',
261         'Intended Audience :: Science/Research',
262         'Intended Audience :: Education',
263         'Intended Audience :: Developers',
264         'Topic :: Scientific/Engineering :: Visualization',
265         'License :: OSI Approved :: BSD License',
266         'Operating System :: MacOS :: MacOS X',
267         'Operating System :: Microsoft :: Windows',
268         'Operating System :: POSIX',
269         'Programming Language :: Python',
270         'Programming Language :: Python :: 2.7',
271         'Programming Language :: Python :: 3.5',
272         'Programming Language :: Python :: 3.6',
273         'Programming Language :: Python :: 3.7',
274         'Framework :: IPython'
275     ],
276 )
277
```

Path: `vispy/__init__.py`
Content:
```
1 # -*- coding: utf-8 -*-
2 # Copyright (c) Vispy Development Team. All Rights Reserved.
3 # Distributed under the (new) BSD License. See LICENSE.txt for more info.
4 
5 """
6 
7 =====
8 Vispy
9 =====
10 
11 Vispy is a **high-performance interactive 2D/3D data visualization
12 library**. Vispy leverages the computational power of modern **Graphics
13 Processing Units (GPUs)** through the **OpenGL** library to display very
14 large datasets.
15 
16 For more information, see http://vispy.org.
17 
18 """
19 
20 from __future__ import division
21 from pkg_resources import get_distribution, DistributionNotFound
22 
23 __all__ = ['use', 'sys_info', 'set_log_level', 'test']
24 
25 try:
26     __version__ = get_distribution(__name__).version
27 except DistributionNotFound:
28     # package is not installed
29     pass
30 
31 from .util import config, set_log_level, keys, sys_info  # noqa
32 from .util.wrappers import use  # noqa
33 from .testing import test  # noqa
34 # load the two functions that IPython uses to instantiate an extension
35 # that way, the user only needs to run %load_ext vispy.ipython rather that
36 # %load_ext vispy.ipython.ipython
37 from .ipython import load_ipython_extension, unload_ipython_extension  # noqa
38 
39 
40 # Allow for Jupyter extension to be enabled
41 def _jupyter_nbextension_paths():
42     return [{
43         'section': 'notebook',
44         'src': 'static',
45         'dest': 'vispy',
46         'require': 'vispy/extension'
47     }]
48
```
--- 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
@@ -178,7 +178,7 @@
 readme = open('README.rst', 'r').read()
 setup(
     name=name,
-    use_scm_version=True,
+    use_scm_version={'write_to': 'vispy/version.py'},
     author='Vispy contributors',
     author_email='vispy@googlegroups.com',
     license='(new) BSD',
@@ -209,7 +209,7 @@
         'jsdeps': NPM,
     },
     python_requires='>=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*',
-    install_requires=['numpy', 'freetype-py', 'setuptools'],
+    install_requires=['numpy', 'freetype-py'],
     setup_requires=['numpy', 'cython', 'setuptools_scm', 'setuptools_scm_git_archive'],
     extras_require={
         'ipython-static': ['ipython'],
@@ -223,7 +223,7 @@
         'wx': ['wxPython'],
         'doc': ['sphinx_bootstrap_theme', 'numpydoc'],
     },
-    packages=find_packages(),
+    packages=find_packages(exclude=['make']),
     ext_modules=cythonize(extensions),
     package_dir={'vispy': 'vispy'},
     data_files=[
diff --git a/vispy/__init__.py b/vispy/__init__.py
--- a/vispy/__init__.py
+++ b/vispy/__init__.py
@@ -18,13 +18,12 @@
 """
 
 from __future__ import division
-from pkg_resources import get_distribution, DistributionNotFound
 
 __all__ = ['use', 'sys_info', 'set_log_level', 'test']
 
 try:
-    __version__ = get_distribution(__name__).version
-except DistributionNotFound:
+    from .version import version as __version__  # noqa
+except ImportError:
     # package is not installed
     pass

{"golden_diff": "diff --git a/setup.py b/setup.py\n--- a/setup.py\n+++ b/setup.py\n@@ -178,7 +178,7 @@\n readme = open('README.rst', 'r').read()\n setup(\n     name=name,\n-    use_scm_version=True,\n+    use_scm_version={'write_to': 'vispy/version.py'},\n     author='Vispy contributors',\n     author_email='vispy@googlegroups.com',\n     license='(new) BSD',\n@@ -209,7 +209,7 @@\n         'jsdeps': NPM,\n     },\n     python_requires='>=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*',\n-    install_requires=['numpy', 'freetype-py', 'setuptools'],\n+    install_requires=['numpy', 'freetype-py'],\n     setup_requires=['numpy', 'cython', 'setuptools_scm', 'setuptools_scm_git_archive'],\n     extras_require={\n         'ipython-static': ['ipython'],\n@@ -223,7 +223,7 @@\n         'wx': ['wxPython'],\n         'doc': ['sphinx_bootstrap_theme', 'numpydoc'],\n     },\n-    packages=find_packages(),\n+    packages=find_packages(exclude=['make']),\n     ext_modules=cythonize(extensions),\n     package_dir={'vispy': 'vispy'},\n     data_files=[\ndiff --git a/vispy/__init__.py b/vispy/__init__.py\n--- a/vispy/__init__.py\n+++ b/vispy/__init__.py\n@@ -18,13 +18,12 @@\n \"\"\"\n \n from __future__ import division\n-from pkg_resources import get_distribution, DistributionNotFound\n \n __all__ = ['use', 'sys_info', 'set_log_level', 'test']\n \n try:\n-    __version__ = get_distribution(__name__).version\n-except DistributionNotFound:\n+    from .version import version as __version__  # noqa\n+except ImportError:\n     # package is not installed\n     pass\n", "issue": "Slow import\nOn my Windows workstation with >1200 of Python packages installed, `import vispy` takes about 3.4 seconds. \r\n\r\n98% of that time is spend at     \r\nhttps://github.com/vispy/vispy/blob/ded293841c6438ab54af10c561f372155bb77edc/vispy/__init__.py#L26\r\n\r\nOn this system, more than half of `napari`'s import time is spent on determining the vispy version. \r\n\r\nPlease consider not using `pkg_resources` during runtime.\r\n\r\nLoosely related to https://github.com/napari/napari/pull/745\r\n\r\nhttps://github.com/pypa/setuptools/issues/510\n", "before_files": [{"content": "# -*- coding: utf-8 -*-\n# Copyright (c) Vispy Development Team. All Rights Reserved.\n# Distributed under the (new) BSD License. See LICENSE.txt for more info.\n\"\"\"Vispy setup script.\n\nSteps to do a new release:\n\nPreparations:\n  * Test on Windows, Linux, Mac\n  * Make release notes\n  * Update API documentation and other docs that need updating.\n\nDefine the version and release:\n  * tag the tip changeset as version x.x.x; `git tag -a 'vX.Y.Z' -m \"Version X.Y.Z\"`\n  * push tag to github\n  * verify that azure pipelines complete\n  * verify that `.tar.gz` sdist and binary wheels are available on PyPI\n\nAnnouncing:\n  * It can be worth waiting a day for eager users to report critical bugs\n  * Announce in scipy-user, vispy mailing list, twitter (@vispyproject)\n\n\"\"\"\n\nimport os\nimport sys\nimport platform\nfrom os import path as op\nfrom distutils import log\nfrom setuptools import setup, find_packages, Command, Extension\nfrom setuptools.command.sdist import sdist\nfrom setuptools.command.build_py import build_py\nfrom setuptools.command.egg_info import egg_info\nfrom subprocess import check_call\n\nimport numpy as np\nfrom Cython.Build import cythonize\n\nlog.set_verbosity(log.DEBUG)\nlog.info('setup.py entered')\nlog.info('$PATH=%s' % os.environ['PATH'])\n\nname = 'vispy'\ndescription = 'Interactive visualization in Python'\n\n# Special commands for building jupyter notebook extension\nhere = os.path.dirname(os.path.abspath(__file__))\nnode_root = os.path.join(here, 'js')\nis_repo = os.path.exists(os.path.join(here, '.git'))\n\nnpm_path = os.pathsep.join([\n    os.path.join(node_root, 'node_modules', '.bin'),\n    os.environ.get('PATH', os.defpath),\n])\n\n\ndef set_builtin(name, value):\n    if isinstance(__builtins__, dict):\n        __builtins__[name] = value\n    else:\n        setattr(__builtins__, name, value)\n\n\ndef js_prerelease(command, strict=False):\n    \"\"\"decorator for building minified js/css prior to another command\"\"\"\n    class DecoratedCommand(command):\n        def run(self):\n            jsdeps = self.distribution.get_command_obj('jsdeps')\n            if not is_repo and all(os.path.exists(t) for t in jsdeps.targets):\n                # sdist, nothing to do\n                command.run(self)\n                return\n\n            try:\n                self.distribution.run_command('jsdeps')\n            except Exception as e:\n                missing = [t for t in jsdeps.targets if not os.path.exists(t)]\n                if strict or missing:\n                    log.warn('rebuilding js and css failed')\n                    if missing:\n                        log.error('missing files: %s' % missing)\n                    # HACK: Allow users who can't build the JS to still install vispy\n                    if not is_repo:\n                        raise e\n                    log.warn('WARNING: continuing installation WITHOUT nbextension javascript')\n                    # remove JS files from data_files so setuptools doesn't try to copy\n                    # non-existent files\n                    self.distribution.data_files = [x for x in self.distribution.data_files\n                                                    if 'jupyter' not in x[0]]\n                else:\n                    log.warn('rebuilding js and css failed (not a problem)')\n                    log.warn(str(e))\n            command.run(self)\n            update_package_data(self.distribution)\n    return DecoratedCommand\n\n\ndef update_package_data(distribution):\n    \"\"\"update package_data to catch changes during setup\"\"\"\n    build_py = distribution.get_command_obj('build_py')\n    # distribution.package_data = find_package_data()\n    # re-init build_py options which load package_data\n    build_py.finalize_options()\n\n\nclass NPM(Command):\n    description = 'install package.json dependencies using npm'\n\n    user_options = []\n\n    node_modules = os.path.join(node_root, 'node_modules')\n\n    targets = [\n        os.path.join(here, 'vispy', 'static', 'extension.js'),\n        os.path.join(here, 'vispy', 'static', 'index.js')\n    ]\n\n    def initialize_options(self):\n        pass\n\n    def finalize_options(self):\n        pass\n\n    def get_npm_name(self):\n        npmName = 'npm';\n        if platform.system() == 'Windows':\n            npmName = 'npm.cmd';\n\n        return npmName;\n\n    def has_npm(self):\n        npmName = self.get_npm_name();\n        try:\n            check_call([npmName, '--version'])\n            return True\n        except:\n            return False\n\n    def should_run_npm_install(self):\n        package_json = os.path.join(node_root, 'package.json')\n        node_modules_exists = os.path.exists(self.node_modules)\n        return self.has_npm()\n\n    def run(self):\n        has_npm = self.has_npm()\n        if not has_npm:\n            log.error(\"`npm` unavailable.  If you're running this command \"\n                      \"using sudo, make sure `npm` is available to sudo\")\n\n        env = os.environ.copy()\n        env['PATH'] = npm_path\n\n        if self.should_run_npm_install():\n            log.info(\"Installing build dependencies with npm.  This may take \"\n                     \"a while...\")\n            npmName = self.get_npm_name();\n            check_call([npmName, 'install', '--verbose'], cwd=node_root,\n                       stdout=sys.stdout, stderr=sys.stderr)\n            os.utime(self.node_modules, None)\n\n        for t in self.targets:\n            if not os.path.exists(t):\n                msg = 'Missing file: %s' % t\n                if not has_npm:\n                    msg += '\\nnpm is required to build a development ' \\\n                           'version of a widget extension'\n                raise ValueError(msg)\n\n        # update package data in case this created new files\n        update_package_data(self.distribution)\n\n\nextensions = [Extension('vispy.visuals.text._sdf_cpu',\n                        [op.join('vispy', 'visuals', 'text', '_sdf_cpu.pyx')],\n                        include_dirs=[np.get_include()]),\n              ]\n\nreadme = open('README.rst', 'r').read()\nsetup(\n    name=name,\n    use_scm_version=True,\n    author='Vispy contributors',\n    author_email='vispy@googlegroups.com',\n    license='(new) BSD',\n    url='http://vispy.org',\n    download_url='https://pypi.python.org/pypi/vispy',\n    keywords=[\n        'visualization',\n        'OpenGl',\n        'ES',\n        'medical',\n        'imaging',\n        '3D',\n        'plotting',\n        'numpy',\n        'bigdata',\n        'ipython',\n        'jupyter',\n        'widgets',\n    ],\n    description=description,\n    long_description=readme,\n    platforms='any',\n    provides=['vispy'],\n    cmdclass={\n        'build_py': js_prerelease(build_py),\n        'egg_info': js_prerelease(egg_info),\n        'sdist': js_prerelease(sdist, strict=True),\n        'jsdeps': NPM,\n    },\n    python_requires='>=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*',\n    install_requires=['numpy', 'freetype-py', 'setuptools'],\n    setup_requires=['numpy', 'cython', 'setuptools_scm', 'setuptools_scm_git_archive'],\n    extras_require={\n        'ipython-static': ['ipython'],\n        'ipython-vnc': ['ipython>=7'],\n        'ipython-webgl': ['ipywidgets>=7.0', 'ipython>=7', 'tornado'],\n        'pyglet': ['pyglet>=1.2'],\n        'pyqt5': ['pyqt5'],\n        'pyside': ['PySide'],\n        'pyside2': ['PySide2'],\n        'sdl2': ['PySDL2'],\n        'wx': ['wxPython'],\n        'doc': ['sphinx_bootstrap_theme', 'numpydoc'],\n    },\n    packages=find_packages(),\n    ext_modules=cythonize(extensions),\n    package_dir={'vispy': 'vispy'},\n    data_files=[\n        ('share/jupyter/nbextensions/vispy', [\n            'vispy/static/extension.js',\n            'vispy/static/index.js',\n            'vispy/static/index.js.map',\n        ]),\n        ('etc/jupyter/nbconfig/notebook.d', ['vispy.json']),\n    ],\n    include_package_data=True,\n    package_data={\n        'vispy': [op.join('io', '_data', '*'),\n                  op.join('html', 'static', 'js', '*'),\n                  op.join('app', 'tests', 'qt-designer.ui'),\n                  op.join('util', 'fonts', 'data', '*.ttf'),\n                  ],\n\n        'vispy.glsl': ['*.vert','*.frag', \"*.glsl\"],\n        'vispy.glsl.antialias': ['*.vert','*.frag', \"*.glsl\"],\n        'vispy.glsl.arrowheads': ['*.vert','*.frag', \"*.glsl\"],\n        'vispy.glsl.arrows': ['*.vert','*.frag', \"*.glsl\"],\n        'vispy.glsl.collections': ['*.vert','*.frag', \"*.glsl\"],\n        'vispy.glsl.colormaps': ['*.vert','*.frag', \"*.glsl\"],\n        'vispy.glsl.lines': ['*.vert','*.frag', \"*.glsl\"],\n        'vispy.glsl.markers': ['*.vert','*.frag', \"*.glsl\"],\n        'vispy.glsl.math': ['*.vert','*.frag', \"*.glsl\"],\n        'vispy.glsl.misc': ['*.vert','*.frag', \"*.glsl\"],\n        'vispy.glsl.transforms': ['*.vert','*.frag', \"*.glsl\"],\n\n                  },\n    zip_safe=False,\n    classifiers=[\n        'Development Status :: 3 - Alpha',\n        'Intended Audience :: Science/Research',\n        'Intended Audience :: Education',\n        'Intended Audience :: Developers',\n        'Topic :: Scientific/Engineering :: Visualization',\n        'License :: OSI Approved :: BSD License',\n        'Operating System :: MacOS :: MacOS X',\n        'Operating System :: Microsoft :: Windows',\n        'Operating System :: POSIX',\n        'Programming Language :: Python',\n        'Programming Language :: Python :: 2.7',\n        'Programming Language :: Python :: 3.5',\n        'Programming Language :: Python :: 3.6',\n        'Programming Language :: Python :: 3.7',\n        'Framework :: IPython'\n    ],\n)\n", "path": "setup.py"}, {"content": "# -*- coding: utf-8 -*-\n# Copyright (c) Vispy Development Team. All Rights Reserved.\n# Distributed under the (new) BSD License. See LICENSE.txt for more info.\n\n\"\"\"\n\n=====\nVispy\n=====\n\nVispy is a **high-performance interactive 2D/3D data visualization\nlibrary**. Vispy leverages the computational power of modern **Graphics\nProcessing Units (GPUs)** through the **OpenGL** library to display very\nlarge datasets.\n\nFor more information, see http://vispy.org.\n\n\"\"\"\n\nfrom __future__ import division\nfrom pkg_resources import get_distribution, DistributionNotFound\n\n__all__ = ['use', 'sys_info', 'set_log_level', 'test']\n\ntry:\n    __version__ = get_distribution(__name__).version\nexcept DistributionNotFound:\n    # package is not installed\n    pass\n\nfrom .util import config, set_log_level, keys, sys_info  # noqa\nfrom .util.wrappers import use  # noqa\nfrom .testing import test  # noqa\n# load the two functions that IPython uses to instantiate an extension\n# that way, the user only needs to run %load_ext vispy.ipython rather that\n# %load_ext vispy.ipython.ipython\nfrom .ipython import load_ipython_extension, unload_ipython_extension  # noqa\n\n\n# Allow for Jupyter extension to be enabled\ndef _jupyter_nbextension_paths():\n    return [{\n        'section': 'notebook',\n        'src': 'static',\n        'dest': 'vispy',\n        'require': 'vispy/extension'\n    }]\n", "path": "vispy/__init__.py"}], "after_files": [{"content": "# -*- coding: utf-8 -*-\n# Copyright (c) Vispy Development Team. All Rights Reserved.\n# Distributed under the (new) BSD License. See LICENSE.txt for more info.\n\"\"\"Vispy setup script.\n\nSteps to do a new release:\n\nPreparations:\n  * Test on Windows, Linux, Mac\n  * Make release notes\n  * Update API documentation and other docs that need updating.\n\nDefine the version and release:\n  * tag the tip changeset as version x.x.x; `git tag -a 'vX.Y.Z' -m \"Version X.Y.Z\"`\n  * push tag to github\n  * verify that azure pipelines complete\n  * verify that `.tar.gz` sdist and binary wheels are available on PyPI\n\nAnnouncing:\n  * It can be worth waiting a day for eager users to report critical bugs\n  * Announce in scipy-user, vispy mailing list, twitter (@vispyproject)\n\n\"\"\"\n\nimport os\nimport sys\nimport platform\nfrom os import path as op\nfrom distutils import log\nfrom setuptools import setup, find_packages, Command, Extension\nfrom setuptools.command.sdist import sdist\nfrom setuptools.command.build_py import build_py\nfrom setuptools.command.egg_info import egg_info\nfrom subprocess import check_call\n\nimport numpy as np\nfrom Cython.Build import cythonize\n\nlog.set_verbosity(log.DEBUG)\nlog.info('setup.py entered')\nlog.info('$PATH=%s' % os.environ['PATH'])\n\nname = 'vispy'\ndescription = 'Interactive visualization in Python'\n\n# Special commands for building jupyter notebook extension\nhere = os.path.dirname(os.path.abspath(__file__))\nnode_root = os.path.join(here, 'js')\nis_repo = os.path.exists(os.path.join(here, '.git'))\n\nnpm_path = os.pathsep.join([\n    os.path.join(node_root, 'node_modules', '.bin'),\n    os.environ.get('PATH', os.defpath),\n])\n\n\ndef set_builtin(name, value):\n    if isinstance(__builtins__, dict):\n        __builtins__[name] = value\n    else:\n        setattr(__builtins__, name, value)\n\n\ndef js_prerelease(command, strict=False):\n    \"\"\"decorator for building minified js/css prior to another command\"\"\"\n    class DecoratedCommand(command):\n        def run(self):\n            jsdeps = self.distribution.get_command_obj('jsdeps')\n            if not is_repo and all(os.path.exists(t) for t in jsdeps.targets):\n                # sdist, nothing to do\n                command.run(self)\n                return\n\n            try:\n                self.distribution.run_command('jsdeps')\n            except Exception as e:\n                missing = [t for t in jsdeps.targets if not os.path.exists(t)]\n                if strict or missing:\n                    log.warn('rebuilding js and css failed')\n                    if missing:\n                        log.error('missing files: %s' % missing)\n                    # HACK: Allow users who can't build the JS to still install vispy\n                    if not is_repo:\n                        raise e\n                    log.warn('WARNING: continuing installation WITHOUT nbextension javascript')\n                    # remove JS files from data_files so setuptools doesn't try to copy\n                    # non-existent files\n                    self.distribution.data_files = [x for x in self.distribution.data_files\n                                                    if 'jupyter' not in x[0]]\n                else:\n                    log.warn('rebuilding js and css failed (not a problem)')\n                    log.warn(str(e))\n            command.run(self)\n            update_package_data(self.distribution)\n    return DecoratedCommand\n\n\ndef update_package_data(distribution):\n    \"\"\"update package_data to catch changes during setup\"\"\"\n    build_py = distribution.get_command_obj('build_py')\n    # distribution.package_data = find_package_data()\n    # re-init build_py options which load package_data\n    build_py.finalize_options()\n\n\nclass NPM(Command):\n    description = 'install package.json dependencies using npm'\n\n    user_options = []\n\n    node_modules = os.path.join(node_root, 'node_modules')\n\n    targets = [\n        os.path.join(here, 'vispy', 'static', 'extension.js'),\n        os.path.join(here, 'vispy', 'static', 'index.js')\n    ]\n\n    def initialize_options(self):\n        pass\n\n    def finalize_options(self):\n        pass\n\n    def get_npm_name(self):\n        npmName = 'npm';\n        if platform.system() == 'Windows':\n            npmName = 'npm.cmd';\n\n        return npmName;\n\n    def has_npm(self):\n        npmName = self.get_npm_name();\n        try:\n            check_call([npmName, '--version'])\n            return True\n        except:\n            return False\n\n    def should_run_npm_install(self):\n        package_json = os.path.join(node_root, 'package.json')\n        node_modules_exists = os.path.exists(self.node_modules)\n        return self.has_npm()\n\n    def run(self):\n        has_npm = self.has_npm()\n        if not has_npm:\n            log.error(\"`npm` unavailable.  If you're running this command \"\n                      \"using sudo, make sure `npm` is available to sudo\")\n\n        env = os.environ.copy()\n        env['PATH'] = npm_path\n\n        if self.should_run_npm_install():\n            log.info(\"Installing build dependencies with npm.  This may take \"\n                     \"a while...\")\n            npmName = self.get_npm_name();\n            check_call([npmName, 'install', '--verbose'], cwd=node_root,\n                       stdout=sys.stdout, stderr=sys.stderr)\n            os.utime(self.node_modules, None)\n\n        for t in self.targets:\n            if not os.path.exists(t):\n                msg = 'Missing file: %s' % t\n                if not has_npm:\n                    msg += '\\nnpm is required to build a development ' \\\n                           'version of a widget extension'\n                raise ValueError(msg)\n\n        # update package data in case this created new files\n        update_package_data(self.distribution)\n\n\nextensions = [Extension('vispy.visuals.text._sdf_cpu',\n                        [op.join('vispy', 'visuals', 'text', '_sdf_cpu.pyx')],\n                        include_dirs=[np.get_include()]),\n              ]\n\nreadme = open('README.rst', 'r').read()\nsetup(\n    name=name,\n    use_scm_version={'write_to': 'vispy/version.py'},\n    author='Vispy contributors',\n    author_email='vispy@googlegroups.com',\n    license='(new) BSD',\n    url='http://vispy.org',\n    download_url='https://pypi.python.org/pypi/vispy',\n    keywords=[\n        'visualization',\n        'OpenGl',\n        'ES',\n        'medical',\n        'imaging',\n        '3D',\n        'plotting',\n        'numpy',\n        'bigdata',\n        'ipython',\n        'jupyter',\n        'widgets',\n    ],\n    description=description,\n    long_description=readme,\n    platforms='any',\n    provides=['vispy'],\n    cmdclass={\n        'build_py': js_prerelease(build_py),\n        'egg_info': js_prerelease(egg_info),\n        'sdist': js_prerelease(sdist, strict=True),\n        'jsdeps': NPM,\n    },\n    python_requires='>=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*',\n    install_requires=['numpy', 'freetype-py'],\n    setup_requires=['numpy', 'cython', 'setuptools_scm', 'setuptools_scm_git_archive'],\n    extras_require={\n        'ipython-static': ['ipython'],\n        'ipython-vnc': ['ipython>=7'],\n        'ipython-webgl': ['ipywidgets>=7.0', 'ipython>=7', 'tornado'],\n        'pyglet': ['pyglet>=1.2'],\n        'pyqt5': ['pyqt5'],\n        'pyside': ['PySide'],\n        'pyside2': ['PySide2'],\n        'sdl2': ['PySDL2'],\n        'wx': ['wxPython'],\n        'doc': ['sphinx_bootstrap_theme', 'numpydoc'],\n    },\n    packages=find_packages(exclude=['make']),\n    ext_modules=cythonize(extensions),\n    package_dir={'vispy': 'vispy'},\n    data_files=[\n        ('share/jupyter/nbextensions/vispy', [\n            'vispy/static/extension.js',\n            'vispy/static/index.js',\n            'vispy/static/index.js.map',\n        ]),\n        ('etc/jupyter/nbconfig/notebook.d', ['vispy.json']),\n    ],\n    include_package_data=True,\n    package_data={\n        'vispy': [op.join('io', '_data', '*'),\n                  op.join('html', 'static', 'js', '*'),\n                  op.join('app', 'tests', 'qt-designer.ui'),\n                  op.join('util', 'fonts', 'data', '*.ttf'),\n                  ],\n\n        'vispy.glsl': ['*.vert','*.frag', \"*.glsl\"],\n        'vispy.glsl.antialias': ['*.vert','*.frag', \"*.glsl\"],\n        'vispy.glsl.arrowheads': ['*.vert','*.frag', \"*.glsl\"],\n        'vispy.glsl.arrows': ['*.vert','*.frag', \"*.glsl\"],\n        'vispy.glsl.collections': ['*.vert','*.frag', \"*.glsl\"],\n        'vispy.glsl.colormaps': ['*.vert','*.frag', \"*.glsl\"],\n        'vispy.glsl.lines': ['*.vert','*.frag', \"*.glsl\"],\n        'vispy.glsl.markers': ['*.vert','*.frag', \"*.glsl\"],\n        'vispy.glsl.math': ['*.vert','*.frag', \"*.glsl\"],\n        'vispy.glsl.misc': ['*.vert','*.frag', \"*.glsl\"],\n        'vispy.glsl.transforms': ['*.vert','*.frag', \"*.glsl\"],\n\n                  },\n    zip_safe=False,\n    classifiers=[\n        'Development Status :: 3 - Alpha',\n        'Intended Audience :: Science/Research',\n        'Intended Audience :: Education',\n        'Intended Audience :: Developers',\n        'Topic :: Scientific/Engineering :: Visualization',\n        'License :: OSI Approved :: BSD License',\n        'Operating System :: MacOS :: MacOS X',\n        'Operating System :: Microsoft :: Windows',\n        'Operating System :: POSIX',\n        'Programming Language :: Python',\n        'Programming Language :: Python :: 2.7',\n        'Programming Language :: Python :: 3.5',\n        'Programming Language :: Python :: 3.6',\n        'Programming Language :: Python :: 3.7',\n        'Framework :: IPython'\n    ],\n)\n", "path": "setup.py"}, {"content": "# -*- coding: utf-8 -*-\n# Copyright (c) Vispy Development Team. All Rights Reserved.\n# Distributed under the (new) BSD License. See LICENSE.txt for more info.\n\n\"\"\"\n\n=====\nVispy\n=====\n\nVispy is a **high-performance interactive 2D/3D data visualization\nlibrary**. Vispy leverages the computational power of modern **Graphics\nProcessing Units (GPUs)** through the **OpenGL** library to display very\nlarge datasets.\n\nFor more information, see http://vispy.org.\n\n\"\"\"\n\nfrom __future__ import division\n\n__all__ = ['use', 'sys_info', 'set_log_level', 'test']\n\ntry:\n    from .version import version as __version__  # noqa\nexcept ImportError:\n    # package is not installed\n    pass\n\nfrom .util import config, set_log_level, keys, sys_info  # noqa\nfrom .util.wrappers import use  # noqa\nfrom .testing import test  # noqa\n# load the two functions that IPython uses to instantiate an extension\n# that way, the user only needs to run %load_ext vispy.ipython rather that\n# %load_ext vispy.ipython.ipython\nfrom .ipython import load_ipython_extension, unload_ipython_extension  # noqa\n\n\n# Allow for Jupyter extension to be enabled\ndef _jupyter_nbextension_paths():\n    return [{\n        'section': 'notebook',\n        'src': 'static',\n        'dest': 'vispy',\n        'require': 'vispy/extension'\n    }]\n", "path": "vispy/__init__.py"}]}