summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKevin Modzelewski <kevmod@gmail.com>2021-09-16 16:17:22 -0400
committerKevin Modzelewski <kevmod@gmail.com>2021-09-17 16:03:02 -0400
commit0daa86b32c32e3b3b12fb6aee0b0f2ee881fff43 (patch)
tree98419a5b3536939bea2d53e82d9bdaa47c7f787f
parent5d75d4862fd3409b54a29a3523e60ac1d6e374ec (diff)
downloadnumpy-0daa86b32c32e3b3b12fb6aee0b0f2ee881fff43.tar.gz
TST: Make this sysconfig handling a bit more portable
In particular this supports Pyston, which has an additional format field in these path schemes. Instead of manually specifying which fields we think exist, do what I assume is the intention of using the default field values for everything except for the few that we want to override.
-rwxr-xr-xruntests.py17
1 files changed, 6 insertions, 11 deletions
diff --git a/runtests.py b/runtests.py
index 8ce9a639c..621d8b421 100755
--- a/runtests.py
+++ b/runtests.py
@@ -474,23 +474,18 @@ def build_project(args):
'--single-version-externally-managed',
'--record=' + dst_dir + 'tmp_install_log.txt']
- py_v_s = sysconfig.get_config_var('py_version_short')
- platlibdir = getattr(sys, 'platlibdir', '') # Python3.9+
+ config_vars = dict(sysconfig.get_config_vars())
+ config_vars["platbase"] = dst_dir
+ config_vars["base"] = dst_dir
+
site_dir_template = os.path.normpath(sysconfig.get_path(
'platlib', expand=False
))
- site_dir = site_dir_template.format(platbase=dst_dir,
- py_version_short=py_v_s,
- platlibdir=platlibdir,
- base=dst_dir,
- )
+ site_dir = site_dir_template.format(**config_vars)
noarch_template = os.path.normpath(sysconfig.get_path(
'purelib', expand=False
))
- site_dir_noarch = noarch_template.format(base=dst_dir,
- py_version_short=py_v_s,
- platlibdir=platlibdir,
- )
+ site_dir_noarch = noarch_template.format(**config_vars)
# easy_install won't install to a path that Python by default cannot see
# and isn't on the PYTHONPATH. Plus, it has to exist.