Skip to content

Commit 9f83ab6

Browse files
Merge pull request #249 from pavlin-policar/fixes
setup.py maintenance
2 parents 994cf0b + 7acb106 commit 9f83ab6

File tree

1 file changed

+6
-24
lines changed

1 file changed

+6
-24
lines changed

setup.py

+6-24
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,9 @@
1010
from os.path import join
1111

1212
import setuptools
13+
from Cython.Distutils.build_ext import new_build_ext as build_ext
1314
from setuptools import setup, Extension
1415

15-
try:
16-
from Cython.Distutils.build_ext import new_build_ext as build_ext
17-
have_cython = True
18-
except ImportError:
19-
have_cython = False
20-
2116

2217
class ConvertNotebooksToDocs(distutils.cmd.Command):
2318
description = "Convert the example notebooks to reStructuredText that will" \
@@ -55,16 +50,9 @@ def run(self):
5550
writer.write(body, resources, nb_name)
5651

5752

58-
class get_numpy_include:
59-
"""Helper class to determine the numpy include path
60-
61-
The purpose of this class is to postpone importing numpy until it is
62-
actually installed, so that the ``get_include()`` method can be invoked.
63-
64-
"""
65-
def __str__(self):
66-
import numpy
67-
return numpy.get_include()
53+
def get_numpy_include():
54+
import numpy
55+
return numpy.get_include()
6856

6957

7058
def get_include_dirs():
@@ -126,9 +114,6 @@ def has_c_library(library, extension=".c"):
126114

127115
class CythonBuildExt(build_ext):
128116
def build_extensions(self):
129-
if not have_cython:
130-
raise RuntimeError("Missing build dependency: Cython")
131-
132117
extra_compile_args = []
133118
extra_link_args = []
134119

@@ -174,7 +159,7 @@ def build_extensions(self):
174159
if platform.machine() == "x86_64":
175160
extra_compile_args += ["-march=native"]
176161

177-
# We will disable openmp flags if the compiler doesn"t support it. This
162+
# We will disable openmp flags if the compiler doesn't support it. This
178163
# is only really an issue with OSX clang
179164
if has_c_library("omp"):
180165
print("Found openmp. Compiling with openmp flags...")
@@ -298,15 +283,12 @@ def readme():
298283
],
299284

300285
packages=setuptools.find_packages(include=["openTSNE", "openTSNE.*"]),
301-
python_requires=">=3.6",
286+
python_requires=">=3.7",
302287
install_requires=[
303288
"numpy>=1.16.6",
304289
"scikit-learn>=0.20",
305290
"scipy",
306291
],
307-
setup_requires=[
308-
"cython",
309-
],
310292
extras_require={
311293
"hnsw": "hnswlib~=0.4.0",
312294
"pynndescent": "pynndescent~=0.5.0",

0 commit comments

Comments
 (0)