MCPcopy Create free account
hub / github.com/modelscope/modelscope / _download_dist

Function _download_dist

modelscope/utils/plugins.py:552–567  ·  view source on GitHub ↗
(url, scratch_file, index_url, extra_index_url)

Source from the content-addressed store, hash-verified

550 return pip.__version__
551
552 def _download_dist(url, scratch_file, index_url, extra_index_url):
553 auth = None
554 if index_url:
555 parsed = urlparse(index_url)
556 if parsed.username and parsed.password and parsed.hostname == urlparse(
557 url).hostname:
558 # handling private PyPI credentials in index_url
559 auth = (parsed.username, parsed.password)
560 if extra_index_url:
561 parsed = urlparse(extra_index_url)
562 if parsed.username and parsed.password and parsed.hostname == urlparse(
563 url).hostname:
564 # handling private PyPI credentials in extra_index_url
565 auth = (parsed.username, parsed.password)
566 target, _headers = urlretrieve(url, scratch_file, auth=auth)
567 return target, _headers
568
569 def _get_wheel_args(index_url, env, extra_index_url):
570 args = [

Callers 2

getFunction · 0.85
get_modules_from_packageFunction · 0.85

Calls 1

urlretrieveFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…