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)
| 111 | |
| 112 | |
| 113 | def 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 | |
| 131 | def get_lockfile_path(path_or_url: str | None, is_old: bool, temp_dir: Path) -> Path: |
no outgoing calls
no test coverage detected
searching dependent graphs…