mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-14 21:49:34 +03:00
Python update-python-libraries: fetch and update asynchronously
This commit is contained in:
parent
6254141c92
commit
14da187ad6
1 changed files with 3 additions and 1 deletions
|
@ -18,6 +18,7 @@ import os
|
||||||
import re
|
import re
|
||||||
import requests
|
import requests
|
||||||
import toolz
|
import toolz
|
||||||
|
from concurrent.futures import ThreadPoolExecutor as pool
|
||||||
|
|
||||||
INDEX = "https://pypi.io/pypi"
|
INDEX = "https://pypi.io/pypi"
|
||||||
"""url of PyPI"""
|
"""url of PyPI"""
|
||||||
|
@ -235,7 +236,8 @@ def main():
|
||||||
|
|
||||||
packages = map(os.path.abspath, args.package)
|
packages = map(os.path.abspath, args.package)
|
||||||
|
|
||||||
count = list(map(_update, packages))
|
with pool() as p:
|
||||||
|
count = list(p.map(_update, packages))
|
||||||
|
|
||||||
logging.info("{} package(s) updated".format(sum(count)))
|
logging.info("{} package(s) updated".format(sum(count)))
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue