mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
gh-92906: Enable test_cext and test_cppext on Windows (#117000)
On Windows in release mode, the test_cext and test_cppext can now build C and C++ extensions. * test_cext now also builds the C extension without options. * test_cppext now also builds the C++ extension without options. * Add C++14 test to test_cppext; C++11 is not supported by MSVC. * Make setup_venv_with_pip_setuptools_wheel() quiet when support.verbose is false. Only show stdout and stderr on failure.
This commit is contained in:
parent
27cf3ed00c
commit
a114d08a89
7 changed files with 145 additions and 60 deletions
|
@ -2251,16 +2251,25 @@ def _findwheel(pkgname):
|
|||
# and returns the path to the venv directory and the path to the python executable
|
||||
@contextlib.contextmanager
|
||||
def setup_venv_with_pip_setuptools_wheel(venv_dir):
|
||||
import shlex
|
||||
import subprocess
|
||||
from .os_helper import temp_cwd
|
||||
|
||||
def run_command(cmd):
|
||||
if verbose:
|
||||
print()
|
||||
print('Run:', ' '.join(map(shlex.quote, cmd)))
|
||||
subprocess.run(cmd, check=True)
|
||||
else:
|
||||
subprocess.run(cmd,
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.STDOUT,
|
||||
check=True)
|
||||
|
||||
with temp_cwd() as temp_dir:
|
||||
# Create virtual environment to get setuptools
|
||||
cmd = [sys.executable, '-X', 'dev', '-m', 'venv', venv_dir]
|
||||
if verbose:
|
||||
print()
|
||||
print('Run:', ' '.join(cmd))
|
||||
subprocess.run(cmd, check=True)
|
||||
run_command(cmd)
|
||||
|
||||
venv = os.path.join(temp_dir, venv_dir)
|
||||
|
||||
|
@ -2275,10 +2284,7 @@ def setup_venv_with_pip_setuptools_wheel(venv_dir):
|
|||
'-m', 'pip', 'install',
|
||||
_findwheel('setuptools'),
|
||||
_findwheel('wheel')]
|
||||
if verbose:
|
||||
print()
|
||||
print('Run:', ' '.join(cmd))
|
||||
subprocess.run(cmd, check=True)
|
||||
run_command(cmd)
|
||||
|
||||
yield python
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue