From af9e23b2576f723091bb8f72a9430674eaa19a0f Mon Sep 17 00:00:00 2001 From: AlexWaygood Date: Sun, 4 Jun 2023 16:25:13 +0100 Subject: [PATCH 1/5] Improve how we run pyright in CI --- .github/workflows/tests.yml | 6 +++--- pyrightconfig.json | 1 - pyrightconfig.stricter.json | 1 - pyrightconfig.testcases.json | 1 - 4 files changed, 3 insertions(+), 6 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 584595b9efe7..0e63fafa78d2 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -175,7 +175,7 @@ jobs: python-platform: ${{ matrix.python-platform }} python-version: ${{ matrix.python-version }} no-comments: ${{ matrix.python-version != '3.10' || matrix.python-platform != 'Linux' }} # Having each job create the same comment is too noisy. - venv-path: . + extra-args: '--pythonpath=".venv/bin/python"' - name: Run pyright with stricter settings on some of the stubs uses: jakebailey/pyright-action@v1 with: @@ -183,7 +183,7 @@ jobs: python-platform: ${{ matrix.python-platform }} python-version: ${{ matrix.python-version }} no-comments: ${{ matrix.python-version != '3.10' || matrix.python-platform != 'Linux' }} # Having each job create the same comment is too noisy. - venv-path: . + extra-args: '--pythonpath=".venv/bin/python"' project: ./pyrightconfig.stricter.json - name: Run pyright on the test cases uses: jakebailey/pyright-action@v1 @@ -192,7 +192,7 @@ jobs: python-platform: ${{ matrix.python-platform }} python-version: ${{ matrix.python-version }} no-comments: ${{ matrix.python-version != '3.10' || matrix.python-platform != 'Linux' }} # Having each job create the same comment is too noisy. - venv-path: . + extra-args: '--pythonpath=".venv/bin/python"' project: ./pyrightconfig.testcases.json stub-uploader: diff --git a/pyrightconfig.json b/pyrightconfig.json index 6b280cfcd8c7..c44602107c30 100644 --- a/pyrightconfig.json +++ b/pyrightconfig.json @@ -1,7 +1,6 @@ { "$schema": "https://raw.githubusercontent.com/microsoft/pyright/main/packages/vscode-pyright/schemas/pyrightconfig.schema.json", "typeshedPath": ".", - "venv": ".venv", "include": [ "stdlib", "stubs", diff --git a/pyrightconfig.stricter.json b/pyrightconfig.stricter.json index 00501276b5b1..a09066c14924 100644 --- a/pyrightconfig.stricter.json +++ b/pyrightconfig.stricter.json @@ -1,7 +1,6 @@ { "$schema": "https://raw.githubusercontent.com/microsoft/pyright/main/packages/vscode-pyright/schemas/pyrightconfig.schema.json", "typeshedPath": ".", - "venv": ".venv", "include": [ "stdlib", "stubs", diff --git a/pyrightconfig.testcases.json b/pyrightconfig.testcases.json index 7fa6aa777486..059df46cc608 100644 --- a/pyrightconfig.testcases.json +++ b/pyrightconfig.testcases.json @@ -1,7 +1,6 @@ { "$schema": "https://raw.githubusercontent.com/microsoft/pyright/main/packages/vscode-pyright/schemas/pyrightconfig.schema.json", "typeshedPath": ".", - "venv": ".venv", "include": [ "test_cases", "stubs/**/@tests/test_cases" From 3745cd8dad69cf7a2aa4436c2f6d2d362b6498bb Mon Sep 17 00:00:00 2001 From: AlexWaygood Date: Sun, 4 Jun 2023 17:17:52 +0100 Subject: [PATCH 2/5] Add the `--verbose` flag --- .github/workflows/tests.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 0e63fafa78d2..3c7c27b9fbb5 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -175,7 +175,7 @@ jobs: python-platform: ${{ matrix.python-platform }} python-version: ${{ matrix.python-version }} no-comments: ${{ matrix.python-version != '3.10' || matrix.python-platform != 'Linux' }} # Having each job create the same comment is too noisy. - extra-args: '--pythonpath=".venv/bin/python"' + extra-args: '--pythonpath=".venv/bin/python" --verbose' - name: Run pyright with stricter settings on some of the stubs uses: jakebailey/pyright-action@v1 with: @@ -183,7 +183,7 @@ jobs: python-platform: ${{ matrix.python-platform }} python-version: ${{ matrix.python-version }} no-comments: ${{ matrix.python-version != '3.10' || matrix.python-platform != 'Linux' }} # Having each job create the same comment is too noisy. - extra-args: '--pythonpath=".venv/bin/python"' + extra-args: '--pythonpath=".venv/bin/python" --verbose' project: ./pyrightconfig.stricter.json - name: Run pyright on the test cases uses: jakebailey/pyright-action@v1 @@ -192,7 +192,7 @@ jobs: python-platform: ${{ matrix.python-platform }} python-version: ${{ matrix.python-version }} no-comments: ${{ matrix.python-version != '3.10' || matrix.python-platform != 'Linux' }} # Having each job create the same comment is too noisy. - extra-args: '--pythonpath=".venv/bin/python"' + extra-args: '--pythonpath=".venv/bin/python" --verbose' project: ./pyrightconfig.testcases.json stub-uploader: From 3d5cd419b32e41212a745392fd22a1095c34eafe Mon Sep 17 00:00:00 2001 From: AlexWaygood Date: Sun, 4 Jun 2023 17:23:23 +0100 Subject: [PATCH 3/5] Revert "Add the `--verbose` flag" This reverts commit 3745cd8dad69cf7a2aa4436c2f6d2d362b6498bb. --- .github/workflows/tests.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 3c7c27b9fbb5..0e63fafa78d2 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -175,7 +175,7 @@ jobs: python-platform: ${{ matrix.python-platform }} python-version: ${{ matrix.python-version }} no-comments: ${{ matrix.python-version != '3.10' || matrix.python-platform != 'Linux' }} # Having each job create the same comment is too noisy. - extra-args: '--pythonpath=".venv/bin/python" --verbose' + extra-args: '--pythonpath=".venv/bin/python"' - name: Run pyright with stricter settings on some of the stubs uses: jakebailey/pyright-action@v1 with: @@ -183,7 +183,7 @@ jobs: python-platform: ${{ matrix.python-platform }} python-version: ${{ matrix.python-version }} no-comments: ${{ matrix.python-version != '3.10' || matrix.python-platform != 'Linux' }} # Having each job create the same comment is too noisy. - extra-args: '--pythonpath=".venv/bin/python" --verbose' + extra-args: '--pythonpath=".venv/bin/python"' project: ./pyrightconfig.stricter.json - name: Run pyright on the test cases uses: jakebailey/pyright-action@v1 @@ -192,7 +192,7 @@ jobs: python-platform: ${{ matrix.python-platform }} python-version: ${{ matrix.python-version }} no-comments: ${{ matrix.python-version != '3.10' || matrix.python-platform != 'Linux' }} # Having each job create the same comment is too noisy. - extra-args: '--pythonpath=".venv/bin/python" --verbose' + extra-args: '--pythonpath=".venv/bin/python"' project: ./pyrightconfig.testcases.json stub-uploader: From 59deecb93d9dd49714b33a04a20559774eeb3ed6 Mon Sep 17 00:00:00 2001 From: AlexWaygood Date: Sun, 4 Jun 2023 18:03:59 +0100 Subject: [PATCH 4/5] Try without the quotes --- .github/workflows/tests.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 0e63fafa78d2..601a9f2e2143 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -175,7 +175,7 @@ jobs: python-platform: ${{ matrix.python-platform }} python-version: ${{ matrix.python-version }} no-comments: ${{ matrix.python-version != '3.10' || matrix.python-platform != 'Linux' }} # Having each job create the same comment is too noisy. - extra-args: '--pythonpath=".venv/bin/python"' + extra-args: "--pythonpath=.venv/bin/python" - name: Run pyright with stricter settings on some of the stubs uses: jakebailey/pyright-action@v1 with: @@ -183,7 +183,7 @@ jobs: python-platform: ${{ matrix.python-platform }} python-version: ${{ matrix.python-version }} no-comments: ${{ matrix.python-version != '3.10' || matrix.python-platform != 'Linux' }} # Having each job create the same comment is too noisy. - extra-args: '--pythonpath=".venv/bin/python"' + extra-args: "--pythonpath=.venv/bin/python" project: ./pyrightconfig.stricter.json - name: Run pyright on the test cases uses: jakebailey/pyright-action@v1 @@ -192,7 +192,7 @@ jobs: python-platform: ${{ matrix.python-platform }} python-version: ${{ matrix.python-version }} no-comments: ${{ matrix.python-version != '3.10' || matrix.python-platform != 'Linux' }} # Having each job create the same comment is too noisy. - extra-args: '--pythonpath=".venv/bin/python"' + extra-args: "--pythonpath=.venv/bin/python" project: ./pyrightconfig.testcases.json stub-uploader: From 9ba6f8b5c8450932a38cab5f4dea4d7c02ef5dfa Mon Sep 17 00:00:00 2001 From: AlexWaygood Date: Sun, 4 Jun 2023 23:52:05 +0100 Subject: [PATCH 5/5] Try Jake's suggestion using GITHUB_PATH --- .github/workflows/tests.yml | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 601a9f2e2143..2bdb76cd790e 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -158,10 +158,10 @@ jobs: echo "Installing packages: $DEPENDENCIES" pip install $DEPENDENCIES fi + - name: Activate the isolated venv for the rest of the job + run: echo "$PWD/.venv/bin" >> $GITHUB_PATH - name: List 3rd-party stub dependencies installed - run: | - source .venv/bin/activate - pip freeze --all + run: pip freeze --all - name: Get pyright version uses: SebRollen/toml-action@v1.0.2 id: pyright_version @@ -175,7 +175,6 @@ jobs: python-platform: ${{ matrix.python-platform }} python-version: ${{ matrix.python-version }} no-comments: ${{ matrix.python-version != '3.10' || matrix.python-platform != 'Linux' }} # Having each job create the same comment is too noisy. - extra-args: "--pythonpath=.venv/bin/python" - name: Run pyright with stricter settings on some of the stubs uses: jakebailey/pyright-action@v1 with: @@ -183,7 +182,6 @@ jobs: python-platform: ${{ matrix.python-platform }} python-version: ${{ matrix.python-version }} no-comments: ${{ matrix.python-version != '3.10' || matrix.python-platform != 'Linux' }} # Having each job create the same comment is too noisy. - extra-args: "--pythonpath=.venv/bin/python" project: ./pyrightconfig.stricter.json - name: Run pyright on the test cases uses: jakebailey/pyright-action@v1 @@ -192,7 +190,6 @@ jobs: python-platform: ${{ matrix.python-platform }} python-version: ${{ matrix.python-version }} no-comments: ${{ matrix.python-version != '3.10' || matrix.python-platform != 'Linux' }} # Having each job create the same comment is too noisy. - extra-args: "--pythonpath=.venv/bin/python" project: ./pyrightconfig.testcases.json stub-uploader: