mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-07 20:54:28 +08:00
stubtest_stdlib: suppress output from pip (#9807)
This commit is contained in:
@@ -23,6 +23,7 @@ def run_stubtest(typeshed_dir: Path) -> int:
|
||||
combined_allowlist = f"{sys.platform}-py{sys.version_info.major}{sys.version_info.minor}.txt"
|
||||
with tempfile.TemporaryDirectory() as tmp:
|
||||
venv_dir = Path(tmp)
|
||||
print("Setting up an isolated virtual environment...", file=sys.stderr)
|
||||
try:
|
||||
pip_exe, python_exe = make_venv(venv_dir)
|
||||
except Exception:
|
||||
@@ -30,10 +31,20 @@ def run_stubtest(typeshed_dir: Path) -> int:
|
||||
raise
|
||||
|
||||
# Install the same mypy version as in "requirements-tests.txt"
|
||||
subprocess.run([pip_exe, "install", get_mypy_req()], check=True)
|
||||
try:
|
||||
install_command = [pip_exe, "install", get_mypy_req()]
|
||||
subprocess.run(install_command, check=True, text=True, capture_output=True)
|
||||
except subprocess.CalledProcessError as e:
|
||||
print(e.stderr, file=sys.stderr)
|
||||
raise
|
||||
|
||||
# Uninstall setuptools from the venv so we can test stdlib's distutils
|
||||
subprocess.run([pip_exe, "uninstall", "-y", "setuptools"], check=True)
|
||||
try:
|
||||
uninstall_command = [pip_exe, "uninstall", "-y", "setuptools"]
|
||||
subprocess.run(uninstall_command, check=True, text=True, capture_output=True)
|
||||
except subprocess.CalledProcessError as e:
|
||||
print(e.stderr, file=sys.stderr)
|
||||
raise
|
||||
|
||||
cmd = [
|
||||
python_exe,
|
||||
|
||||
Reference in New Issue
Block a user