File tree Expand file tree Collapse file tree 1 file changed +16
-7
lines changed Expand file tree Collapse file tree 1 file changed +16
-7
lines changed Original file line number Diff line number Diff line change 44
44
# 'pyephem',
45
45
46
46
# set up pvlib packages to be installed and extensions to be compiled
47
- PACKAGES = ['pvlib' ,
48
- 'pvlib.spa_c_files' ]
47
+ PACKAGES = ['pvlib' ]
49
48
50
49
extensions = []
51
50
52
- spa_ext = Extension ('pvlib.spa_c_files.spa_py' ,
53
- sources = ['pvlib/spa_c_files/spa.c' ,
54
- 'pvlib/spa_c_files/spa_py.c' ],
55
- depends = ['pvlib/spa_c_files/spa.h' ])
56
- extensions .append (spa_ext )
51
+ spa_sources = ['pvlib/spa_c_files/spa.c' , 'pvlib/spa_c_files/spa_py.c' ]
52
+ spa_depends = ['pvlib/spa_c_files/spa.h' ]
53
+ spa_all_file_paths = map (lambda x : os .path .join (os .path .dirname (__file__ ), x ),
54
+ spa_sources + spa_depends )
55
+
56
+ if all (map (os .path .exists , spa_all_file_paths )):
57
+ print ('all spa_c files found' )
58
+ PACKAGES .append ('pvlib.spa_c_files' )
59
+
60
+ spa_ext = Extension ('pvlib.spa_c_files.spa_py' ,
61
+ sources = spa_sources , depends = spa_depends )
62
+ extensions .append (spa_ext )
63
+ else :
64
+ print ('WARNING: spa_c files not detected. ' +
65
+ 'See installation instructions for more information.' )
57
66
58
67
59
68
setup (name = DISTNAME ,
You can’t perform that action at this time.
0 commit comments