From f0e16b874358fc229acbb221d03a2f064b8beb6a Mon Sep 17 00:00:00 2001 From: Avasam Date: Mon, 23 Sep 2024 13:19:28 -0400 Subject: [PATCH] Add --threads argument to pyright cli (#12688) --- .github/workflows/meta_tests.yml | 1 + .github/workflows/tests.yml | 3 +++ tests/pyright_test.py | 2 +- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/meta_tests.yml b/.github/workflows/meta_tests.yml index ff62c90ae..f342bc41f 100644 --- a/.github/workflows/meta_tests.yml +++ b/.github/workflows/meta_tests.yml @@ -61,6 +61,7 @@ jobs: version: PATH python-platform: ${{ matrix.python-platform }} python-version: "3.9" # Oldest version supported for running scripts and tests + extra-args: --threads project: ./pyrightconfig.scripts_and_tests.json stubsabot-dry-run: name: Stubsabot dry run diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index e8f08fae3..e19b7ab0c 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -145,6 +145,7 @@ jobs: version: PATH python-platform: ${{ matrix.python-platform }} python-version: ${{ matrix.python-version }} + extra-args: --threads annotate: ${{ matrix.python-version == '3.12' && matrix.python-platform == 'Linux' }} # Having each job create the same comment is too noisy. - name: Run pyright with stricter settings on some of the stubs uses: jakebailey/pyright-action@v2 @@ -152,6 +153,7 @@ jobs: version: PATH python-platform: ${{ matrix.python-platform }} python-version: ${{ matrix.python-version }} + extra-args: --threads annotate: ${{ matrix.python-version == '3.12' && matrix.python-platform == 'Linux' }} # Having each job create the same comment is too noisy. project: ./pyrightconfig.stricter.json - name: Run pyright on the test cases @@ -160,6 +162,7 @@ jobs: version: PATH python-platform: ${{ matrix.python-platform }} python-version: ${{ matrix.python-version }} + extra-args: --threads annotate: ${{ matrix.python-version == '3.12' && matrix.python-platform == 'Linux' }} # Having each job create the same comment is too noisy. project: ./pyrightconfig.testcases.json diff --git a/tests/pyright_test.py b/tests/pyright_test.py index f6ff93fe1..7847512b7 100755 --- a/tests/pyright_test.py +++ b/tests/pyright_test.py @@ -37,7 +37,7 @@ def main() -> None: # version installed into the virtual environment, due to failures on some # platforms. https://github.com/python/typeshed/issues/11614 os.environ["PYRIGHT_PYTHON_FORCE_VERSION"] = pyright_version - command = [npx, f"pyright@{pyright_version}"] + sys.argv[1:] + command = [npx, f"pyright@{pyright_version}"] + sys.argv[1:] + ["--threads"] print_command(command) ret = subprocess.run(command).returncode