|
4 | 4 | from distutils.extension import Extension
|
5 | 5 | from warnings import warn
|
6 | 6 |
|
7 |
| -try: |
| 7 | +try: # numpy and cython installed |
8 | 8 | from Cython.Build import cythonize
|
9 | 9 | # If we successfully imported Cython, look for a .pyx file
|
10 | 10 | import numpy
|
11 | 11 | ext_modules = cythonize('dataRead.pyx', include_path=[numpy.get_include()], gdb_debug=True)
|
12 |
| -except: |
| 12 | +except ImportError: |
13 | 13 | # If we couldn't import Cython, use the normal setuptools
|
14 | 14 | # and look for a pre-compiled .c file instead of a .pyx file
|
15 | 15 | from setuptools.command.build_ext import build_ext
|
|
57 | 57 | 'Programming Language :: Python :: 2.7',
|
58 | 58 | 'Programming Language :: Python :: 3.4',
|
59 | 59 | 'Programming Language :: Python :: 3.5',
|
60 |
| - 'Programming Language :: Python :: 3.6' |
| 60 | + 'Programming Language :: Python :: 3.6', |
| 61 | + 'Programming Language :: Python :: 3.7' |
61 | 62 | ]
|
62 | 63 |
|
63 | 64 | # What does your project relate to?
|
|
103 | 104 | entry_points = {
|
104 | 105 | 'console_scripts': ['mdfconverter=mdfconverter.mdfconverter:main', ],
|
105 | 106 | }
|
106 |
| -print(ext_modules) |
107 |
| -try: # try compiling module with cython or c code |
| 107 | + |
| 108 | +try: # try compiling module with cython or c code with numpy and cython already installed |
108 | 109 | setup(name=name, version=version, description=description, long_description=long_description,
|
109 | 110 | url=url, author=author, author_email=author_email, license=license, classifiers=classifiers,
|
110 | 111 | keywords=keywords, packages=packages, install_requires=install_requires, extras_require=extras_require,
|
111 | 112 | entry_points=entry_points, ext_modules=ext_modules, include_dirs=[numpy.get_include()])
|
112 |
| -except: # without Cython |
| 113 | +except: # could not compile extension dataRead |
113 | 114 | import sys
|
114 | 115 | print("Unexpected error:", sys.exc_info())
|
115 | 116 | extras_require.pop('experimental')
|
116 | 117 | install_requires.append('bitarray') # replaces cython requirement by bitarray
|
117 | 118 | setup(name=name, version=version, description=description, long_description=long_description,
|
118 | 119 | url=url, author=author, author_email=author_email, license=license, classifiers=classifiers,
|
119 | 120 | keywords=keywords, packages=packages, install_requires=install_requires, extras_require=extras_require,
|
120 |
| - entry_points=entry_points, include_dirs=[numpy.get_include()]) |
| 121 | + entry_points=entry_points) |
121 | 122 | warn('It is strongly advised to install Cython along with compilation environment '
|
122 | 123 | 'for performance and robustness purpose')
|
0 commit comments