10
10
from setuptools import setup , Extension , find_packages
11
11
12
12
my_name = 'ylearn'
13
+ excludes_on_windows = ['torch' , ]
13
14
14
15
15
16
def read_requirements (file_path = 'requirements.txt' ):
@@ -20,8 +21,12 @@ def read_requirements(file_path='requirements.txt'):
20
21
lines = f .readlines ()
21
22
22
23
lines = [x .strip ('\n ' ).strip (' ' ) for x in lines ]
23
- lines = list ( filter (lambda x : len (x ) > 0 and not x .startswith ('#' ), lines ) )
24
+ lines = filter (lambda x : len (x ) > 0 and not x .startswith ('#' ), lines )
24
25
26
+ is_os_windows = sys .platform .find ('win' ) == 0
27
+ if is_os_windows :
28
+ lines = filter (lambda x : x not in excludes_on_windows , lines )
29
+ lines = list (lines )
25
30
return lines
26
31
27
32
@@ -54,7 +59,6 @@ def execfile(fname, globs, locs=None):
54
59
version_ns = {}
55
60
execfile (P .join (HERE , my_name , '_version.py' ), version_ns )
56
61
version = version_ns ['__version__' ]
57
- print ("__version__=" + version )
58
62
59
63
np_include = numpy .get_include ()
60
64
pyx_files = glob (f"{ my_name } /**/*.pyx" , recursive = True )
@@ -72,9 +76,13 @@ def execfile(fname, globs, locs=None):
72
76
raise FileNotFoundError (f'Not found c file for { pf } , '
73
77
f'run "python setup.py build_ext --inplace" to generate c files.' )
74
78
pyx_modules = []
79
+
80
+ print ('cmdline:' , ' ' .join (sys .argv ))
81
+ print (f'{ my_name } .__version__:' + version )
82
+ print ('np_version:' , numpy .__version__ )
83
+ print ('np_include:' , np_include )
75
84
print ('pyx extensions:' , pyx_modules )
76
85
print ('cpp extensions:' , c_modules )
77
- print ('np_include' , np_include )
78
86
79
87
c_modules = list (map (lambda f : Extension (f .replace (os .sep , '.' ), [f'{ f } .cpp' ], include_dirs = [np_include ]), c_modules ))
80
88
if pyx_modules :
0 commit comments