Skip to content

Commit c63dd59

Browse files
authored
Improve how we run pyright in CI (#10258)
Avoid using the deprecated `--venv-path` command-line argument
1 parent c402107 commit c63dd59

File tree

4 files changed

+3
-9
lines changed

4 files changed

+3
-9
lines changed

.github/workflows/tests.yml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -158,10 +158,10 @@ jobs:
158158
echo "Installing packages: $DEPENDENCIES"
159159
pip install $DEPENDENCIES
160160
fi
161+
- name: Activate the isolated venv for the rest of the job
162+
run: echo "$PWD/.venv/bin" >> $GITHUB_PATH
161163
- name: List 3rd-party stub dependencies installed
162-
run: |
163-
source .venv/bin/activate
164-
pip freeze --all
164+
run: pip freeze --all
165165
- name: Get pyright version
166166
uses: SebRollen/[email protected]
167167
id: pyright_version
@@ -175,15 +175,13 @@ jobs:
175175
python-platform: ${{ matrix.python-platform }}
176176
python-version: ${{ matrix.python-version }}
177177
no-comments: ${{ matrix.python-version != '3.11' || matrix.python-platform != 'Linux' }} # Having each job create the same comment is too noisy.
178-
venv-path: .
179178
- name: Run pyright with stricter settings on some of the stubs
180179
uses: jakebailey/pyright-action@v1
181180
with:
182181
version: ${{ steps.pyright_version.outputs.value }}
183182
python-platform: ${{ matrix.python-platform }}
184183
python-version: ${{ matrix.python-version }}
185184
no-comments: ${{ matrix.python-version != '3.11' || matrix.python-platform != 'Linux' }} # Having each job create the same comment is too noisy.
186-
venv-path: .
187185
project: ./pyrightconfig.stricter.json
188186
- name: Run pyright on the test cases
189187
uses: jakebailey/pyright-action@v1
@@ -192,7 +190,6 @@ jobs:
192190
python-platform: ${{ matrix.python-platform }}
193191
python-version: ${{ matrix.python-version }}
194192
no-comments: ${{ matrix.python-version != '3.11' || matrix.python-platform != 'Linux' }} # Having each job create the same comment is too noisy.
195-
venv-path: .
196193
project: ./pyrightconfig.testcases.json
197194

198195
stub-uploader:

pyrightconfig.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
{
22
"$schema": "https://github.com/raw/microsoft/pyright/main/packages/vscode-pyright/schemas/pyrightconfig.schema.json",
33
"typeshedPath": ".",
4-
"venv": ".venv",
54
"include": [
65
"stdlib",
76
"stubs",

pyrightconfig.stricter.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
{
22
"$schema": "https://github.com/raw/microsoft/pyright/main/packages/vscode-pyright/schemas/pyrightconfig.schema.json",
33
"typeshedPath": ".",
4-
"venv": ".venv",
54
"include": [
65
"stdlib",
76
"stubs",

pyrightconfig.testcases.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
{
22
"$schema": "https://github.com/raw/microsoft/pyright/main/packages/vscode-pyright/schemas/pyrightconfig.schema.json",
33
"typeshedPath": ".",
4-
"venv": ".venv",
54
"include": [
65
"test_cases",
76
"stubs/**/@tests/test_cases"

0 commit comments

Comments
 (0)