summaryrefslogtreecommitdiff
path: root/benchmarks/asv_pip_nopep517.py
diff options
context:
space:
mode:
authorSayed Adel <seiko@imavr.com>2020-11-09 03:32:54 +0200
committerSayed Adel <seiko@imavr.com>2020-11-09 03:34:54 +0200
commit11728e8a3cf967455aacc36e2d2237745b07c1e7 (patch)
tree478848b9ba8d1b50789126874590ffb67c909e38 /benchmarks/asv_pip_nopep517.py
parent5f071c67660dd3eedd6eddb39681cd2943166e68 (diff)
downloadnumpy-11728e8a3cf967455aacc36e2d2237745b07c1e7.tar.gz
BUG, Benchmark: fix passing optimization build options to asv
Diffstat (limited to 'benchmarks/asv_pip_nopep517.py')
-rw-r--r--benchmarks/asv_pip_nopep517.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/benchmarks/asv_pip_nopep517.py b/benchmarks/asv_pip_nopep517.py
new file mode 100644
index 000000000..9ba165493
--- /dev/null
+++ b/benchmarks/asv_pip_nopep517.py
@@ -0,0 +1,15 @@
+"""
+This file is used by asv_compare.conf.json.tpl.
+"""
+import subprocess, sys
+# pip ignores '--global-option' when pep517 is enabled therefore we disable it.
+cmd = [sys.executable, '-mpip', 'wheel', '--no-use-pep517']
+try:
+ output = subprocess.check_output(cmd, stderr=subprocess.STDOUT, universal_newlines=True)
+except Exception as e:
+ output = str(e.output)
+if "no such option" in output:
+ print("old version of pip, escape '--no-use-pep517'")
+ cmd.pop()
+
+subprocess.run(cmd + sys.argv[1:])