summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGiampaolo Rodola <g.rodola@gmail.com>2020-02-15 16:19:38 +0100
committerGiampaolo Rodola <g.rodola@gmail.com>2020-02-15 16:19:38 +0100
commit1116493dd63b132e12b975c2013751a278a3d4da (patch)
tree6bb6383d75f112125f39fee28af672a70fb3618a
parent045baa1dfe0836e46fe078e0473fa0576e3ab960 (diff)
downloadpsutil-1116493dd63b132e12b975c2013751a278a3d4da.tar.gz
port win_download_exes.py scrip
-rw-r--r--MANIFEST.in3
-rw-r--r--Makefile2
-rwxr-xr-xscripts/internal/win_download_wheels.py (renamed from scripts/internal/download_exes.py)8
3 files changed, 8 insertions, 5 deletions
diff --git a/MANIFEST.in b/MANIFEST.in
index 038d4baa..e6a7cf3a 100644
--- a/MANIFEST.in
+++ b/MANIFEST.in
@@ -1,3 +1,4 @@
+include .cirrus.yml
include .coveragerc
include .gitignore
include CREDITS
@@ -114,7 +115,6 @@ include scripts/internal/README
include scripts/internal/bench_oneshot.py
include scripts/internal/bench_oneshot_2.py
include scripts/internal/check_broken_links.py
-include scripts/internal/download_exes.py
include scripts/internal/fix_flake8.py
include scripts/internal/generate_manifest.py
include scripts/internal/print_access_denied.py
@@ -123,6 +123,7 @@ include scripts/internal/print_api_speed.py
include scripts/internal/print_timeline.py
include scripts/internal/purge_installation.py
include scripts/internal/scriptutils.py
+include scripts/internal/win_download_wheels.py
include scripts/internal/winmake.py
include scripts/iotop.py
include scripts/killall.py
diff --git a/Makefile b/Makefile
index 890c6e41..dba9dacf 100644
--- a/Makefile
+++ b/Makefile
@@ -197,7 +197,7 @@ wheel: ## Generate wheel.
$(PYTHON) setup.py bdist_wheel
win-download-wheels: ## Download wheels hosted on appveyor.
- $(TEST_PREFIX) $(PYTHON) scripts/internal/download_exes.py --user giampaolo --project psutil
+ $(TEST_PREFIX) $(PYTHON) scripts/internal/win_download_wheels.py --user giampaolo --project psutil
upload-src: ## Upload source tarball on https://pypi.org/project/psutil/
${MAKE} sdist
diff --git a/scripts/internal/download_exes.py b/scripts/internal/win_download_wheels.py
index 4a559bb0..0cb37afe 100755
--- a/scripts/internal/download_exes.py
+++ b/scripts/internal/win_download_wheels.py
@@ -19,10 +19,11 @@ import errno
import os
import requests
import shutil
+import sys
from psutil import __version__ as PSUTIL_VERSION
from psutil._common import bytes2human
-from scriptutils import printerr, exit
+from psutil._common import print_color
BASE_URL = 'https://ci.appveyor.com/api'
@@ -81,7 +82,8 @@ def get_file_urls(options):
file_url = job_url + '/' + item['fileName']
urls.append(file_url)
if not urls:
- exit("no artifacts found")
+ print_color("no artifacts found", 'ret')
+ sys.exit(1)
else:
for url in sorted(urls, key=lambda x: os.path.basename(x)):
yield url
@@ -111,7 +113,7 @@ def run(options):
try:
local_fname = fut.result()
except Exception:
- printerr("error while downloading %s" % (url))
+ print_color("error while downloading %s" % (url), 'red')
raise
else:
completed += 1