MCPcopy Create free account
hub / github.com/conda/constructor / copy_conda_exe

Function copy_conda_exe

constructor/utils.py:308–322  ·  view source on GitHub ↗
(
    target_directory: str | Path,
    target_conda_exe_name: str | None = None,
    conda_exe: str | Path | None = None,
)

Source from the content-addressed store, hash-verified

306
307
308def copy_conda_exe(
309 target_directory: str | Path,
310 target_conda_exe_name: str | None = None,
311 conda_exe: str | Path | None = None,
312) -> list[Path]:
313 if conda_exe is None:
314 conda_exe = normalize_path(join(sys.prefix, "standalone_conda", "conda.exe"))
315 if target_conda_exe_name is None:
316 target_conda_exe_name = Path(conda_exe).name
317 shutil.copyfile(conda_exe, join(target_directory, target_conda_exe_name))
318 if (internal_dir := Path(conda_exe).parent / "_internal").is_dir():
319 # onedir conda-standalone variant, copy that too
320 shutil.copytree(internal_dir, Path(target_directory, "_internal"), dirs_exist_ok=True)
321 return sorted([p for p in Path(target_directory, "_internal").glob("**/*") if p.is_file()])
322 return []
323
324
325def identify_conda_exe(conda_exe: str | Path | None = None) -> tuple[StandaloneExe, str]:

Callers 4

createFunction · 0.85
createFunction · 0.85
createFunction · 0.85
_stage_condaMethod · 0.85

Calls 1

normalize_pathFunction · 0.85

Tested by

no test coverage detected