(
target_directory: str | Path,
target_conda_exe_name: str | None = None,
conda_exe: str | Path | None = None,
)
| 306 | |
| 307 | |
| 308 | def 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 | |
| 325 | def identify_conda_exe(conda_exe: str | Path | None = None) -> tuple[StandaloneExe, str]: |
no test coverage detected