INNER CODE UNIT · Python
resolve_mirror
PKU-EMBL/BASALT · BASALT_setup_China_mainland.py:283
def resolve_mirror(
args: argparse.Namespace,
) -> Tuple[str, List[str], Optional[str]]:
"""Resolve Conda channels and a matching PyPI endpoint."""
if args.channel:
pip_index = None if args.no_pip_mirror else args.pip_index_url
return "custom", list(args.channel), pip_index
name = args.mirror
if name == "auto":
if args.dry_run:
name = "tuna"
print("Dry-run: using TUNA as the representative automatic mirror.")
else:
for candidate in ("tuna", "bfsu", "ustc", "upstream"):
preset = MIRRORS[candidate]
print("Checking {} ...".format(preset["label"]))
if mirror_is_reachable(preset["channels"]):