Skip to content

Commit 45f1bb3

Browse files
committed
revert the deletion of fetch_biuld_eggs() in setup.py
1 parent 5d00f2a commit 45f1bb3

1 file changed

Lines changed: 14 additions & 2 deletions

File tree

setup.py

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,20 @@
33
from setuptools import dist, setup, find_packages
44
from setuptools.extension import Extension
55

6-
from Cython.Build import cythonize
6+
try:
7+
from Cython.Build import cythonize
8+
except ImportError:
9+
dist.Distribution().fetch_build_eggs(["cython"])
10+
from Cython.Build import cythonize
711
import Cython.Compiler.Options
812

913
Cython.Compiler.Options.annotate = True
1014

11-
import numpy as np
15+
try:
16+
import numpy as np
17+
except ImportError:
18+
dist.Distribution().fetch_build_eggs(["numpy"])
19+
import numpy as np
1220

1321
# fmt: off
1422
cython_modules = [
@@ -45,4 +53,8 @@
4553
packages=packages,
4654
ext_modules=cythonize(extensions, annotate=True, nthreads=nthreads),
4755
include_dirs=[np.get_include()],
56+
setup_requires=[
57+
"cython",
58+
"numpy",
59+
],
4860
)

0 commit comments

Comments
 (0)