Skip to content

Commit e1bde83

Browse files
committed
setup.py: simplify
1 parent 2fd20f5 commit e1bde83

File tree

1 file changed

+6
-12
lines changed

1 file changed

+6
-12
lines changed

setup.py

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
import warnings
77

88
from setuptools import setup, Extension
9-
from setuptools.dist import Distribution
9+
10+
import numpy
1011

1112
platform_supported = False
1213

@@ -56,12 +57,6 @@
5657
if not platform_supported:
5758
raise NotImplementedError(sys.platform)
5859

59-
try:
60-
from Cython.Distutils import build_ext as cython_build_ext
61-
has_cython = True
62-
except ImportError:
63-
has_cython = False
64-
6560
for path in library_dirs:
6661
try:
6762
files = os.listdir(path)
@@ -72,14 +67,13 @@
7267
else:
7368
warnings.warn('Cannot find ta-lib library, installation may fail.')
7469

75-
76-
import numpy
77-
7870
# Get the Cython build_ext or fall back to setuptools build_ext
79-
if has_cython:
71+
try:
8072
from Cython.Distutils import build_ext
81-
else:
73+
has_cython = True
74+
except ImportError:
8275
from setuptools.command.build_ext import build_ext
76+
has_cython = False
8377

8478
class NumpyBuildExt(build_ext):
8579
"""

0 commit comments

Comments
 (0)