30
30
# Adapted from Cython's new_build_ext
31
31
class build_ext (_build_ext ):
32
32
def finalize_options (self ):
33
- # Check dependencies
34
- try :
35
- from Cython .Build .Dependencies import cythonize
36
- except ImportError as E :
37
- sys .stderr .write ("Error: {0}\n " .format (E ))
38
- sys .stderr .write ("The installation of cypari2 requires Cython\n " )
39
- sys .exit (1 )
40
-
41
- try :
42
- # We need the header files for cysignals at compile-time
43
- import cysignals
44
- except ImportError as E :
45
- sys .stderr .write ("Error: {0}\n " .format (E ))
46
- sys .stderr .write ("The installation of cypari2 requires cysignals\n " )
47
- sys .exit (1 )
48
-
49
33
# Generate auto-generated sources from pari.desc
50
34
rebuild ()
51
35
@@ -56,11 +40,16 @@ def finalize_options(self):
56
40
"language_level" : 2 ,
57
41
}
58
42
43
+ _build_ext .finalize_options (self )
44
+
45
+ def run (self ):
46
+ # Run Cython
47
+ from Cython .Build .Dependencies import cythonize
59
48
self .distribution .ext_modules [:] = cythonize (
60
49
self .distribution .ext_modules ,
61
50
compiler_directives = self .directives )
62
51
63
- _build_ext .finalize_options (self )
52
+ _build_ext .run (self )
64
53
65
54
66
55
class no_egg (_bdist_egg ):
@@ -79,6 +68,8 @@ def run(self):
79
68
setup (
80
69
name = 'cypari2' ,
81
70
version = VERSION ,
71
+ setup_requires = ['Cython>=0.28' ],
72
+ install_requires = ['cysignals>=1.7' ],
82
73
description = "A Python interface to the number theory library PARI/GP" ,
83
74
long_description = README ,
84
75
url = 'https://github.com/defeo/cypari2' ,
0 commit comments