urls is an iterable of tuples with url and md5 values
(info: dict, dst_dir: str, urls: tuple[str, str])
| 305 | |
| 306 | |
| 307 | def write_initial_state_explicit_txt(info: dict, dst_dir: str, urls: tuple[str, str]): |
| 308 | """ |
| 309 | urls is an iterable of tuples with url and md5 values |
| 310 | """ |
| 311 | header = dedent( |
| 312 | f""" |
| 313 | # This file may be used to create an environment using: |
| 314 | # $ conda create --name <env> --file <this file> |
| 315 | # platform: {info["_platform"]} |
| 316 | @EXPLICIT |
| 317 | """ |
| 318 | ).lstrip() |
| 319 | with open(join(dst_dir, "initial-state.explicit.txt"), "w") as envf: |
| 320 | envf.write(header) |
| 321 | for url, md5 in urls: |
| 322 | maybe_different_url = ensure_transmuted_ext(info, url) |
| 323 | if maybe_different_url != url: # transmuted, no md5 |
| 324 | envf.write(f"{maybe_different_url}\n") |
| 325 | else: |
| 326 | envf.write(f"{url}#{md5}\n") |
| 327 | |
| 328 | |
| 329 | def write_channels_txt(info: dict, dst_dir: str, env_config: dict): |
no test coverage detected