8000 Deduplicate pyright version by Avasam · Pull Request #9299 · python/typeshed · GitHub
[go: up one dir, main page]

Skip to content

Deduplicate pyright version #9299

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Nov 30, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Store pyright version in pyproject.toml
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
  • Loading branch information
Avasam and AlexWaygood committed Nov 29, 2022
commit 35312d4a1ece592cfe91de7192b13062cc5f4486
12 changes: 8 additions & 4 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -113,24 +113,28 @@ jobs:
steps:
- uses: actions/checkout@v3
- name: Get pyright version
run: echo "PYRIGHT_VERSION=$(<tests/PYRIGHT_VERSION.txt)" >> $GITHUB_ENV
uses: SebRollen/toml-action@v1.0.2
id: pyright_version
with:
file: 'pyproject.toml'
field: 'tool.typeshed.pyright_version'
- uses: jakebailey/pyright-action@v1
with:
version: ${{ env.PYRIGHT_VERSION }}
version: ${{ steps.pyright_version.outputs.value }}
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.
project: ./pyrightconfig.stricter.json
- uses: jakebailey/pyright-action@v1
with:
version: ${{ env.PYRIGHT_VERSION }}
version: ${{ steps.pyright_version.outputs.value }}
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.
project: ./pyrightconfig.testcases.json
- uses: jakebailey/pyright-action@v1
with:
version: ${{ env.PYRIGHT_VERSION }}
version: ${{ steps.pyright_version.outputs.value }}
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.
Expand Down
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,6 @@ extra_standard_library = [
[tool.pycln]
all = true
disable_all_dunder_policy = true

[tool.typeshed]
pyright_version = "1.1.278"
1 change: 0 additions & 1 deletion tests/PYRIGHT_VERSION.txt

This file was deleted.

10 changes: 6 additions & 4 deletions tests/pyright_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
import sys
from pathlib import Path

import tomli

_WELL_KNOWN_FILE = Path("tests", "pyright_test.py")


Expand All @@ -27,11 +29,11 @@ def main() -> None:
print("error running npx; is Node.js installed?", file=sys.stderr)
sys.exit(1)

with open("tests/PYRIGHT_VERSION.txt", "r") as file:
PYRIGHT_VERSION = file.readline()
with open("pyproject.toml", "rb") as config:
pyright_version: str = tomli.load(config)["tool"]["typeshed"]["pyright_version"]

os.environ["PYRIGHT_PYTHON_FORCE_VERSION"] = PYRIGHT_VERSION
command = [npx, f"pyright@{PYRIGHT_VERSION}"] + sys.argv[1:]
os.environ["PYRIGHT_PYTHON_FORCE_VERSION"] = pyright_version
command = [npx, f"pyright@{pyright_version}"] + sys.argv[1:]
print("Running:", " ".join(command))

ret = subprocess.run(command).returncode
Expand Down
0