1
0
mirror of https://github.com/pypiserver/pypiserver synced 2025-02-22 19:19:37 +01:00

make index_url an optional parameter to update()

This commit is contained in:
Mathias Ertl 2014-01-07 15:06:13 +01:00
parent b722c2a68f
commit 7061dd795d

@ -127,12 +127,12 @@ def find_updates(pkgset, stable_only=True, index_url="https://pypi.python.org/py
return need_update
def update(pkgset, destdir=None, dry_run=False, stable_only=True):
need_update = find_updates(pkgset, stable_only=stable_only)
def update(pkgset, destdir=None, dry_run=False, stable_only=True, index_url="https://pypi.python.org/simple"):
need_update = find_updates(pkgset, stable_only=stable_only, index_url=index_url)
for pkg in sorted(need_update, key=lambda x: x.pkgname):
sys.stdout.write("# update %s from %s to %s\n" % (pkg.pkgname, pkg.replaces.version, pkg.version))
cmd = ["pip", "-q", "install", "--no-deps", "-i", "https://pypi.python.org/simple",
cmd = ["pip", "-q", "install", "--no-deps", "-i", index_url,
"-d", destdir or os.path.dirname(pkg.replaces.fn),
"%s==%s" % (pkg.pkgname, pkg.version)]