Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TST: avoid distutils.sysconfig in runtests.py #19628

Merged
merged 3 commits into from
Aug 11, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 13 additions & 3 deletions runtests.py
Original file line number Diff line number Diff line change
Expand Up @@ -474,9 +474,19 @@ def build_project(args):
'--single-version-externally-managed',
'--record=' + dst_dir + 'tmp_install_log.txt']

from distutils.sysconfig import get_python_lib
site_dir = get_python_lib(prefix=dst_dir, plat_specific=True)
site_dir_noarch = get_python_lib(prefix=dst_dir, plat_specific=False)
py_v_s = sysconfig.get_config_var('py_version_short')
platlibdir = getattr(sys, 'platlibdir', '') # Python3.9+
site_dir_template = sysconfig.get_path('platlib', expand=False)
site_dir = site_dir_template.format(platbase=dst_dir,
py_version_short=py_v_s,
platlibdir=platlibdir,
)
noarch_template = sysconfig.get_path('purelib', expand=False)
site_dir_noarch = noarch_template.format(base=dst_dir,
py_version_short=py_v_s,
platlibdir=platlibdir,
)

# 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.
if not os.path.exists(site_dir):
Expand Down