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

Function _prepare_sources

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

Source from the content-addressed store, hash-verified

180
181
182def _prepare_sources(mname, sources, bdir):
183 extended_sources = sources.copy()
184 Path(bdir).mkdir(parents=True, exist_ok=True)
185 # Copy sources
186 for source in sources:
187 if Path(source).exists() and Path(source).is_file():
188 shutil.copy(source, bdir)
189 generated_sources = [
190 Path(f"{mname}module.c"),
191 Path(f"{mname}-f2pywrappers2.f90"),
192 Path(f"{mname}-f2pywrappers.f"),
193 ]
194 bdir = Path(bdir)
195 for generated_source in generated_sources:
196 if generated_source.exists():
197 shutil.copy(generated_source, bdir / generated_source.name)
198 extended_sources.append(generated_source.name)
199 generated_source.unlink()
200 extended_sources = [
201 Path(source).name
202 for source in extended_sources
203 if not Path(source).suffix == ".pyf"
204 ]
205 return extended_sources

Callers 1

compileMethod · 0.85

Calls 2

copyMethod · 0.45
existsMethod · 0.45

Tested by

no test coverage detected