def _get_url_unpacked_path_or_null(url):
parsed = urllib.parse.urlparse(url)
if parsed.scheme == "file" and parsed.path.endswith(".whl"):
return Path("/dev/null")
try:
cache_dir, packed_path = _get_url_impl(url)
except CalledProcessError:
return Path("/dev/null")
if packed_path.is_file(): # pip://
shutil.unpack_archive(str(packed_path), cache_dir.name)
unpacked_path, = (
path for path in Path(cache_dir.name).iterdir() if path.is_dir())
return unpacked_path
评论列表
文章目录