MCPcopy Index your code
hub / github.com/python/cpython / download

Function download

Platforms/Apple/__main__.py:341–363  ·  view source on GitHub ↗

Download the specified URL into the given directory. :return: The path to the downloaded archive.

(url: str, target_dir: Path)

Source from the content-addressed store, hash-verified

339
340
341def download(url: str, target_dir: Path) -> Path:
342 """Download the specified URL into the given directory.
343
344 :return: The path to the downloaded archive.
345 """
346 target_path = Path(target_dir).resolve()
347 target_path.mkdir(exist_ok=True, parents=True)
348
349 out_path = target_path / basename(url)
350 if not Path(out_path).is_file():
351 run([
352 "curl",
353 "-Lf",
354 "--retry",
355 "5",
356 "--retry-all-errors",
357 "-o",
358 out_path,
359 url,
360 ])
361 else:
362 print(f"Using cached version of {basename(url)}")
363 return out_path
364
365
366def configure_host_python(

Callers 1

unpack_depsFunction · 0.70

Calls 6

PathClass · 0.90
basenameFunction · 0.90
runFunction · 0.70
resolveMethod · 0.45
mkdirMethod · 0.45
is_fileMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…