MCPcopy Index your code
hub / github.com/numpy/numpy / setup_method

Method setup_method

numpy/f2py/tests/util.py:384–421  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

382 F2PyTest._has_fortran_compiler = has_fortran_compiler()
383
384 def setup_method(self):
385 if self.module is not None:
386 return
387
388 codes = self.sources or []
389 if self.code:
390 codes.append(self.suffix)
391
392 needs_f77 = any(str(fn).endswith(".f") for fn in codes)
393 needs_f90 = any(str(fn).endswith(".f90") for fn in codes)
394 needs_pyf = any(str(fn).endswith(".pyf") for fn in codes)
395
396 if needs_f77 and not self._has_f77_compiler:
397 pytest.skip("No Fortran 77 compiler available")
398 if needs_f90 and not self._has_f90_compiler:
399 pytest.skip("No Fortran 90 compiler available")
400 if needs_pyf and not self._has_fortran_compiler:
401 pytest.skip("No Fortran compiler available")
402
403 # Build the module
404 if self.code is not None:
405 self.module = build_code(
406 self.code,
407 options=self.options,
408 skip=self.skip,
409 only=self.only,
410 suffix=self.suffix,
411 module_name=self.module_name,
412 )
413
414 if self.sources is not None:
415 self.module = build_module(
416 self.sources,
417 options=self.options,
418 skip=self.skip,
419 only=self.only,
420 module_name=self.module_name,
421 )
422
423
424#

Callers

nothing calls this directly

Calls 4

anyFunction · 0.85
build_codeFunction · 0.85
build_moduleFunction · 0.85
endswithMethod · 0.80

Tested by

no test coverage detected