You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+26-2Lines changed: 26 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -22,7 +22,7 @@ GitHub action for [pyright](https://github.com/microsoft/pyright). Featuring:
22
22
inputs:
23
23
# Options for pyright-action
24
24
version:
25
-
description: 'Version of pyright to run. If neither version nor pylance-version are specified, the latest version will be used.'
25
+
description: 'Version of pyright to run, or "PATH" to use pyright from $PATH. If neither version nor pylance-version are specified, the latest version will be used.'
26
26
required: false
27
27
pylance-version:
28
28
description: 'Version of pylance whose pyright version should be run. Can be latest-release, latest-prerelease, or a specific pylance version. Ignored if version option is specified.'
@@ -143,7 +143,31 @@ poetry's python binary is on `$PATH`:
143
143
- uses: jakebailey/pyright-action@v2
144
144
```
145
145
146
-
## Keeping Pyright and Pylance in sync
146
+
## Providing a pyright version sourced from preexisting dependencies
147
+
148
+
The `version` input only accepts "latest" or a specific version number. However,
149
+
there are many ways to use specify a version of `pyright` derived from other
150
+
tools.
151
+
152
+
### Using pyright from `$PATH`
153
+
154
+
If you have `pyright` installed in your environment, e.g. via the `pyright` PyPI
155
+
package, specify `version: PATH` to use the version that's on `$PATH`.
156
+
157
+
```yml
158
+
- run: |
159
+
python -m venv .venv
160
+
source .venv/bin/activate
161
+
pip install -r dev-requirements.txt # includes pyright
162
+
163
+
- run: echo "$PWD/.venv/bin" >> $GITHUB_PATH
164
+
165
+
- uses: jakebailey/pyright-action@v2
166
+
with:
167
+
version: PATH
168
+
```
169
+
170
+
### Keeping Pyright and Pylance in sync
147
171
148
172
If you use Pylance as your language server, you'll likely want pyright-action to
149
173
use the same version of `pyright` that Pylance does. The `pylance-version`
Copy file name to clipboardExpand all lines: action.yml
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -8,7 +8,7 @@ branding:
8
8
inputs:
9
9
# Options for pyright-action
10
10
version:
11
-
description: 'Version of pyright to run. If neither version nor pylance-version are specified, the latest version will be used.'
11
+
description: 'Version of pyright to run, or "PATH" to use pyright from $PATH. If neither version nor pylance-version are specified, the latest version will be used.'
12
12
required: false
13
13
pylance-version:
14
14
description: 'Version of pylance whose pyright version should be run. Can be latest-release, latest-prerelease, or a specific pylance version. Ignored if version option is specified.'
0 commit comments