git.iko.soy/typeable/nixpkgs
on master help sign in
Python update-python-libraries: fetch and update asynchronously
commit14da187ad60b46a0e657933fd55d99cbb00e1c5c authorFrederik Rietdijk <fridh@fridh.nl> dateSun 5 Nov 2017, 11:08 (9 years ago) parent6254141
1 file changed+3−1
maintainers/scripts/update-python-libraries+3−1
maintainers/scripts/update-python-libraries+3−1
@@ -18,6 +18,7 @@ import os
1818import re
1919import requests
2020import toolz
21+from concurrent.futures import ThreadPoolExecutor as pool
2122
2223INDEX = "https://pypi.io/pypi"
2324"""url of PyPI"""
@@ -235,7 +236,8 @@ def main():
235236
236237 packages = map(os.path.abspath, args.package)
237238
238− count = list(map(_update, packages))
239+ with pool() as p:
240+ count = list(p.map(_update, packages))
239241
240242 logging.info("{} package(s) updated".format(sum(count)))
241243