MCPcopy Create free account
hub / github.com/apache/arrow / _link_or_copy

Function _link_or_copy

python/scripts/update_stub_docstrings.py:205–218  ·  view source on GitHub ↗
(source, destination)

Source from the content-addressed store, hash-verified

203
204
205def _link_or_copy(source, destination):
206 # Prefer symlinks (faster, no disk use) but fall back to copying when the
207 # filesystem doesn't support them (e.g. Docker volumes, network mounts).
208 if sys.platform != "win32":
209 try:
210 os.symlink(source, destination)
211 return
212 except OSError:
213 pass
214
215 if source.is_dir():
216 shutil.copytree(source, destination, symlinks=(sys.platform != "win32"))
217 else:
218 shutil.copy2(source, destination)
219
220
221def _create_importable_pyarrow(pyarrow_pkg, source_dir, install_pyarrow_dir):

Callers 1

Calls 1

is_dirMethod · 0.80

Tested by

no test coverage detected