From 6ca80d340ef16714e61284df8338dac91479aa79 Mon Sep 17 00:00:00 2001 From: Samuel T Date: Wed, 21 Sep 2022 10:57:14 -0400 Subject: [PATCH] `pyright_test.py`: Support for npx 8 and pyright PyPI package (#8769) --- tests/pyright_test.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/pyright_test.py b/tests/pyright_test.py index 29c7ebc87..bfacf9c9c 100755 --- a/tests/pyright_test.py +++ b/tests/pyright_test.py @@ -1,5 +1,6 @@ #!/usr/bin/env python3 +import os import shutil import subprocess import sys @@ -27,7 +28,9 @@ def main() -> None: print("error running npx; is Node.js installed?", file=sys.stderr) sys.exit(1) - command = [npx, "-p", f"pyright@{_PYRIGHT_VERSION}", "pyright"] + sys.argv[1:] + os.environ["PYRIGHT_PYTHON_FORCE_VERSION"] = _PYRIGHT_VERSION + command = [npx, f"pyright@{_PYRIGHT_VERSION}"] + sys.argv[1:] + print("Running:", " ".join(command)) ret = subprocess.run(command).returncode sys.exit(ret)