mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-07-29 19:26:45 +08:00
Update most test/lint dependencies (#15582)
This commit is contained in:
+2
-4
@@ -186,14 +186,12 @@ def main() -> None:
|
||||
print("pre-commit", _SUCCESS)
|
||||
else:
|
||||
print("pre-commit", _FAILED)
|
||||
print(
|
||||
"""\
|
||||
print("""\
|
||||
Check the output of pre-commit for more details.
|
||||
This could mean that there's a lint failure on your code,
|
||||
but could also just mean that one of the pre-commit tools
|
||||
applied some autofixes. If the latter, you may want to check
|
||||
that the autofixes did sensible things."""
|
||||
)
|
||||
that the autofixes did sensible things.""")
|
||||
print("Check structure:", _SUCCESS if check_structure_result.returncode == 0 else _FAILED)
|
||||
if pyright_skipped:
|
||||
print("Pyright:", _SKIPPED)
|
||||
|
||||
@@ -222,8 +222,7 @@ def setup_gdb_stubtest_command(venv_dir: Path, stubtest_cmd: list[str]) -> bool:
|
||||
|
||||
gdb_script = venv_dir / "gdb_stubtest.py"
|
||||
wrapper_script = venv_dir / "gdb_wrapper.py"
|
||||
gdb_script_contents = dedent(
|
||||
f"""
|
||||
gdb_script_contents = dedent(f"""
|
||||
import json
|
||||
import os
|
||||
import site
|
||||
@@ -252,12 +251,10 @@ def setup_gdb_stubtest_command(venv_dir: Path, stubtest_cmd: list[str]) -> bool:
|
||||
traceback.print_exc()
|
||||
finally:
|
||||
gdb.execute(f"quit {{exit_code}}")
|
||||
"""
|
||||
)
|
||||
""")
|
||||
gdb_script.write_text(gdb_script_contents)
|
||||
|
||||
wrapper_script_contents = dedent(
|
||||
f"""
|
||||
wrapper_script_contents = dedent(f"""
|
||||
import json
|
||||
import os
|
||||
import subprocess
|
||||
@@ -277,8 +274,7 @@ def setup_gdb_stubtest_command(venv_dir: Path, stubtest_cmd: list[str]) -> bool:
|
||||
]
|
||||
r = subprocess.run(gdb_cmd, env=stubtest_env)
|
||||
sys.exit(r.returncode)
|
||||
"""
|
||||
)
|
||||
""")
|
||||
wrapper_script.write_text(wrapper_script_contents)
|
||||
|
||||
# replace "-m mypy.stubtest" in stubtest_cmd with the path to our wrapper script
|
||||
@@ -328,8 +324,7 @@ def setup_uwsgi_stubtest_command(dist: Path, venv_dir: Path, stubtest_cmd: list[
|
||||
uwsgi_script = venv_dir / "uwsgi_stubtest.py"
|
||||
wrapper_script = venv_dir / "uwsgi_wrapper.py"
|
||||
exit_code_surrogate = venv_dir / "exit_code"
|
||||
uwsgi_script_contents = dedent(
|
||||
f"""
|
||||
uwsgi_script_contents = dedent(f"""
|
||||
import json
|
||||
import os
|
||||
import sys
|
||||
@@ -340,8 +335,7 @@ def setup_uwsgi_stubtest_command(dist: Path, venv_dir: Path, stubtest_cmd: list[
|
||||
with open("{exit_code_surrogate}", mode="w") as fp:
|
||||
fp.write(str(exit_code))
|
||||
sys.exit(exit_code)
|
||||
"""
|
||||
)
|
||||
""")
|
||||
uwsgi_script.write_text(uwsgi_script_contents)
|
||||
|
||||
uwsgi_exe = venv_dir / "bin" / "uwsgi"
|
||||
@@ -351,8 +345,7 @@ def setup_uwsgi_stubtest_command(dist: Path, venv_dir: Path, stubtest_cmd: list[
|
||||
# will always go to stdout and uWSGI to stderr, but on
|
||||
# MacOS they both go to stderr, for now we deal with the
|
||||
# bit of extra spam
|
||||
wrapper_script_contents = dedent(
|
||||
f"""
|
||||
wrapper_script_contents = dedent(f"""
|
||||
import json
|
||||
import os
|
||||
import subprocess
|
||||
@@ -371,8 +364,7 @@ def setup_uwsgi_stubtest_command(dist: Path, venv_dir: Path, stubtest_cmd: list[
|
||||
subprocess.run(uwsgi_cmd, env=stubtest_env)
|
||||
with open("{exit_code_surrogate}", mode="r") as fp:
|
||||
sys.exit(int(fp.read()))
|
||||
"""
|
||||
)
|
||||
""")
|
||||
wrapper_script.write_text(wrapper_script_contents)
|
||||
|
||||
# replace "-m mypy.stubtest" in stubtest_cmd with the path to our wrapper script
|
||||
|
||||
Reference in New Issue
Block a user