@@ -84,49 +84,6 @@ def get_module_name(package_name):
84
84
return module_name .replace ('-' , '_' )
85
85
86
86
87
- def have_flang_new ():
88
- env_path = os .environ .get ('PATH' , '' ).split (os .pathsep )
89
- for p in env_path :
90
- flang_new = os .path .join (p , 'flang-new' )
91
- if os .path .isfile (flang_new ):
92
- return True
93
- return False
94
-
95
-
96
- def get_flang_new_lib_dir ():
97
- try :
98
- output = subprocess .check_output (['flang-new' , '--version' ])
99
- except (OSError , subprocess .CalledProcessError ):
100
- pass
101
- else :
102
- flang_dir = output .splitlines ()[- 1 ].split ()[- 1 ].strip ().decode ("utf-8" )
103
- return os .path .normpath (os .path .join (flang_dir , '..' , 'lib' ))
104
- return None
105
-
106
-
107
- def get_path_env_var (var ):
108
- env_var = os .environ .get (var , None )
109
- if isinstance (env_var , str ) and env_var .lower () == 'none' :
110
- env_var = None
111
- if isinstance (env_var , str ) and not os .path .exists (env_var ):
112
- env_var = None
113
- return env_var
114
-
115
-
116
- def have_lapack ():
117
- lapack_env = get_path_env_var ('LAPACK' )
118
- return lapack_env is not None
119
-
120
-
121
- def have_openblas ():
122
- blas_env = get_path_env_var ('BLAS' )
123
- return blas_env and 'openblas' in blas_env
124
-
125
-
126
- def append_env_var (env , var , value ):
127
- env [var ] = '{} {}' .format (env .get (var , '' ), value )
128
-
129
-
130
87
def pip_package (name = None , try_import = False ):
131
88
def decorator (func ):
132
89
def wrapper (* args , ** kwargs ):
@@ -165,59 +122,10 @@ def run_cmd(args, msg="", failOnError=True, cwd=None, env=None, quiet=False, **k
165
122
166
123
167
124
def known_packages ():
168
- @pip_package ()
169
- def h5py (** kwargs ):
170
- install_with_pip ('numpy' )
171
- install_from_pypi ("h5py==2.10.0" , ** kwargs )
172
-
173
- @pip_package ()
174
- def lightfm (** kwargs ):
175
- install_with_pip ('requests' )
176
- install_from_pypi ("lightfm==1.15" , ** kwargs )
177
-
178
- @pip_package ()
179
- def ninja (** kwargs ):
180
- install_with_pip ("scikit-build==0.16.6" )
181
- ninja_build_env = {}
182
- if sys .platform .startswith ('linux' ):
183
- ninja_build_env = {
184
- 'CC' : 'gcc' ,
185
- 'CXX' : 'g++' ,
186
- }
187
- install_with_pip ("ninja==1.11.1" , env = ninja_build_env , ** kwargs )
188
-
189
- @pip_package (name = "PIL" )
190
- def Pillow (** kwargs ):
191
- install_with_pip ('setuptools' )
192
- build_env = {"MAX_CONCURRENCY" : "0" }
193
- build_cmd = ["build_ext" , "--disable-jpeg" ]
194
- zlib_root = os .environ .get ("ZLIB_ROOT" , None )
195
- if zlib_root :
196
- build_cmd += ["-I" , os .path .join (zlib_root , "include" ), "-L" , os .path .join (zlib_root , "lib" )]
197
- else :
198
- info ("If Pillow installation fails due to missing zlib, try to set environment variable ZLIB_ROOT." )
199
- install_from_pypi ("Pillow==9.2.0" , build_cmd = build_cmd , env = build_env , ** kwargs )
200
-
201
- @pip_package ()
202
- def matplotlib (** kwargs ):
203
- install_with_pip ('setuptools' )
204
- install_with_pip ('certifi' )
205
- install_with_pip ('cycler' )
206
- install_with_pip ('cassowary' )
207
- install_with_pip ('pyparsing' )
208
- install_with_pip ('python_dateutil' )
209
- install_with_pip ('numpy' )
210
- Pillow (** kwargs )
211
- install_with_pip ('kiwisolver' )
212
-
213
- def download_freetype (extracted_dir ):
214
- target_dir = os .path .join (extracted_dir , "build" )
215
- os .makedirs (target_dir , exist_ok = True )
216
- package_pattern = os .environ .get ("GINSTALL_PACKAGE_PATTERN" , "https://sourceforge.net/projects/freetype/files/freetype2/2.6.1/%s.tar.gz" )
217
- _download_with_curl_and_extract (target_dir , package_pattern % "freetype-2.6.1" )
218
-
219
- install_from_pypi ("matplotlib==3.3.3" , pre_install_hook = download_freetype , ** kwargs )
220
-
125
+ # @pip_package()
126
+ # def lightfm(**kwargs):
127
+ # install_with_pip('requests')
128
+ # install_from_pypi("lightfm==1.15", **kwargs)
221
129
return locals ()
222
130
223
131
0 commit comments