@@ -54,10 +54,24 @@ def finalize_options(self):
54
54
self .jobs = int (self .jobs )
55
55
except ValueError :
56
56
raise ValueError ("--jobs/-j argument must be an integer" )
57
- incl_dirs = self .include_dirs
57
+
58
+ # Ensure that self.include_dirs and self.distribution.include_dirs
59
+ # refer to the same list object. finalize_options will modify
60
+ # self.include_dirs, but self.distribution.include_dirs is used
61
+ # during the actual build.
62
+ # self.include_dirs is None unless paths are specified with
63
+ # --include-dirs.
64
+ # The include paths will be passed to the compiler in the order:
65
+ # numpy paths, --include-dirs paths, Python include path.
66
+ if isinstance (self .include_dirs , str ):
67
+ self .include_dirs = self .include_dirs .split (os .pathsep )
68
+ incl_dirs = self .include_dirs or []
69
+ if self .distribution .include_dirs is None :
70
+ self .distribution .include_dirs = []
71
+ self .include_dirs = self .distribution .include_dirs
72
+ self .include_dirs .extend (incl_dirs )
73
+
58
74
old_build_ext .finalize_options (self )
59
- if incl_dirs is not None :
60
- self .include_dirs .extend (self .distribution .include_dirs or [])
61
75
self .set_undefined_options ('build' , ('jobs' , 'jobs' ))
62
76
63
77
def run (self ):
0 commit comments