MCPcopy Create free account
hub / github.com/numpy/numpy / _prepare_sources

Function _prepare_sources

numpy/f2py/_backends/_meson.py:201–224  ·  view source on GitHub ↗
(mname, sources, bdir)

Source from the content-addressed store, hash-verified

199
200
201def _prepare_sources(mname, sources, bdir):
202 extended_sources = sources.copy()
203 Path(bdir).mkdir(parents=True, exist_ok=True)
204 # Copy sources
205 for source in sources:
206 if Path(source).exists() and Path(source).is_file():
207 shutil.copy(source, bdir)
208 generated_sources = [
209 Path(f"{mname}module.c"),
210 Path(f"{mname}-f2pywrappers2.f90"),
211 Path(f"{mname}-f2pywrappers.f"),
212 ]
213 bdir = Path(bdir)
214 for generated_source in generated_sources:
215 if generated_source.exists():
216 shutil.copy(generated_source, bdir / generated_source.name)
217 extended_sources.append(generated_source.name)
218 generated_source.unlink()
219 extended_sources = [
220 Path(source).name
221 for source in extended_sources
222 if not Path(source).suffix == ".pyf"
223 ]
224 return extended_sources
225
226def _prepare_objects(mname, objects, bdir):
227 Path(bdir).mkdir(parents=True, exist_ok=True)

Callers 1

compileMethod · 0.85

Calls 2

copyMethod · 0.45
existsMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…