(info)
| 26 | |
| 27 | |
| 28 | def _build_init_run_block(info): |
| 29 | if not info.get("_has_conda"): |
| 30 | return "" |
| 31 | |
| 32 | initialize_conda = info.get("initialize_conda") |
| 33 | if not initialize_conda or initialize_conda == "condabin": |
| 34 | return "" |
| 35 | |
| 36 | run = 'RUN "${PREFIX}/bin/conda" init --all' |
| 37 | |
| 38 | for record in info.get("_all_pkg_records", ()): |
| 39 | if not record.name == "mamba": |
| 40 | continue |
| 41 | if check_version(record.version, min_version="2.0.0"): |
| 42 | run += ' && "${PREFIX}/bin/mamba" shell init --shell bash' |
| 43 | else: |
| 44 | run += ' && "${PREFIX}/bin/python" -m mamba.mamba init --all' |
| 45 | break |
| 46 | |
| 47 | return run |
| 48 | |
| 49 | |
| 50 | def generate_dockerfile(info: dict, docker_dir: Path) -> Path: |
no test coverage detected