|
10 | 10 | from os.path import join
|
11 | 11 |
|
12 | 12 | import setuptools
|
| 13 | +from Cython.Distutils.build_ext import new_build_ext as build_ext |
13 | 14 | from setuptools import setup, Extension
|
14 | 15 |
|
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 |
| - |
21 | 16 |
|
22 | 17 | class ConvertNotebooksToDocs(distutils.cmd.Command):
|
23 | 18 | description = "Convert the example notebooks to reStructuredText that will" \
|
@@ -55,16 +50,9 @@ def run(self):
|
55 | 50 | writer.write(body, resources, nb_name)
|
56 | 51 |
|
57 | 52 |
|
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() |
68 | 56 |
|
69 | 57 |
|
70 | 58 | def get_include_dirs():
|
@@ -126,9 +114,6 @@ def has_c_library(library, extension=".c"):
|
126 | 114 |
|
127 | 115 | class CythonBuildExt(build_ext):
|
128 | 116 | def build_extensions(self):
|
129 |
| - if not have_cython: |
130 |
| - raise RuntimeError("Missing build dependency: Cython") |
131 |
| - |
132 | 117 | extra_compile_args = []
|
133 | 118 | extra_link_args = []
|
134 | 119 |
|
@@ -174,7 +159,7 @@ def build_extensions(self):
|
174 | 159 | if platform.machine() == "x86_64":
|
175 | 160 | extra_compile_args += ["-march=native"]
|
176 | 161 |
|
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 |
178 | 163 | # is only really an issue with OSX clang
|
179 | 164 | if has_c_library("omp"):
|
180 | 165 | print("Found openmp. Compiling with openmp flags...")
|
@@ -298,15 +283,12 @@ def readme():
|
298 | 283 | ],
|
299 | 284 |
|
300 | 285 | packages=setuptools.find_packages(include=["openTSNE", "openTSNE.*"]),
|
301 |
| - python_requires=">=3.6", |
| 286 | + python_requires=">=3.7", |
302 | 287 | install_requires=[
|
303 | 288 | "numpy>=1.16.6",
|
304 | 289 | "scikit-learn>=0.20",
|
305 | 290 | "scipy",
|
306 | 291 | ],
|
307 |
| - setup_requires=[ |
308 |
| - "cython", |
309 |
| - ], |
310 | 292 | extras_require={
|
311 | 293 | "hnsw": "hnswlib~=0.4.0",
|
312 | 294 | "pynndescent": "pynndescent~=0.5.0",
|
|
0 commit comments