@@ -62,7 +62,8 @@ def get_gsl_config():
6262 return rv
6363 else :
6464 warnings .warn (
65- f"CONDA_PREFIX is set to { conda_prefix } , " "but GSL not found at those paths. Proceeding..."
65+ f"CONDA_PREFIX is set to { conda_prefix } , "
66+ "but GSL not found at those paths. Proceeding..."
6667 )
6768
6869 # 2. Check using GSL_PATH.
@@ -76,7 +77,8 @@ def get_gsl_config():
7677 return rv
7778 else :
7879 raise EnvironmentError (
79- f"GSL_PATH={ gsl_path } is set, but { inc } or { lib } not found. " "Please verify your GSL_PATH."
80+ f"GSL_PATH={ gsl_path } is set, but { inc } or { lib } not found. "
81+ "Please verify your GSL_PATH."
8082 )
8183
8284 # 3. Try using the gsl-config executable (only on Unix-like systems).
@@ -92,8 +94,14 @@ def get_gsl_config():
9294 lib_match = re .search (r"(?m)^[^#]*\s-L(\S+)" , txt )
9395 if prefix_match :
9496 prefix_path = Path (prefix_match .group (1 ))
95- inc_dir = include_match .group (1 ) if include_match else (prefix_path / "include" )
96- lib_dir = lib_match .group (1 ) if lib_match else (prefix_path / "lib" )
97+ inc_dir = (
98+ include_match .group (1 )
99+ if include_match
100+ else (prefix_path / "include" )
101+ )
102+ lib_dir = (
103+ lib_match .group (1 ) if lib_match else (prefix_path / "lib" )
104+ )
97105 rv ["include_dirs" ].append (str (inc_dir ))
98106 rv ["library_dirs" ].append (str (lib_dir ))
99107 return rv
@@ -164,7 +172,14 @@ def create_extensions():
164172
165173 compiler_type = get_compiler_type ()
166174 if compiler_type in ("unix" , "cygwin" , "mingw32" ):
167- extra_compile_args = ["-std=c++11" , "-Wall" , "-Wno-write-strings" , "-O3" , "-funroll-loops" , "-ffast-math" ]
175+ extra_compile_args = [
176+ "-std=c++11" ,
177+ "-Wall" ,
178+ "-Wno-write-strings" ,
179+ "-O3" ,
180+ "-funroll-loops" ,
181+ "-ffast-math" ,
182+ ]
168183 # Check for static GSL libraries and add them if found.
169184 static_libs = [
170185 os .path .join (p , "libgsl.a" )
@@ -189,15 +204,21 @@ def create_extensions():
189204 "extra_link_args" : extra_link_args ,
190205 "extra_objects" : extra_objects ,
191206 }
192- ext = Extension ("diffpy.pdffit2.pdffit2" , glob .glob ("src/extensions/**/*.cc" ), ** ext_kws )
207+ ext = Extension (
208+ "diffpy.pdffit2.pdffit2" ,
209+ glob .glob ("src/extensions/**/*.cc" ),
210+ ** ext_kws ,
211+ )
193212 return [ext ]
194213
195214
215+ # Extensions not included in pyproject.toml
196216setup_args = dict (
197217 ext_modules = [],
198218 cmdclass = {"build_ext" : CustomBuildExt },
199219)
200220
221+
201222if __name__ == "__main__" :
202223 setup_args ["ext_modules" ] = create_extensions ()
203224 setup (** setup_args )
0 commit comments