MCPcopy Index your code
hub / github.com/pyodide/pyodide / download_lockfile

Function download_lockfile

tools/create_lockfile_diff.py:113–128  ·  view source on GitHub ↗

Download a lockfile from a URL to a temporary directory. Args: url: The URL to download from. temp_dir: The temporary directory to save the file in. Returns: Path to the downloaded file.

(url: str, temp_dir: Path)

Source from the content-addressed store, hash-verified

111
112
113def download_lockfile(url: str, temp_dir: Path) -> Path:
114 """
115 Download a lockfile from a URL to a temporary directory.
116
117 Args:
118 url: The URL to download from.
119 temp_dir: The temporary directory to save the file in.
120
121 Returns:
122 Path to the downloaded file.
123 """
124 temp_dir.mkdir(parents=True, exist_ok=True)
125 filename = temp_dir / "lockfile.json"
126 print(f"Downloading lockfile from {url}...", file=sys.stderr)
127 urllib.request.urlretrieve(url, filename)
128 return filename
129
130
131def get_lockfile_path(path_or_url: str | None, is_old: bool, temp_dir: Path) -> Path:

Callers 1

get_lockfile_pathFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…