Skip to content

Commit

Permalink
Use 'version: PATH' for pyright-action (#11743)
Browse files Browse the repository at this point in the history
This eliminates the need to parse out a pyright version, download, etc, if the environment already has it installed, which is the case for the workflows in this repo.
  • Loading branch information
jakebailey authored Apr 12, 2024
1 parent bc8fc36 commit b61d90c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 16 deletions.
8 changes: 1 addition & 7 deletions .github/workflows/meta_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,16 +56,10 @@ jobs:
python-version: "3.11"
- run: curl -LsSf https://astral.sh/uv/install.sh | sh
- run: uv pip install -r requirements-tests.txt --system
- name: Get pyright version
id: pyright_version
run: |
PYRIGHT_VERSION=$(grep pyright== requirements-tests.txt | cut -d "#" -f 1 | cut -d \; -f 1 | cut -d = -f 3)
echo pyright version: "${PYRIGHT_VERSION}"
echo PYRIGHT_VERSION="${PYRIGHT_VERSION}" >> "${GITHUB_OUTPUT}"
- name: Run pyright on typeshed
uses: jakebailey/pyright-action@v2
with:
version: ${{ steps.pyright_version.outputs.PYRIGHT_VERSION }}
version: PATH
python-platform: ${{ matrix.python-platform }}
python-version: "3.9" # The Python version to test against.
project: ./pyrightconfig.scripts_and_tests.json
Expand Down
12 changes: 3 additions & 9 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -129,31 +129,25 @@ jobs:
run: echo "$PWD/.venv/bin" >> $GITHUB_PATH
- name: List 3rd-party stub dependencies installed
run: uv pip freeze
- name: Get pyright version
id: pyright_version
run: |
PYRIGHT_VERSION=$(grep pyright== requirements-tests.txt | cut -d "#" -f 1 | cut -d \; -f 1 | cut -d = -f 3)
echo pyright version: "${PYRIGHT_VERSION}"
echo PYRIGHT_VERSION="${PYRIGHT_VERSION}" >> "${GITHUB_OUTPUT}"
- name: Run pyright with basic settings on all the stubs
uses: jakebailey/pyright-action@v2
with:
version: ${{ steps.pyright_version.outputs.PYRIGHT_VERSION }}
version: PATH
python-platform: ${{ matrix.python-platform }}
python-version: ${{ matrix.python-version }}
annotate: ${{ matrix.python-version == '3.11' && 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
with:
version: ${{ steps.pyright_version.outputs.PYRIGHT_VERSION }}
version: PATH
python-platform: ${{ matrix.python-platform }}
python-version: ${{ matrix.python-version }}
annotate: ${{ matrix.python-version == '3.11' && 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
uses: jakebailey/pyright-action@v2
with:
version: ${{ steps.pyright_version.outputs.PYRIGHT_VERSION }}
version: PATH
python-platform: ${{ matrix.python-platform }}
python-version: ${{ matrix.python-version }}
annotate: ${{ matrix.python-version == '3.11' && matrix.python-platform == 'Linux' }} # Having each job create the same comment is too noisy.
Expand Down

0 comments on commit b61d90c

Please sign in to comment.